Skip to content
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

fix(aria): toMatchAriaSnapshot with timeout: 0 should be able to generate baseline #35476

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Apr 3, 2025

Resolves #35461. The user has a nifty workflow where they use timeout: 0 to stall the test while they're iterating on the website. This breaks if there's no baseline, because we compare to - none "Generating new baseline" infinitely. Adding a special case so that we take the first shot fixes it.

This mirrors our behaviour for toMatchSnapshot({ timeout: 0 }) on missing baselines, where we take the first stable snapshot.

@Skn0tt Skn0tt requested a review from dgozman April 3, 2025 13:14
@Skn0tt Skn0tt self-assigned this Apr 3, 2025
@@ -100,6 +100,8 @@ export async function toMatchAriaSnapshot(
} else {
// When generating new baseline, run entire pipeline against impossible match.
expected = `- none "Generating new baseline"`;
if (timeout === 0)
timeout = 1; // one shot timeout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Playwright timeout === 0 disables the timeout.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's exactly why we need a workaround for it.

@Skn0tt
Copy link
Member Author

Skn0tt commented Apr 10, 2025

Had some discussions with Dima. Adding this would be a big inconsistency with all our other expectations. The user can achieve the same behaviour themselves by setting timeout: 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: toMatchAriaSnapshot gets stuck when it needs to create a new file with timeout 0
2 participants