Speed up logout check: wait for notification

Change-Id: I1b4d61f555a6062f12ef9feaf60696e26415cdbd
diff --git a/lib/korap_rc.js b/lib/korap_rc.js
index ce6be0c..5493190 100644
--- a/lib/korap_rc.js
+++ b/lib/korap_rc.js
@@ -58,9 +58,12 @@
             return false
         }
         await page.click("a[class=logout]")
-        const username_field = await page.$("body > aside > div > fieldset > form > input[type=text]")
-        assert.notEqual(username_field, null)
-        return true
+        await page.waitForSelector('article.alertify-log');
+        const hasSuccessClass = await page.evaluate(() => {
+            const article = document.querySelector('article.alertify-log');
+            return article.classList.contains('alertify-log-success');
+          });
+        return hasSuccessClass
     }
 
     async assure_glimpse_off(page) {