Skip to content

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

@raythurnvoid

Description

@raythurnvoid

Version

1.51.1

Steps to reproduce

  1. Clone https://github.com/raythurnvoid/playwright-aria-snapshot-bug
  2. npm i
  3. npx playwright test --ui
  4. Run the only test

Expected behavior

Playwright should create the new snapshot even if the timeout is 0 or very high and it should not get stuck.

Actual behavior

In this test playwright will get stuck at await expect.soft(page.getByRole('navigation')).toMatchAriaSnapshot

import { test, expect } from '@playwright/test';

test('Aria Snapshot Bug', async ({ page }) => {
  await page.goto('https://playwright.dev/');

  await expect.soft(page.getByRole('navigation')).toMatchAriaSnapshot({
    name: 'navigation.aria.yml',
    timeout: 0
  });
});

Stopping the test will allow playwright to finally create the aria snapshot file, setting a small timeout (eg: 100) also works to let playwright continue without getting stuck and create the file.

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (32) x64 Intel(R) Core(TM) i9-14900HX
    Memory: 40.85 GB / 63.74 GB
  Binaries:
    Node: 23.5.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.7.0 - ~\AppData\Local\pnpm\pnpm.CMD
  IDEs:
    VSCode: 0.48.6 - c:\Users\rt0\AppData\Local\Programs\cursor\resources\app\bin\code.CMD
  Languages:
    Bash: 5.1.16 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: ^1.51.1 => 1.51.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions