chore: remove unused PW_TEST_OUT_OF_PROCESS_DRIVER (#19434)

This commit is contained in:
Dmitry Gozman 2022-12-13 16:04:44 -08:00 committed by GitHub
parent b97900b925
commit ab9602bebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 17 deletions

View File

@ -18,7 +18,6 @@ import * as fs from 'fs';
import * as path from 'path';
import type { APIRequestContext, BrowserContext, BrowserContextOptions, LaunchOptions, Page, Tracing, Video } from 'playwright-core';
import * as playwrightLibrary from 'playwright-core';
import * as outOfProcess from 'playwright-core/lib/outofprocess';
import { createGuid, debugMode } from 'playwright-core/lib/utils';
import { removeFolders } from 'playwright-core/lib/utils/fileUtils';
import type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestInfo, TestType, TraceMode, VideoMode } from '../types/test';
@ -59,17 +58,7 @@ const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
defaultBrowserType: ['chromium', { scope: 'worker', option: true }],
browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: 'worker', option: true }],
playwright: [async ({}, use) => {
if (process.env.PW_OUT_OF_PROCESS_DRIVER) {
const impl = await outOfProcess.start({
NODE_OPTIONS: undefined // Hide driver process while debugging.
});
const pw = impl.playwright as any;
pw._setSelectors(playwrightLibrary.selectors);
await use(pw);
await impl.stop();
} else {
await use(require('playwright-core'));
}
}, { scope: 'worker' }],
headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: 'worker', option: true }],
channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: 'worker', option: true }],

View File

@ -35,9 +35,7 @@ const getExecutablePath = (browserName: BrowserName) => {
};
let mode: TestModeName = 'default';
if (process.env.PW_OUT_OF_PROCESS_DRIVER)
mode = 'driver';
else if (process.env.PLAYWRIGHT_DOCKER)
if (process.env.PLAYWRIGHT_DOCKER)
mode = 'docker';
else
mode = (process.env.PWTEST_MODE ?? 'default') as ('default' | 'driver' | 'service' | 'service2');

View File

@ -211,7 +211,6 @@ async function runPlaywrightCommand(childProcess: CommonFixtures['childProcess']
PW_TEST_REPORTER_WS_ENDPOINT: undefined,
PW_TEST_SOURCE_TRANSFORM: undefined,
PW_TEST_SOURCE_TRANSFORM_SCOPE: undefined,
PW_OUT_OF_PROCESS_DRIVER: undefined,
NODE_OPTIONS: undefined,
...env,
},