You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
autTestUser
changed the title
[Bug]: expect.toPass doesn't show the exact line where it is failing
[Bug]: expect.toPass doesn't show the exact error or line number where it is failing
Sep 19, 2024
This is expected, while we know what toPass is retrying in the inner toPass, we don't know in the outer toPass. Since there we just have a toPass inside which stalls.
I recommend to not nest toPass and then the good error reporting will be shown. Would that work for you?
Actually, it doesn't work for me. I have shown you a simple example code earlier so you may recommended not to use nested toPass. But my actual code could be something like below where I wanted method1() code also to be run repeatedly until a certain condition/assertion in method2() is passed.
Version
1.46.0
Steps to reproduce
Run the below code which has expect.toPass inside another expect.toPass
Expected behavior
Below error message should be displayed
Error: expect(received).toBe(expected) // Object.is equality
Expected: 200
Received: 12
Actual behavior
It is not showing the exact error and line number where it is failing instead it is showing below error
Error: Timeout 5000ms exceeded while waiting on the predicate
14 | timeout: 5_000,
15 | });
Additional context
No response
Environment
System: OS: Linux 5.15 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1265U Memory: 2.95 GB / 7.76 GB Container: Yes Binaries: Node: 20.12.1 - /usr/bin/node npm: 10.5.0 - /usr/bin/npm Languages: Bash: 5.0.17 - /usr/bin/bash npmPackages: @playwright/test: 1.46.0 => 1.46.0
The text was updated successfully, but these errors were encountered: