فهرست منبع

test: fix autofocus issue

Girish Ramakrishnan 8 سال پیش
والد
کامیت
ac2eaf3570
1فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  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 () {