fix(webdriverio): Misfound elements when using WebDriver BiDi#13798
Conversation
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/browser-runner
@wdio/appium-service
@wdio/browserstack-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/local-runner
@wdio/lighthouse-service
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/reporter
@wdio/repl
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/types
@wdio/testingbot-service
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
|
@christian-bromann This was tested locally and I could check in real world E2E tests that the scenario presented in the original issue was gone. Scenario DOM state: <div id="bar">
<div id="foo">
<div id="bar">
Element 1 (#foo) and element 2 (#bar) exist in the root of the DOM. const rootFoo = await $('#foo');
const rootBar = await $('#bar');
// Problem is when you do this
// If "rootFoo" becames stale, and WebDriver BiDi is on, it actually returns "rootBar"
const fakeNestedBar = await rootFoo.$('#bar');
// No problem finding the nested #bar here
const realNestedBar = await $('#foo #bar'); |
christian-bromann
left a comment
There was a problem hiding this comment.
This makes sense to me 👍 thanks a lot for this contribution!
|
@nextlevelbeard it seems like this change is impacting one of the e2e test, mind taking a look at adjusting the test if you think it corrected the expected behavior? |
@christian-bromann Seems to be unrelated to the changes, CI gives a timeout, it passes locally it('can reload a session with new capabilities', async () => {
expect(browser.capabilities.browserName).toBe('chrome')
await browser.reloadSession({
browserName: 'edge',
'ms:edgeOptions': {
args: ['headless', 'disable-gpu']
}
})
expect(browser.capabilities.browserName).toContain('MicrosoftEdge')
})But apparently another user just reported a problem that seems related to this: #13789 |
|
Hey nextlevelbeard 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Proposed changes
Fixes #13556
Types of changes
Checklist
Backport Request
//: # (The current
mainbranch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against thev8branch.)v9and doesn't need to be back-ported#XXXXXFurther comments
Reviewers: @webdriverio/project-committers