Skip to content

Commit 1f81f09

Browse files
authored
Merge pull request #385 from bcgov/ci/add-playwright-job-to-workflow
Add Playwright test run job to React component library test workflow
2 parents bb831a6 + b269cd3 commit 1f81f09

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

.github/workflows/test_react_component_library.yaml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run test suite for React component library
1+
name: Test React components library
22

33
on:
44
pull_request:
@@ -12,8 +12,8 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
react-components-test:
16-
name: Test suite run
15+
jest-unit-tests:
16+
name: Jest unit tests
1717
runs-on: ubuntu-latest
1818

1919
steps:
@@ -36,3 +36,39 @@ jobs:
3636
- name: Run test suite with npm script
3737
run: npm run test:ci
3838
working-directory: ./packages/react-components
39+
40+
playwright-accessibility-tests:
41+
name: Playwright accessibility tests
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Read .nvmrc
49+
run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
50+
working-directory: ./packages/react-components
51+
52+
- name: Set up Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: ${{ env.GITHUB_NVMRC_VERSION }}
56+
57+
- name: Install dependencies
58+
run: npm install
59+
working-directory: ./packages/react-components
60+
61+
- name: Install Playwright
62+
run: npx playwright install --with-deps
63+
working-directory: ./packages/react-components
64+
65+
- name: Build Storybook
66+
run: npm run storybook-build
67+
working-directory: ./packages/react-components
68+
69+
- name: Serve Storybook and run tests
70+
run: |
71+
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
72+
"npx http-server storybook-static --port 6006 --silent" \
73+
"npx wait-on tcp:6006 && npm run test-storybook:ci"
74+
working-directory: ./packages/react-components

0 commit comments

Comments
 (0)