Skip to content

Commit

Permalink
more resilient not present check
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtarsi committed Sep 18, 2023
1 parent d02d136 commit d2d06d7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/selenium-ide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/selenium-ide",
"version": "4.0.0-alpha.48",
"version": "4.0.0-alpha.49",
"private": true,
"description": "Selenium IDE electron app",
"author": "Todd <[email protected]>",
Expand Down Expand Up @@ -106,9 +106,9 @@
"@seleniumhq/code-export-ruby-rspec": "^4.0.0-alpha.1",
"side-code-export": "^4.0.0-alpha.11",
"@seleniumhq/get-driver": "^4.0.0-alpha.1",
"@seleniumhq/side-api": "^4.0.0-alpha.30",
"@seleniumhq/side-api": "^4.0.0-alpha.31",
"@seleniumhq/side-model": "^4.0.0-alpha.4",
"@seleniumhq/side-runtime": "^4.0.0-alpha.29",
"@seleniumhq/side-runtime": "^4.0.0-alpha.30",
"dnd-core": "^16.0.1",
"electron-chromedriver": "^25.3.0",
"electron-log": "^4.4.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/side-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-api",
"version": "4.0.0-alpha.30",
"version": "4.0.0-alpha.31",
"private": false,
"description": "Selenium IDE API command shapes and such",
"author": "Todd Tarsi <[email protected]>",
Expand All @@ -20,7 +20,7 @@
"@seleniumhq/browser-info": "^4.0.0-alpha.1",
"@seleniumhq/get-driver": "^4.0.0-alpha.2",
"@seleniumhq/side-model": "^4.0.0-alpha.4",
"@seleniumhq/side-runtime": "^4.0.0-alpha.29",
"@seleniumhq/side-runtime": "^4.0.0-alpha.30",
"lodash": "^4.17.21"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/side-code-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "side-code-export",
"version": "4.0.0-alpha.11",
"version": "4.0.0-alpha.12",
"description": "Utils for code export from Selenium IDE",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
"keywords": [
Expand All @@ -21,7 +21,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@seleniumhq/side-model": "^4.0.0-alpha.4",
"@seleniumhq/side-runtime": "^4.0.0-alpha.26",
"@seleniumhq/side-runtime": "^4.0.0-alpha.30",
"commander": "^9.4.0"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
Expand Down
4 changes: 2 additions & 2 deletions packages/side-runner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selenium-side-runner",
"version": "4.0.0-alpha.58",
"version": "4.0.0-alpha.59",
"private": false,
"description": "Run Selenium IDE projects in cli",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -24,7 +24,7 @@
"license": "Apache-2.0",
"dependencies": {
"@seleniumhq/side-model": "^4.0.0-alpha.4",
"@seleniumhq/side-runtime": "^4.0.0-alpha.29",
"@seleniumhq/side-runtime": "^4.0.0-alpha.30",
"commander": "^11.0.0",
"glob": "^10.3.1",
"jest": "^29.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/side-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-runtime",
"version": "4.0.0-alpha.29",
"version": "4.0.0-alpha.30",
"private": false,
"description": "Selenium IDE playback and execution",
"author": "Tomer <[email protected]>",
Expand Down
12 changes: 11 additions & 1 deletion packages/side-runtime/src/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,17 @@ export default class WebDriverExecutor {
const parsedLocator = parseLocator(locator)
const elements = await this.driver.findElements(parsedLocator)
if (elements.length !== 0) {
await this.driver.wait(until.stalenessOf(elements[0]), parseInt(timeout))
const noElementPresentCondition = new Condition(
'for element to not be present',
async () => {
const elements = await this.driver.findElements(parsedLocator)
return elements.length === 0
}
)
await this.driver.wait<boolean>(
noElementPresentCondition,
Number(timeout)
)
}
}

Expand Down
33 changes: 28 additions & 5 deletions pnpm-lock.yaml

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

0 comments on commit d2d06d7

Please sign in to comment.