-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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]: tests are not skipped when condition depends on fixtures #31425
Labels
Comments
Reduced test case: import { test } from '@playwright/test';
test.describe(() => {
test.skip(({ viewport }) => true);
test.beforeEach(() => console.log('before each outer'));
test.describe(() => {
test.beforeEach(() => console.log('before each inner'));
test('test', () => console.log('test'));
});
}); |
I see the PR is merged, thanks for the quick turn around! qq: what is the ETA for a patch release? |
This was referenced Jul 23, 2024
This was referenced Jul 28, 2024
This was referenced Sep 24, 2024
Open
Open
This was referenced Sep 26, 2024
This was referenced Sep 27, 2024
Open
Open
Open
Open
Open
Open
This was referenced Oct 4, 2024
This bug is fixed for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
1.42.0 and above
Steps to reproduce
Create a test file with:
test.describe
test.describe
with abeforeEach
hook and atest
On the top describe block, add a dynamic skip condition based on a fixture like
viewport
.Run the test where the skip condition returns
true
, so all tests should be skipped and thebeforeEach
hook also.Expected behavior
As of until
1.41.1
, it was expected that thebeforeEach
hook was not invoked if a parent describe contains a dyanmic skip that resolves totrue
, this is not the case on1.42.0
and above.Actual behavior
beforeEach
hook is invoked.This causes tests that should have been skipped to run the
beforeEach
hook that can lead tests to fail.Additional context
From trying to debug it, seems like it is related with
test.skip
using fixtures or not (see example code).Environment
The text was updated successfully, but these errors were encountered: