[BUG] Experimental React Selectors doesn't work on react apps in Iframe.
See original GitHub issueContext:
- Playwright Version: 1.16.3
- Operating System: [e.g. Windows, Linux or Mac] Windows
- Node.js version: [e.g. 12.22, 14.6] 16.13.0
- Browser: [e.g. All, Chromium, Firefox, WebKit] Chromium
- Extra: [any specific details about your environment]
Code Snippet
test.describe('Clicking react components', () => {
let page, frameElementHandle, frame;
test.beforeAll(async ({browser}) => {
page = await browser.newPage();
await page.goto('http://localhost:8080/', {waitUntil: 'domcontentloaded'});
await page.waitForSelector('iframe#target');
frameElementHandle = await page.$('#target');
frame = await frameElementHandle.contentFrame();
});
test('click on component named DeepHooks', async () => {
await frame.click('_react=DeepHooks');
expect(true).toEqual(true); // Intentional for passing test
});
})
Describe the bug
It can’t find the component with the selector. Timeout Error of 30 seconds showed up
Timeout of 30000ms exceeded.
page.click: Target closed
=========================== logs ===========================
waiting for selector "_react=DeepHooks"
============================================================
Also, the source is not minified.
I am totally using react selectors for the first time so sorry if I did something wrong.
Thank You
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Create-React-App creates this <iframe> that prevents me from ...
I have found two solutions that can solve this, one with a .env file that sometimes works, and the other solution is with...
Read more >React v18.0 – React Blog
In our last post, we shared step-by-step instructions for upgrading your app to React 18. In this post, we'll give an overview of...
Read more >React, Iframes, and a Back-Navigation Bug
In this post, we'll fix a bug where iframes in React interfere with your browser's back-navigation. Skip table of contents. Table of Contents....
Read more >not - CSS-Tricks
The :not() property in CSS is a negation pseudo class and accepts a simple selector or a selector list as an argument.
Read more >Iframes with React: Best Practices | by Andrea Perera
Embedding an Iframe inside a React app comes with some risks where Iframe will load content outside your control unless you take the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@akgupta0777 Your code looks fine. If you could provide a repro scenario for us to run locally, we might be able to help.
Closing for now since we don’t have a repro. Please create a new issue if you still encounter issues.