Explorar el Código

test: fix autofocus issue

Girish Ramakrishnan hace 8 años
padre
commit
ac2eaf3570
Se han modificado 1 ficheros con 7 adiciones y 5 borrados
  1. 7 5
      test/test.js

+ 7 - 5
test/test.js

@@ -55,11 +55,13 @@ describe('Application life cycle test', function () {
     });
 
     function login(done) {
-        browser.get('https://' + app.fqdn + '/wp-login.php');
-        browser.findElement(by.id('user_login')).sendKeys(username);
-        browser.findElement(by.id('user_pass')).sendKeys(password);
-        browser.findElement(by.tagName('form')).submit();
-        browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), TIMEOUT).then(function () { done(); });
+        browser.get('https://' + app.fqdn + '/wp-login.php').then(function () {
+            browser.sleep(2000); // there seems to be some javascript that gives auto-focus to username
+            browser.findElement(by.id('user_login')).sendKeys(username);
+            browser.findElement(by.id('user_pass')).sendKeys(password);
+            browser.findElement(by.tagName('form')).submit();
+            browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), TIMEOUT).then(function () { done(); });
+        });
     }
 
     xit('build app', function () {