-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.14.0
Node.js Version
v22.13.1
Mode
WDIO Testrunner
Which capabilities are you using?
{
browserName: 'chrome',
},
{
browserName: 'firefox',
},What happened?
I have an Iframe that is inserted to the dom at some point.
I use browser.switchFrame to switch to that iframe.
Since #14082 switchFrame waits for the iframe element to appear. But it does not work with urls or functions.
Here is a test-case:
import { expect, browser, $ } from '@wdio/globals'
beforeEach(async () => {
await browser.url(`https://htho.github.io/wdio-repro-collection/delayedIframe.html`)
});
describe('switchFrame', () => {
it(`can take a selector of a delayed iframe (works in 9.14.0)`, async () => {
await browser.switchFrame($(`#delayedIframe`));
await expect($(`h1`)).toHaveText("Delayed Inner Iframe");
});
it(`can take an url of a delayed iframe (fails in 9.14.0)`, async () => {
await browser.switchFrame(`https://htho.github.io/wdio-repro-collection/delayedIframeInner.html`);
await expect($(`h1`)).toHaveText("Delayed Inner Iframe");
});
it(`can take a function to identify a delayed iframe (fails in 9.14.0)`, async () => {
await browser.switchFrame(() => document.URL.includes('delayedIframeInner'));
await expect($(`h1`)).toHaveText("Delayed Inner Iframe");
});
});What is your expected behavior?
All three tests should pass.
How to reproduce the bug.
I created a repository that I reuse to report bugs: https://github.com/htho/wdio-repro-collection
- git clone https://github.com/htho/wdio-repro-collection.git
- cd wdio-repro-collection
- npm ci
- npm run test:delayedIframe
Relevant log output
nothing specialCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested