Comments (9)
I had to modify the script because
- original page is broken and never stops loading
- i am in the US and have no cookie dialog
test("1.45 debug", async ({ page }) => {
await page.goto("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_target", { waitUntil: "domcontentloaded" });
// await page.getByText("Accept all & visit the site").click();
const page1Promise = page.context().waitForEvent("page");
await page.frameLocator('iframe[name="iframeResult"]').getByRole("link", { name: "Visit W3Schools.com!" }).click();
const page1 = await page1Promise;
// URL is printed
console.log(page1.url());
// Expect stuck
await expect(page1).toHaveURL(/w3schools/, { timeout: 2_000 });
// locator() doesn't work
await expect(page1.getByText("Learn to Code")).toBeVisible({ timeout: 2_000 });
});
And it works for me on all browsers:
Running 3 tests using 3 workers
[chromium] › example.spec.ts:20:6 › 1.45 debug
https://www.w3schools.com/
[firefox] › example.spec.ts:20:6 › 1.45 debug
https://www.w3schools.com/
[webkit] › example.spec.ts:20:6 › 1.45 debug
https://www.w3schools.com/
3 passed (8.3s)
from playwright.
On my windows pc this all worked, as it did for @pavelfeldman . On macos and in the docker container I was able to replicate @unickq 's issue.
from playwright.
I'm on macOS 14.5 for reference.
from playwright.
I am facing a similar problem where in case of popups I am not getting title of the popup
const popupPromise = page.waitForEvent('popup');
await page.setContent(`<a href="https://www.google.com" target="_blank">Go to Google</a>`);
const locator = await page.locator('a');
await locator.click();
const popup = await popupPromise;
await popup.waitForLoadState();
// Works Fine
expect(await popup.evaluate(() => document.title)).toMatch('Google');
// Indefinitely Stuck
expect(await popup.title()).toMatch('Google');
The problem is that I am not able to reproduce it in a standalone project but I am able to consistently face this problem in my company repo where we extend the test. I will comment again if I am able to reproduce it in a standalone project.
For now I am sending it here to see if we can get any inputs.
Edit1:
Removing --disable-web-security
from launch args seem to solve the problem but trying to figure out why
Edit2:
I do not know why removing --disable-web-security
fixes my problem but I am going ahead with that as we were not passing --disable-site-isolation-trials
or --user-data-dir
so that flag was a no-op for chromium anyways
from playwright.
That's interesting; I can't reproduce it anymore. Because of 127.0.6533.5 -> 127.0.6533.17?
But it's there with --disable-web-security
, added to the first comment
from playwright.
I can repro, disabling web security skips some of the JS context-related signals so Playwright misbehaves. Why are you disabling the web security?
from playwright.
For me, it came when we migrated from puppeteer to playwright and we did disable web security in chromium to disable csp and cors.
from playwright.
For me, it came when we migrated from puppeteer to playwright and we did disable web security in chromium to disable csp and cors.
Are you a testing solution or a scraping solution? If you are a testing solution, you are not really testing what your users will get.
from playwright.
For me, it came when we migrated from puppeteer to playwright and we did disable web security in chromium to disable csp and cors.
Are you a testing solution or a scraping solution? If you are a testing solution, you are not really testing what your users will get.
Testing solution. Yeah --disable-web-security
there would be security gaps that would be missed but then having something rather than nothing was preferred.
Now since the situation is better now. Thanks to playwright 🙌 , we have removed --disable-web-security
so it should be better
from playwright.
Related Issues (20)
- [Bug]: target is closed error when running multiple spec files HOT 2
- [Feature]: Converting JSHandle/ElementHandle to/from CDP backendNodeId/nodeId HOT 1
- [Feature]: UI Mode - Auto run tests HOT 3
- [Bug]: Playwright Unable to Navigate/Switch to PDF Window in Headless Mode HOT 1
- [Bug]: Failed to install browser dependencies with playwright java on CICD gitlab HOT 2
- Execution Time Per Line of Code Not Displayed Anymore in IntelliJ/Aqua IDE? HOT 2
- [Bug]: Playwright Test for VSCode not always running global setup HOT 3
- [Feature]: Playwright Beta/Canary Test for VS Code HOT 1
- [Bug]: Can't select multiple select option with webkit HOT 3
- Some of the script are running fine on local but getting failed on github action pipeline. It is giving timeout exceed error in logs
- The addLocatorHandler method can be triggered in the test environment, but it does not trigger when using the library. why this is happening? HOT 1
- [Feature]: --only-changed - run the global set up/teardown files in addition to changed tests HOT 1
- Hello, if the URL jump occurs by clicking on the event on the page, which method is better recommended? I see two methods in the official documentation, waitForURL and waitForNavigation. According to our usage habits, we prefer to use waitForNavigation, but the document mark says that it has been abandoned, and it also says that this method is inherently dangerous. Could you explain the reason? Because we do not pay attention to the url of the click event, if we use waitForURL, it will increase our workload. Thank you!
- [Bug]: waitForURL and waitForNavigation
- How to automate Save/save as Modal using playwright HOT 1
- [Bug]: Incorrect user agent HOT 1
- [Bug]: Symlinked directories inside testDir are ignored in MacOS
- [Bug]: window.resizeTo/resizeBy and window.moveTo/moveBy do not work in Chromium
- [Bug]: Unable to capture full page snapshot of some sites with Chromium and Firefox HOT 1
- [Bug]: Credential scanning tool flags shipped private key HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.