Skip to content

Commit b808bcc

Browse files
committed
added e2e github workflow
1 parent 2b2e6b3 commit b808bcc

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/playwright-e2e.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master, beta-master ]
5+
pull_request:
6+
branches: [ main, master, beta-master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: lts/*
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install Playwright Browsers
19+
run: npx playwright install --with-deps
20+
- name: Run Playwright Component and unit tests
21+
run: npx playwright test -c playwright-e2e.config.js
22+
- uses: actions/upload-artifact@v4
23+
if: always()
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

playwright-e2e.config.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// @ts-check
2+
const { defineConfig, devices } = require('@playwright/experimental-ct-react');
3+
4+
/**
5+
* @see https://playwright.dev/docs/test-configuration
6+
*/
7+
module.exports = defineConfig({
8+
testDir: './tests/e2e',
9+
/* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
10+
snapshotDir: './__snapshots__',
11+
/* Maximum time one test can run for. */
12+
timeout: 10 * 1000,
13+
/* Run tests in files in parallel */
14+
fullyParallel: true,
15+
/* Fail the build on CI if you accidentally left test.only in the source code. */
16+
forbidOnly: !!process.env.CI,
17+
/* Retry on CI only */
18+
retries: process.env.CI ? 2 : 0,
19+
/* Opt out of parallel tests on CI. */
20+
workers: process.env.CI ? 1 : undefined,
21+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
22+
reporter: 'html',
23+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
24+
use: {
25+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
26+
trace: 'on-first-retry',
27+
28+
/* Port to use for Playwright component endpoint. */
29+
ctPort: 3100,
30+
},
31+
32+
/* Configure projects for major browsers */
33+
projects: [
34+
{
35+
name: 'chromium',
36+
use: { ...devices['Desktop Chrome'] },
37+
},
38+
// {
39+
// name: 'firefox',
40+
// use: { ...devices['Desktop Firefox'] },
41+
// },
42+
// {
43+
// name: 'webkit',
44+
// use: { ...devices['Desktop Safari'] },
45+
// },
46+
],
47+
});

0 commit comments

Comments
 (0)