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

[Bug]: expect.poll shows as failed in report besides passing in last iteration. #34478

Open
patrick-paulsencp opened this issue Jan 25, 2025 · 1 comment

Comments

@patrick-paulsencp
Copy link

patrick-paulsencp commented Jan 25, 2025

Version

1.49.1

Steps to reproduce

seems like it is a similar issue like #23302
This Time on .poll rather toPass.
To reproduce create any test case using expect.poll which fails on first but passes afterwards. the test will show as not passed.

Expected behavior

I expect the test to pass when the expect coming form the poll passes.

Actual behavior

the expect.poll passes but renders failed

Image

Image

Additional context

I verify a bunch of stuff inside the polling function and checking the polling against the test.info().errors Array. Hence doing soft assertions inside. They all go Green but the Test remains Red.

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i7-13620H
    Memory: 15.55 GB / 31.68 GB
  Binaries:
    Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.96.4 - C:\Users\ppa\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.49.1 => 1.49.1
@agg23
Copy link
Contributor

agg23 commented Jan 27, 2025

Please provide a complete reproduction. Your screenshots show all passes.

Testing:

test('poll', async ({ page }) => {
  let callCount = 0;

  await expect.poll(() => {
    return callCount++ > 5;
  }).toBe(true);
});

results in the expected report output:

Image

Note that it marks the test as passing.

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

No branches or pull requests

2 participants