mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: remove unused PW_TEST_OUT_OF_PROCESS_DRIVER (#19434)
This commit is contained in:
parent
b97900b925
commit
ab9602bebf
@ -18,7 +18,6 @@ import * as fs from 'fs';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import type { APIRequestContext, BrowserContext, BrowserContextOptions, LaunchOptions, Page, Tracing, Video } from 'playwright-core';
|
import type { APIRequestContext, BrowserContext, BrowserContextOptions, LaunchOptions, Page, Tracing, Video } from 'playwright-core';
|
||||||
import * as playwrightLibrary 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 { createGuid, debugMode } from 'playwright-core/lib/utils';
|
||||||
import { removeFolders } from 'playwright-core/lib/utils/fileUtils';
|
import { removeFolders } from 'playwright-core/lib/utils/fileUtils';
|
||||||
import type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestInfo, TestType, TraceMode, VideoMode } from '../types/test';
|
import type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestInfo, TestType, TraceMode, VideoMode } from '../types/test';
|
||||||
@ -58,18 +57,8 @@ type WorkerFixtures = PlaywrightWorkerArgs & PlaywrightWorkerOptions & {
|
|||||||
const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
|
const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({
|
||||||
defaultBrowserType: ['chromium', { scope: 'worker', option: true }],
|
defaultBrowserType: ['chromium', { scope: 'worker', option: true }],
|
||||||
browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: 'worker', option: true }],
|
browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: 'worker', option: true }],
|
||||||
playwright: [async ({ }, use) => {
|
playwright: [async ({}, use) => {
|
||||||
if (process.env.PW_OUT_OF_PROCESS_DRIVER) {
|
await use(require('playwright-core'));
|
||||||
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' }],
|
}, { scope: 'worker' }],
|
||||||
headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: 'worker', option: true }],
|
headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: 'worker', option: true }],
|
||||||
channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: 'worker', option: true }],
|
channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: 'worker', option: true }],
|
||||||
|
|||||||
@ -35,9 +35,7 @@ const getExecutablePath = (browserName: BrowserName) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mode: TestModeName = 'default';
|
let mode: TestModeName = 'default';
|
||||||
if (process.env.PW_OUT_OF_PROCESS_DRIVER)
|
if (process.env.PLAYWRIGHT_DOCKER)
|
||||||
mode = 'driver';
|
|
||||||
else if (process.env.PLAYWRIGHT_DOCKER)
|
|
||||||
mode = 'docker';
|
mode = 'docker';
|
||||||
else
|
else
|
||||||
mode = (process.env.PWTEST_MODE ?? 'default') as ('default' | 'driver' | 'service' | 'service2');
|
mode = (process.env.PWTEST_MODE ?? 'default') as ('default' | 'driver' | 'service' | 'service2');
|
||||||
|
|||||||
@ -211,7 +211,6 @@ async function runPlaywrightCommand(childProcess: CommonFixtures['childProcess']
|
|||||||
PW_TEST_REPORTER_WS_ENDPOINT: undefined,
|
PW_TEST_REPORTER_WS_ENDPOINT: undefined,
|
||||||
PW_TEST_SOURCE_TRANSFORM: undefined,
|
PW_TEST_SOURCE_TRANSFORM: undefined,
|
||||||
PW_TEST_SOURCE_TRANSFORM_SCOPE: undefined,
|
PW_TEST_SOURCE_TRANSFORM_SCOPE: undefined,
|
||||||
PW_OUT_OF_PROCESS_DRIVER: undefined,
|
|
||||||
NODE_OPTIONS: undefined,
|
NODE_OPTIONS: undefined,
|
||||||
...env,
|
...env,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user