Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
explicitly wait for buttons to become visible, to avoid slow animations
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmer committed Aug 21, 2021
1 parent 8e27a0d commit 38bce40
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion functions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
"target": "es2017",
"typeRoots": [ "node_modules/@types" ]
},
"compileOnSave": true,
"include": [
Expand Down
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@rollup/plugin-replace": "^2.4.1",
"@sveltejs/adapter-static": "^1.0.0-next.14",
"@sveltejs/kit": "1.0.0-next.141",
"@types/eslint": "^7.28.0",
"@types/jest": "^27.0.1",
"@types/selenium-webdriver": "^4.0.15",
"babel-core": "^7.0.0-bridge.0",
Expand Down
9 changes: 5 additions & 4 deletions tests/integration/ux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,23 @@ describe("Rally Web Platform extension interop", function () {
// Start to join study, but cancel.
await findAndAct(this.driver, By.xpath('//button[text()="Join Study"]'), e => e.click());
await findAndAct(this.driver, By.xpath('//button[text()="Cancel"]'), e => e.click());
await this.driver.wait(until.elementLocated(By.xpath('//button[text()="Join Study"]')), WAIT_FOR_PROPERTY);
await this.driver.wait(until.elementIsVisible(await this.driver.findElement(By.xpath('//button[text()="Join Study"]'))), WAIT_FOR_PROPERTY);

// Start to join study, and confirm.
await findAndAct(this.driver, By.xpath('//button[text()="Join Study"]'), e => e.click());
await findAndAct(this.driver, By.xpath('//button[text()="Accept & Enroll"]'), e => e.click());
await this.driver.wait(until.elementLocated(By.xpath('//button[text()="Leave Study"]')), WAIT_FOR_PROPERTY);
await this.driver.wait(until.elementIsVisible(await this.driver.findElement(By.xpath('//button[text()="Leave Study"]'))), WAIT_FOR_PROPERTY);

// Start to leave study, but cancel.
await findAndAct(this.driver, By.xpath('//button[text()="Leave Study"]'), e => e.click());
await findAndAct(this.driver, By.xpath('//button[text()="Cancel"]'), e => e.click());
await this.driver.wait(until.elementLocated(By.xpath('//button[text()="Leave Study"]')), WAIT_FOR_PROPERTY);
await this.driver.wait(until.elementIsVisible(await this.driver.findElement(By.xpath('//button[text()="Leave Study"]'))), WAIT_FOR_PROPERTY);

// Start to leave study, and confirm.
await findAndAct(this.driver, By.xpath('//button[text()="Leave Study"]'), e => e.click());
await findAndAct(this.driver, By.xpath('(//button[text()="Leave Study"])[2]'), e => e.click());
await this.driver.wait(until.elementLocated(By.xpath('//button[text()="Join Study"]')), WAIT_FOR_PROPERTY);
await this.driver.wait(until.elementIsVisible(await this.driver.findElement(By.xpath('//button[text()="Join Study"]'))), WAIT_FOR_PROPERTY);


// TODO make sure in-page link works
await this.driver.get("http://localhost:5000/profile");
Expand Down

0 comments on commit 38bce40

Please sign in to comment.