Explorar o código

test: fix autofocus issue

Girish Ramakrishnan %!s(int64=8) %!d(string=hai) anos
pai
achega
ac2eaf3570
Modificáronse 1 ficheiros con 7 adicións e 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 () {