Clean up code

Change-Id: I286c0dc736af9a9b9b18dba3a6354e0e4cf5ae1d
diff --git a/lib/korap_rc.js b/lib/korap_rc.js
index c5356b8..8804bd2 100644
--- a/lib/korap_rc.js
+++ b/lib/korap_rc.js
@@ -1,6 +1,5 @@
-var chai = require('chai');
-var should = chai.should();
-var assert = chai.assert;
+const chai = require('chai');
+const assert = chai.assert;
 
 class KorAPRC {
     korap_url = ""
@@ -14,7 +13,8 @@
     }
 
     async login(page, username, password) {
-        await page.goto(this.korap_url, { waitUntil: 'networkidle0' });
+        if (this.login == "") return false;
+        await page.goto(this.korap_url);
         const username_field = await page.$("body > aside > div > fieldset > form > input[type=text]")
 
         if (username_field != null) {
@@ -24,7 +24,7 @@
             await page.keyboard.press("Enter")
         }
 
-        await page.waitForNavigation({ waitUntil: 'networkidle2' });
+        await page.waitForNavigation();
         const logout = await page.$("body > header > div > a[class=logout]")
         if (logout == null) {
             return false