chore: reorganise playwright config (#53884)

This commit is contained in:
Oliver Eyton-Williams
2024-02-26 15:26:54 +01:00
committed by GitHub
parent e03b78666b
commit 074af6effb
9 changed files with 329 additions and 1534 deletions

View File

@@ -137,7 +137,6 @@ jobs:
- name: Install playwright dependencies - name: Install playwright dependencies
run: | run: |
cd ./e2e
npx playwright install npx playwright install
npx playwright install-deps npx playwright install-deps
@@ -145,5 +144,4 @@ jobs:
run: | run: |
pnpm run start-ci & pnpm run start-ci &
sleep 10 sleep 10
cd ./e2e
npx playwright test --project=${{ matrix.browsers }} npx playwright test --project=${{ matrix.browsers }}

3
.gitignore vendored
View File

@@ -213,3 +213,6 @@ curriculum/build
### UI Components ### ### UI Components ###
tools/ui-components/dist tools/ui-components/dist
### Playwright ###
/playwright

View File

@@ -10,7 +10,7 @@ curriculum-server/data/curriculum.json
curriculum/challenges/_meta/*/* curriculum/challenges/_meta/*/*
curriculum/challenges/**/* curriculum/challenges/**/*
docs/**/*.md docs/**/*.md
e2e/playwright/.auth /playwright
pnpm-lock.yaml pnpm-lock.yaml
shared/config/*.js shared/config/*.js
shared/config/curriculum.json shared/config/curriculum.json

4
e2e/.gitignore vendored
View File

@@ -1,4 +0,0 @@
/test-results
/playwright-report
/playwright/.cache/
/playwright/.auth

View File

@@ -1,15 +0,0 @@
{
"name": "@freecodecamp/e2e",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "npx playwright test"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.36.2",
"@types/node": "^20.4.9"
}
}

View File

@@ -106,6 +106,7 @@
"@babel/preset-env": "7.23.7", "@babel/preset-env": "7.23.7",
"@babel/preset-react": "7.23.3", "@babel/preset-react": "7.23.3",
"@babel/preset-typescript": "7.23.3", "@babel/preset-typescript": "7.23.3",
"@playwright/test": "^1.41.2",
"@testing-library/cypress": "9.0.0", "@testing-library/cypress": "9.0.0",
"@testing-library/dom": "8.20.1", "@testing-library/dom": "8.20.1",
"@testing-library/jest-dom": "5.17.0", "@testing-library/jest-dom": "5.17.0",

View File

@@ -6,13 +6,13 @@ import { defineConfig, devices } from '@playwright/test';
* Read environment variables from file. * Read environment variables from file.
* https://github.com/motdotla/dotenv * https://github.com/motdotla/dotenv
*/ */
const envPath = path.resolve(__dirname, '..', '.env'); const envPath = path.resolve(__dirname, '.env');
dotenvConfig({ path: envPath }); dotenvConfig({ path: envPath });
/** /**
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
export default defineConfig({ export default defineConfig({
testDir: './', testDir: 'e2e',
testMatch: '*.spec.ts', testMatch: '*.spec.ts',
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: false, fullyParallel: false,
@@ -23,9 +23,10 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */ /* Opt out of parallel tests on CI. */
workers: 1, workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html', reporter: [['html', { outputFolder: 'playwright/reporter' }]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
timeout: 15 * 1000, timeout: 15 * 1000,
outputDir: 'playwright/test-results',
use: { use: {
/* Base URL to use in actions like `await page.goto('/')`. */ /* Base URL to use in actions like `await page.goto('/')`. */

1828
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,6 @@ packages:
- 'client' - 'client'
- 'curriculum' - 'curriculum'
- 'shared' - 'shared'
- 'e2e'
- 'tools/challenge-editor/api' - 'tools/challenge-editor/api'
- 'tools/challenge-editor/client' - 'tools/challenge-editor/client'
- 'tools/challenge-helper-scripts' - 'tools/challenge-helper-scripts'