ソースを参照

Adjust the test to ui changes

Johannes Zellner 8 年 前
コミット
45680c824b
1 ファイル変更18 行追加16 行削除
  1. 18 16
      test/test.js

+ 18 - 16
test/test.js

@@ -74,7 +74,7 @@ describe('Application life cycle test', function () {
         }).then(function () {
             return browser.sleep(3000);
         }).then(function () {
-            return browser.findElement(by.xpath('//button[text()="OK"]')).click();
+            return browser.findElement(by.xpath('//button[text()="Confirm"]')).click();
         }).then(function () {
             return browser.sleep(30000); // wait 30secs for reload
         }).then(function () {
@@ -109,21 +109,23 @@ describe('Application life cycle test', function () {
 
     function uploadImage(done) {
         browser.get('https://' + app.fqdn + '/user/admin/edit');
-        browser.findElement(by.xpath('//a[text()="Change Picture"]')).click().then(function () {
-            return browser.sleep(4000);
-        }).then(function () {
-            return browser.findElement(by.xpath('//span[contains(text(), "Upload New Picture")]')).click();
-        }).then(function () {
-            return browser.sleep(4000);
-        }).then(function () {
-            return browser.findElement(by.xpath('//input[@type="file"]')).sendKeys(path.resolve(__dirname, '../logo.png'));
-        }).then(function () {
-            browser.sleep(3000);
-        }).then(function () {
-            return browser.findElement(by.id('fileUploadSubmitBtn')).click();
-        }).then(function () {
-            browser.sleep(3000).then(function () { done(); });
-        });
+        browser.wait(until.elementLocated(by.xpath('//a[text()="Change Picture"]')), TEST_TIMEOUT.then(function () {
+            browser.findElement(by.xpath('//a[text()="Change Picture"]')).click().then(function () {
+                return browser.sleep(4000);
+            }).then(function () {
+                return browser.findElement(by.xpath('//span[contains(text(), "Upload New Picture")]')).click();
+            }).then(function () {
+                return browser.sleep(4000);
+            }).then(function () {
+                return browser.findElement(by.xpath('//input[@type="file"]')).sendKeys(path.resolve(__dirname, '../logo.png'));
+            }).then(function () {
+                browser.sleep(3000);
+            }).then(function () {
+                return browser.findElement(by.id('fileUploadSubmitBtn')).click();
+            }).then(function () {
+                browser.sleep(3000).then(function () { done(); });
+            });
+        }));
     }
 
     function checkImage(done) {