diff --git a/packages/playwright/src/executors/playwright/playwright.ts b/packages/playwright/src/executors/playwright/playwright.ts index b7ea1d5e20e97..8d74e8fa84d21 100644 --- a/packages/playwright/src/executors/playwright/playwright.ts +++ b/packages/playwright/src/executors/playwright/playwright.ts @@ -64,7 +64,7 @@ export async function playwrightExecutor( ); } const args = createArgs(options); - const p = runPlaywright(args, join(context.root, projectRoot)); + const p = runPlaywright(args, context.root); return new Promise<{ success: boolean }>((resolve) => { p.on('close', (code) => { diff --git a/packages/playwright/src/generators/configuration/configuration.ts b/packages/playwright/src/generators/configuration/configuration.ts index 6f5bd50ee55de..1dd0a11ed4b43 100644 --- a/packages/playwright/src/generators/configuration/configuration.ts +++ b/packages/playwright/src/generators/configuration/configuration.ts @@ -73,7 +73,11 @@ Rename or remove the existing e2e target.`); projectConfig.targets.e2e = { executor: '@nx/playwright:playwright', outputs: [`dist/.playwright/${projectConfig.root}`], - options: {}, + options: { + config: `${projectConfig.root}/playwright.config.${ + options.js ? 'js' : 'ts' + }`, + }, }; updateProjectConfiguration(tree, options.project, projectConfig); }