Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: pass isUnderTest to wsl (#38087)

Yury Semikhatskyf3cb73df16fc
diff --git a/tests/library/browsertype-connect.spec.ts b/tests/library/browsertype-connect.spec.ts
index 31ac7171a4..f92d46546a 100644
--- a/tests/library/browsertype-connect.spec.ts
+++ b/tests/library/browsertype-connect.spec.ts
@@ -73,6 +73,7 @@ const test = playwrightTest.extend<ExtraFixtures>({
test.slow(true, 'All connect tests are slow');
test.skip(({ mode }) => mode.startsWith('service'));
+test.skip(({ mode }) => mode === 'wsl');
for (const kind of ['launchServer', 'run-server'] as const) {
test.describe(kind, () => {
diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts
index b8d7bc04b2..cb946173db 100644
--- a/tests/library/playwright.config.ts
+++ b/tests/library/playwright.config.ts
@@ -81,7 +81,7 @@ if (mode === 'service2') {
if (channel === 'webkit-wsl') {
connectOptions = { wsEndpoint: 'ws://localhost:3777/' };
webServer = {
- command: 'wsl.exe -d playwright -u pwuser -- bash -lc \'/home/pwuser/node/bin/npx playwright run-server --port=3777\'',
+ command: 'set PWTEST_UNDER_TEST=1 && set WSLENV=PWTEST_UNDER_TEST && wsl.exe -d playwright -u pwuser -- bash -lc \'/home/pwuser/node/bin/npx playwright run-server --port=3777\'',
url: 'http://localhost:3777',
};
}
diff --git a/tests/library/signals.spec.ts b/tests/library/signals.spec.ts
index 50bbd05f8c..f2a94b746f 100644
--- a/tests/library/signals.spec.ts
+++ b/tests/library/signals.spec.ts
@@ -22,7 +22,8 @@ import os from 'os';
test.slow();
-test('should close the browser when the node process closes', async ({ startRemoteServer, isWindows, server }) => {
+test('should close the browser when the node process closes', async ({ startRemoteServer, isWindows, server, mode }) => {
+ test.skip(mode === 'wsl', 'Remove server cannot start on Windows with WebKit WSL params');
const remoteServer = await startRemoteServer('launchServer', { url: server.EMPTY_PAGE });
try {
if (isWindows)