Skip to content

Commit

Permalink
support PW 1.42 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed May 28, 2024
1 parent f0970e1 commit 8704aa7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/config/playwright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import {
export const defineConfig = (config: PlaywrightTestConfig) => {

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / release

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / release

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / release

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / release

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / release

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / release

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.

Check failure on line 17 in src/config/playwright.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Exported variable 'defineConfig' has or is using name 'TestConfigWebServer' from external module "/home/runner/work/test-runner/test-runner/node_modules/playwright/types/test" but cannot be named.
const { STORYBOOK_STORIES_PATTERN } = process.env;

// @ts-ignore use _contextReuseMode
return playwrightDefineConfig({
const original = playwrightDefineConfig({
testDir: process.env.TEST_ROOT || process.cwd(),
testMatch: STORYBOOK_STORIES_PATTERN?.split(';'),
globalSetup: path.join(__dirname, 'config', 'global.setup.js'),
Expand Down Expand Up @@ -56,6 +55,7 @@ export const defineConfig = (config: PlaywrightTestConfig) => {
},
],

// Keep this for older versions of PW if we ever need. It stopped working in 1.42.0
build: {
babelPlugins: [[path.join(__dirname, 'playwright', 'csf-playwright-plugin.js')]],
// @ts-ignore
Expand All @@ -71,4 +71,12 @@ export const defineConfig = (config: PlaywrightTestConfig) => {
},
...config,
});

return {
...original,
'@playwright/test': {
...(original as any)['@playwright/test'],
babelPlugins: [[path.join(__dirname, 'playwright', 'csf-playwright-plugin.js')]],
},
};
};

0 comments on commit 8704aa7

Please sign in to comment.