Skip to content

Commit

Permalink
provide manual userDataDir: checking why launch timed out
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Jan 24, 2025
1 parent ec49b2d commit 294ea2f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/e2e/fixtures/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Buffer } from 'node:buffer';
import net from 'node:net';
import path from 'node:path';
import { readFileSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
import { readFile, mkdtemp } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import {
chromium,
firefox,
Expand Down Expand Up @@ -149,7 +150,13 @@ export async function loadContext(
const pathToExtension = getPathToExtension(browserName);
let context: BrowserContext | undefined;
if (browserName === 'chromium') {
context = await chromium.launchPersistentContext('', {
const tmpUserDataDir = await mkdtemp(
path.join(
tmpdir(),
`playwright-user-data-dir-${workerInfo.workerIndex}-`,
),
);
context = await chromium.launchPersistentContext(tmpUserDataDir, {
channel,
args: [
'--headless=new',
Expand Down

0 comments on commit 294ea2f

Please sign in to comment.