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
Run npm install && npx playwright install which will install @playwright/[email protected]
Run npx playwright test
Notice the test failures because beforeEach was ran (and threw an error, to demonstrate the problem)
Try again with @playwright/[email protected] and see they are all skipped with no errors
Expected behavior
All tests should be skipped and test.beforeEach should not be run when test.skip() references a custom fixture.
Actual behavior
The describe block that uses test.skip({ foo }) still runs the test.beforeEach
Running 6 tests using 5 workers
- 1 [chromium] › example.spec.ts:35:3 › not using fixture param › should be skipped
✘ 2 [firefox] › example.spec.ts:21:3 › using fixture param › should be skipped (3ms)
- 3 [firefox] › example.spec.ts:35:3 › not using fixture param › should be skipped
✘ 4 [chromium] › example.spec.ts:21:3 › using fixture param › should be skipped (3ms)
✘ 5 [webkit] › example.spec.ts:21:3 › using fixture param › should be skipped (3ms)
- 6 [webkit] › example.spec.ts:35:3 › not using fixture param › should be skipped
1) [chromium] › example.spec.ts:21:3 › using fixture param › should be skipped ───────────────────
Error: beforeEach should not have run
16 |
17 | test.beforeEach(async ({}) => {
> 18 | throw new Error('beforeEach should not have run');
| ^
19 | });
20 |
21 | test('should be skipped', () => {
at /Users/mattjennings/tmp/fixture-skip/tests/example.spec.ts:18:13
2) [firefox] › example.spec.ts:21:3 › using fixture param › should be skipped ────────────────────
Error: beforeEach should not have run
16 |
17 | test.beforeEach(async ({}) => {
> 18 | throw new Error('beforeEach should not have run');
| ^
19 | });
20 |
21 | test('should be skipped', () => {
at /Users/mattjennings/tmp/fixture-skip/tests/example.spec.ts:18:13
3) [webkit] › example.spec.ts:21:3 › using fixture param › should be skipped ─────────────────────
Error: beforeEach should not have run
16 |
17 | test.beforeEach(async ({}) => {
> 18 | throw new Error('beforeEach should not have run');
| ^
19 | });
20 |
21 | test('should be skipped', () => {
at /Users/mattjennings/tmp/fixture-skip/tests/example.spec.ts:18:13
3 failed
[chromium] › example.spec.ts:21:3 › using fixture param › should be skipped ────────────────────
[firefox] › example.spec.ts:21:3 › using fixture param › should be skipped ─────────────────────
[webkit] › example.spec.ts:21:3 › using fixture param › should be skipped ──────────────────────
3 skipped
Additional context
This is a breaking change in behaviour for me, as I make use of an expensive fixture param in beforeEach({ expensiveFoo }) that I do not want to execute if the test has been skipped.
Previously, beforeAll() ran before test.skip() and beforeEach() ran after, and I haven't seen anything in the release notes to indicate this was an intentional change.
Last Good Version
1.42.1
First Bad Version
1.43.0
Steps to reproduce
npm install && npx playwright install
which will install@playwright/[email protected]
npx playwright test
beforeEach
was ran (and threw an error, to demonstrate the problem)@playwright/[email protected]
and see they are all skipped with no errorsExpected behavior
All tests should be skipped and
test.beforeEach
should not be run whentest.skip()
references a custom fixture.Actual behavior
The describe block that uses
test.skip({ foo })
still runs thetest.beforeEach
Additional context
This is a breaking change in behaviour for me, as I make use of an expensive fixture param in
beforeEach({ expensiveFoo })
that I do not want to execute if the test has been skipped.Previously,
beforeAll()
ran beforetest.skip()
andbeforeEach()
ran after, and I haven't seen anything in the release notes to indicate this was an intentional change.Environment
The text was updated successfully, but these errors were encountered: