-
Notifications
You must be signed in to change notification settings - Fork 476
Call Visit#fail when reloading due to request failure
#1332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Call Visit#fail when reloading due to request failure
#1332
Conversation
|
Can you fix the linting issues please? |
|
@brunoprietog I have fixed the issues. |
1bc5701 to
a8a2ee2
Compare
| }) | ||
|
|
||
|
|
||
| test.only("hides progress bar when reloading due to request failure", async ({ page }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the .only call?
| test.only("hides progress bar when reloading due to request failure", async ({ page }) => { | |
| test("hides progress bar when reloading due to request failure", async ({ page }) => { |
| await page.waitForEvent('download') | ||
|
|
||
| await waitUntilNoSelector(page, ".turbo-progress-bar") | ||
| assert.notOk(await hasSelector(page, ".turbo-progress-bar"), "hides progress bar") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rebase this branch, you'll be able to re-write this assertion using Playwright's expect assertions:
| await page.waitForEvent('download') | |
| await waitUntilNoSelector(page, ".turbo-progress-bar") | |
| assert.notOk(await hasSelector(page, ".turbo-progress-bar"), "hides progress bar") | |
| await page.waitForEvent("download") | |
| await expect(page.locator(".turbo-progress-bar"), "hides progress bar").not.toBeAttached() |
| return this.reload({ | ||
| this.reload({ | ||
| reason: "request_failed", | ||
| context: { | ||
| statusCode | ||
| } | ||
| }) | ||
| return visit.fail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I execute this branch locally with the changes in this file reverted, the tests still pass.
Can you help me understand how this change is related to the test coverage you've added?
How is a call to visit.fail() related to clicking an <a> element to download a file?
Fixed a problem in which the progress bar progresses after the download is completed when the link does not have the
downloadattribute.2024-10-25.17.31.27.mov