Skip to content

Cypress visual regression testing #998

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

Merged
merged 38 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0abe2a3
Partial cypress configuration
mwtrew May 14, 2024
cf8a5d5
Add basic Cypress component testing config
mwtrew May 17, 2024
57f5dba
Configure visual regression testing
mwtrew May 20, 2024
9d0a711
Support site-specific visual testing
mwtrew May 28, 2024
3cff679
Add dockerised cypress run
mwtrew Jun 11, 2024
12f357b
Run Cypress visual regression tests on CI
mwtrew Jun 13, 2024
9f55cfe
Refactor utils to resolve Node dependency issue
mwtrew Jun 13, 2024
541e329
Remove -it from Docker commands
mwtrew Jun 13, 2024
977bf42
Use Cypress workflow definition
mwtrew Jun 13, 2024
ad1e767
Remove unused import
mwtrew Jun 13, 2024
12ca153
Add artifact upload step to Cypress action
mwtrew Jun 13, 2024
0aa3da5
Run artifact upload if VRT fails
mwtrew Jun 13, 2024
bd276fa
Force Cypress to wait for page load
mwtrew Jun 13, 2024
ba01568
Update baselines
mwtrew Jun 13, 2024
2d19859
Merge branch 'master' of github.com:isaacphysics/isaac-react-app into…
mwtrew Jun 20, 2024
f1c1682
Downgrade Cypress and regenerate baselines
mwtrew Jun 20, 2024
5fd728b
Fix Ada run configuration
mwtrew Jun 20, 2024
adc230b
Fix Ada run configuration
mwtrew Jun 20, 2024
24fbde3
Fix Ada run configuration
mwtrew Jun 20, 2024
777bb6e
Use Chrome for visual regression tests
mwtrew Jun 20, 2024
25b0330
Add new command to mount with store and router
mwtrew Jun 21, 2024
12be0a6
Revert changes to RTK renderTestEnvironment
mwtrew Jun 21, 2024
60704a7
Cache dependencies when running locally
mwtrew Jun 21, 2024
bb68990
Add groups VRT, use fixed future date for test data
mwtrew Jun 24, 2024
7789f09
Remove unused imports
mwtrew Jun 24, 2024
ace35cd
Remove sample Cypress fixtures file
mwtrew Jun 24, 2024
51db4e9
Add Set Assignments VRTs
mwtrew Jun 24, 2024
7543d9f
Add Cypress downloads to gitignore
mwtrew Jun 25, 2024
b21b9a6
Cache webpack output to speed up local dev and VRTs
mwtrew Jul 3, 2024
184e12c
Revert common webpack config, create derived Cypress configs
mwtrew Jul 3, 2024
ac9ded2
Remove unused imports
mwtrew Jul 3, 2024
8e22e06
Add Windows support for Cypress VRTs
mwtrew Jul 4, 2024
eeb7f8f
Fix site and update baseline vars, remove unused imports
mwtrew Jul 4, 2024
0fb9f40
Rename docker entrypoint
mwtrew Jul 4, 2024
fd0d835
Use python3 in package.json call to suit MacOS & WSL
mwtrew Jul 4, 2024
fc754e0
Restore common webpack config
mwtrew Jul 10, 2024
634fafc
Merge branch 'master' of github.com:isaacphysics/isaac-react-app into…
mwtrew Jul 10, 2024
de1cba4
Update VRT baselines
mwtrew Jul 10, 2024
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
38 changes: 38 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Cypress visual regression tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
cypress-run:
runs-on: ubuntu-22.04
container:
# This must stay in sync with the image used by the test-{site}-visual scripts in package.json.
image: cypress/browsers:node-20.14.0-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run (Ada)
uses: cypress-io/github-action@v6
with:
component: true
browser: chrome
env:
CYPRESS_SITE: ada
- name: Cypress run (Physics)
uses: cypress-io/github-action@v6
with:
component: true
browser: chrome
env:
CYPRESS_SITE: phy
- name: Upload artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: visual-diffs
path: src/test/**/*.diff.png
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ bundle-stats-*.json

# testing
/coverage
/cypress/screenshots
/cypress/downloads
*.actual.png
*.diff.png

# production
/build
Expand Down
12 changes: 12 additions & 0 deletions config/webpack.config.ada.cypress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable */
const path = require('path');
const configAda = require('./webpack.config.ada');
const {merge} = require('webpack-merge');

module.exports = env => {
let configAdaCypress = {
cache: {type: 'filesystem', name: 'cs'},
};

return merge(configAda({...env, isRenderer: false, prod: false}), configAdaCypress);
};
Loading