playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] beforeAll is not skipped when baseURL is referenced in skip callback

Open nzacca opened this issue 2 years ago • 1 comments

Context:

  • Playwright Version: 1.22.1
  • Operating System: Windows
  • Node.js version: 16.13.2
  • Browser: Chrome

Code Snippet

import { test } from "@playwright/test";

// This works as expected
test.describe("Skip", () => {
	test.skip(() => true);

	test.beforeAll(() => {
		console.log("Should not show");
	});

	test("skip test", () => {
		console.log("should not run");
	});
});

// This does not. Note the only difference is the baseURL parameter.
test.describe("Skip with baseURL", () => {
	test.skip(({ baseURL }) => true);

	test.beforeAll(() => {
		console.log("Should not show with baseURL");
	});

	test("skip test with baseURL", () => {
		console.log("should not run with baseURL");
	});
});

Describe the bug

When skip references baseURL, the beforeAll code is not skipped which is unexpected. Is this intended?

nzacca avatar May 27 '22 09:05 nzacca

I have the same issue but when using isMobile instead of baseURL. It also works as expected and skips the beforeAll if I don't reference anything. It looks like it's also the same with beforeEach

I was on v. 1.22.2 but just tried on latest 1.24.2 and have the same issue.

stevgouws avatar Aug 05 '22 13:08 stevgouws

Should be fixed!

pavelfeldman avatar Jun 30 '23 18:06 pavelfeldman

@pavelfeldman

Thank you. Do we know what version this was fixed in? Or the PR/commit that fixes this?

nzacca avatar Jun 30 '23 21:06 nzacca

@nzacca Appears to be fixed for me in 1.36.1. Thanks!

stevgouws avatar Jul 24 '23 14:07 stevgouws