Skip to content

Commit

Permalink
include connect options
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Sep 1, 2022
1 parent e5ce4c6 commit 0a3e7ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/playwright-core/src/cli/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ export async function startVRTService() {

/* eslint-disable no-console */
console.log(`✨ Launched Playwright ${getPlaywrightVersion()} Docker Container ✨`);
console.log(`- VNC session: http://localhost:7900?path=${utils.createGuid()}&resize=scale`);
console.log(``);
console.log(`- VNC session: http://127.0.0.1:7900?path=${utils.createGuid()}&resize=scale`);
console.log(`- WS endpoint: ${endpoint}`);
console.log(``);
console.log(`You can now run tests with browsers from this container:`);
Expand Down
3 changes: 3 additions & 0 deletions packages/playwright-test/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ async function runTests(args: string[], opts: { [key: string]: any }) {
if (!wsEndpoint)
throw new Error(`Playwright docker container is not running; run "npx playwright start-docker" first`);
process.env.PW_TEST_CONNECT_WS_ENDPOINT = await docker.wsEndpoint();
process.env.PW_TEST_CONNECT_HEADERS = JSON.stringify({
'x-playwright-proxy': '*',
});
process.env.PW_TEST_IS_DOCKER = '1';
}

Expand Down
5 changes: 4 additions & 1 deletion packages/playwright-test/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export const test = _baseTest.extend<TestFixtures, WorkerFixtures>({
headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: 'worker', option: true }],
channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: 'worker', option: true }],
launchOptions: [{}, { scope: 'worker', option: true }],
connectOptions: [process.env.PW_TEST_CONNECT_WS_ENDPOINT ? { wsEndpoint: process.env.PW_TEST_CONNECT_WS_ENDPOINT } : undefined, { scope: 'worker', option: true }],
connectOptions: [process.env.PW_TEST_CONNECT_WS_ENDPOINT ? {
wsEndpoint: process.env.PW_TEST_CONNECT_WS_ENDPOINT,
headers: process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : undefined,
} : undefined, { scope: 'worker', option: true }],
screenshot: ['off', { scope: 'worker', option: true }],
video: ['off', { scope: 'worker', option: true }],
trace: ['off', { scope: 'worker', option: true }],
Expand Down

0 comments on commit 0a3e7ca

Please sign in to comment.