[REGRESSION]: toHaveURL passes in 1.25 but fails in 1.26
See original GitHub issueContext:
- GOOD Playwright Version: 1.25
- BAD Playwright Version: 1.26
- Operating System: Mac
- Extra: [any specific details about your environment]
Code Snippet
import { test, expect } from "@playwright/test";
test("test", async ({ page }) => {
test.slow();
await page.goto("https://nordicjs.com/2022");
await page.locator('nav[role="navigation"] >> text=Speakers').click();
await expect(page).toHaveURL("https://nordicjs.com/2022/speakers");
await expect(page.locator('h3:has-text("Speakers")')).toBeVisible();
await page.locator("text=Sponsors").click();
await expect(page).toHaveURL("https://nordicjs.com/2022/#sponsors--270766"); // throws here
});
Describe the bug
The code above did work in 1.25 but after upgrading to 1.26 it breaks at the toHaveURL assertion. Even when setting the expect timeout quite high, it fails with
Call log:
- expect.toHaveURL with timeout 15000ms
- waiting for selector “:root”
and it gets reflected as 97ms inside the html report (step).
It seems firefox only and load event changes related, cc @dgozman
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
[REGRESSION]: toHaveURL passes in 1.25 but fails in 1.26 ...
The code above did work in 1.25 but after upgrading to 1.26 it breaks at the toHaveURL assertion. Even when setting the expect...
Read more >Understanding Regression Failures through Test-Passing and ...
When a regression test fails, developers examine the changes since the last time the test passed to identify the fail- ure cause.2 Considering...
Read more >Regression Basics
Regression Basics. What are predictors and criteria? According to the regression (linear) model, what are the two parts of variance of the dependent ......
Read more >1 Simple Linear Regression I – Least Squares Estimation
The main reasons that scientists and social researchers use linear regression are the following: 1. Prediction – To predict a future response based...
Read more >playwright - bytemeta
[BUG] Specific site does not load on Webkit (headless) in docker container. bobHealy ... [REGRESSION]: toHaveURL passes in 1.25 but fails in 1.26....
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

I think I’m getting an issue related to this. But I wasn’t able to isolate it yet. It looks like a
clickthat triggers navigation is being resolved earlier than before. I have some legacy code that was doing something like:That code is working on 1.25, it waits for the navigation and then for the networkidle, but on 1.26,
waitForLoadStateresolves immediately because the navigation didn’t occur yet.I can verify that this issue is fixed on
npm i -D @playwright/test@nextor wait for 1.28.Please try to repro on
@nextor wait for 1.28.