Quellcode durchsuchen

Fixup the test selectors

Johannes Zellner vor 8 Jahren
Ursprung
Commit
67b93468a5
1 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen
  1. 10 10
      test/test.js

+ 10 - 10
test/test.js

@@ -103,16 +103,17 @@ describe('Application life cycle test SSO', function () {
     });
 
     it('can create project', function (done) {
-        browser.get('https://' + app.fqdn);
-
-        waitForElement(by.className('create-project-button'), function () {
+        browser.get('https://' + app.fqdn + '/projects/');
 
-            // click wont work
-            browser.findElement(by.className('create-project-button')).sendKeys(Keys.ENTER);
+        waitForElement(by.xpath('//div[@class="master"]//a[@title="Create project"]'), function () {
+            // clicks don't work with taiga
+            browser.findElement(by.xpath('//div[@class="master"]//a[@title="Create project"]')).sendKeys(Keys.ENTER);
 
             waitForElement(by.name('name'), function () {
                 browser.findElement(by.name('name')).sendKeys(PROJECT_NAME);
+                browser.sleep(1000);    // it needs some time to change focus!!
                 browser.findElement(by.xpath('//textarea[@name="description"]')).sendKeys(PROJECT_DESCRIPTION);
+                browser.sleep(1000);
 
                 browser.findElement(by.xpath('//button[@title="Create project"]')).click();
 
@@ -124,8 +125,9 @@ describe('Application life cycle test SSO', function () {
     it('can create user story', function (done) {
         browser.get('https://' + app.fqdn + '/project/' + process.env.USERNAME + '-' + PROJECT_NAME + '/backlog');
 
-        waitForElement(by.xpath('//a[@title="+ Add a new User Story"]'), function () {
-            browser.findElement(by.xpath('//a[@title="+ Add a new User Story"]')).sendKeys(Keys.ENTER);
+        waitForElement(by.xpath('//a[@tg-check-permission="add_us"]'), function () {
+            // clicks don't work with taiga
+            browser.findElement(by.xpath('//a[@tg-check-permission="add_us"]')).sendKeys(Keys.ENTER);
 
             waitForElement(by.name('subject'), function () {
                 browser.findElement(by.name('subject')).sendKeys(USER_STORY_SUBJECT);
@@ -171,9 +173,7 @@ describe('Application life cycle test SSO', function () {
                 browser.findElement(by.xpath('//a[@title="Yes, I\'m really sure"]')).click();
 
                 // give some time to redirect
-                setTimeout(function () {
-                    waitForElement(by.className('create-project-button'), done);
-                }, 5000);
+                setTimeout(done, 5000);
             });
         });
     });