Skip to content

Commit

Permalink
wip(webdriver-only): skip stale element safeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
vobu committed Apr 28, 2024
1 parent 11f90fe commit e5389fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/ui5-ts-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"authentication:custom": "wdio run test/e2e/authentication/wdio-custom-authentication.conf.ts",
"authentication:multiRemote": "wdio run test/e2e/authentication/wdio-btp-authentication-multiremote.conf.ts",
"test:protocol": "run-p \"protocol:* -- --headless\"",
"protocol:devtools": "wdio run test/e2e/protocol/wdio-ui5-devtools.conf.ts",
"protocol:webdriver": "wdio run test/e2e/protocol/wdio-ui5-webdriver.conf.ts",
"protocol:devtools": "PROT=devtools wdio run test/e2e/protocol/wdio-ui5-devtools.conf.ts",
"protocol:webdriver": "PROT=webdriver wdio run test/e2e/protocol/wdio-ui5-webdriver.conf.ts",
"build:ui5": "ui5 build --clean-dest",
"build:mtar": "mv dist approuter/webapp && mbt build",
"clean": "rimraf dist approuter/webapp",
Expand Down
11 changes: 9 additions & 2 deletions examples/ui5-ts-app/test/e2e/protocol/stale-element.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { wdi5Selector, ELEMENT_KEY } from "wdio-ui5-service"

// work around the REVISIT issue explained below
const _it = process.env.PROT === "devtools" ? it : it.skip

describe("Devtools: ", async () => {
const staleElementId = {
// devtools does not care about the format of the value but webdriver does
Expand All @@ -10,7 +13,10 @@ describe("Devtools: ", async () => {
// clear cached wdi5Controls, so we can mock in each test seperately
browser._controls = []
})
it("safeguard 'stale' element handling", async () => {
//> REVISIT: wdio v8 latest now recognizes stale elements ahead of browser.executeAsync calls
//> but only with the webdriver protocol, not with the devtools protocol
//> -> we skip this test for the webdriver protocol as of now
_it("safeguard 'stale' element handling", async () => {
const buttonWDI5 = await getButtonOnPage1()

// mock a stale element
Expand Down Expand Up @@ -52,7 +58,8 @@ describe("Devtools: ", async () => {
expect(await invisibleInput.isInitialized()).toBe(false)
})

it("safeguard 'stale' element handling with full selector", async () => {
//> REVISIT: see first test in the suite for reasons - same thing here
_it("safeguard 'stale' element handling with full selector", async () => {
const multiInput = await getMultiInputOnPage1()

// mock a stale element
Expand Down

0 comments on commit e5389fa

Please sign in to comment.