Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add playwright package and tests to run on GH actions #592

Merged
merged 27 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c4bac7
test: fix video banner test
KrupaPammi Oct 6, 2023
533f410
test: run in headless mode
KrupaPammi Oct 6, 2023
40501c8
test: rename unit test script and command in GH actions
KrupaPammi Oct 6, 2023
822daa6
test: rename PW script name so it's unaffected with jest tests
KrupaPammi Oct 6, 2023
2747f30
test: re-run the job
KrupaPammi Oct 6, 2023
92b0872
ci: update playwright scripts
KrupaPammi Oct 6, 2023
7420ab1
ci: remove cypress and change tests dir to 'e2e'
KrupaPammi Oct 6, 2023
e511e2f
test: ignore playwright from jest test path
KrupaPammi Oct 10, 2023
78cda7d
Merge branch 'master' into migrate_cypress_to_playwright_tests
KrupaPammi Oct 10, 2023
520e80d
ci: move playwright task before publish
KrupaPammi Oct 10, 2023
c212848
Merge remote-tracking branch 'origin/migrate_cypress_to_playwright_te…
KrupaPammi Oct 10, 2023
6f9e812
ci: update publish job with playwright
KrupaPammi Oct 10, 2023
76d629f
fix merge conflicts
KrupaPammi Nov 8, 2023
77e0ab6
fix merge conflicts
KrupaPammi Nov 8, 2023
b2e7e31
test: update jest snapshot for membership test
KrupaPammi Nov 9, 2023
48c3e13
test: add header component test
KrupaPammi Nov 9, 2023
ff2c867
test: add footer component test
KrupaPammi Nov 9, 2023
b80ef7a
test: add impact slider component test
KrupaPammi Nov 13, 2023
b7fc04a
Merge branch 'master' into migrate_cypress_to_playwright_tests
KrupaPammi Nov 14, 2023
2263e67
test: add marketing prefs test
KrupaPammi Nov 15, 2023
bd95bea
Merge remote-tracking branch 'origin/migrate_cypress_to_playwright_te…
KrupaPammi Nov 15, 2023
198f752
test: add marketing prefs test
KrupaPammi Nov 15, 2023
d14fd12
Add Lint test, and also package Yarn is moaning about
AndyEPhipps Nov 16, 2023
da2d350
Accessibility improvement to keep Lint happy
AndyEPhipps Nov 16, 2023
b660a08
test: add wait when slider moves down from £80 to £45
KrupaPammi Nov 16, 2023
24a5a15
test: remove double check of SR logo
KrupaPammi Nov 16, 2023
fdf1769
test: change the slider decrease amount from £45 to £50
KrupaPammi Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ jobs:
run: yarn build

- name: Run unit tests
run: yarn test --maxWorkers=2
run: yarn test:unit --maxWorkers=2
env:
NODE_OPTIONS: --max_old_space_size=4096

cypress:
name: Cypress test
needs:
- lint
- unit-test
playwright:
name: Playwright test
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -71,37 +69,37 @@ jobs:
with:
node-version-file: '.nvmrc'

# see https://github.com/marketplace/actions/cypress-io
- name: Run Cypress tests
uses: cypress-io/github-action@v2
- name: Restore packages cache
uses: actions/cache@v3
with:
start: yarn styleguide
command: yarn cy:run
wait-on: http://localhost:6060
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts

- name: Install playwright browsers
run: yarn playwright install --with-deps chromium

- name: Run end-to-end tests
run: yarn test:e2e:ci
continue-on-error: false
env:
NODE_OPTIONS: --max_old_space_size=4096

# NOTE: screenshots will be generated only if the tests failed
# thus we store screenshots only on failures
- name: Upload screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots

# Test run video was always captured, so this action uses "always()" condition
- name: Upload videos
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos
name: playwright-report
path: playwright-report/
retention-days: 3

publish:
name: Publish package to npm
if: github.ref == 'refs/heads/master'
needs: cypress
needs: playwright
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist
Expand All @@ -27,6 +24,9 @@ yarn-error.log*
.idea
.vscode

/cypress/videos
/cypress/screenshots
/cypress/**/__diff_output__
# testing
/coverage
/tests_output
/test-results/
/playwright-report/
/playwright/.cache/
15 changes: 0 additions & 15 deletions cypress.config.js

This file was deleted.

102 changes: 0 additions & 102 deletions cypress/e2e/components/atoms/button.cy.js

This file was deleted.

47 changes: 0 additions & 47 deletions cypress/e2e/components/atoms/buttonWithStates.cy.js

This file was deleted.

70 changes: 0 additions & 70 deletions cypress/e2e/components/atoms/checkbox.cy.js

This file was deleted.

46 changes: 0 additions & 46 deletions cypress/e2e/components/atoms/confetti.cy.js

This file was deleted.

Loading
Loading