Skip to content

Commit

Permalink
add browser selection to 'npm test'
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Aug 24, 2024
1 parent 601f240 commit 4cad406
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
- windows-latest
browser:
- electron
- chrome
Expand All @@ -33,16 +33,14 @@ jobs:
name: Linux
- os: macos-latest
name: macOS
# currently only one Windows test
- os: windows-latest
name: Windows
browser: electron
# - os: windows-latest
# name: Windows
# browser: edge
# exclude:
# - os: windows-latest
# browser: webkit
- os: windows-latest
name: Windows
browser: edge
exclude:
- os: windows-latest
browser: webkit

name: ${{ matrix.name }} - ${{ matrix.browser }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -85,5 +83,5 @@ jobs:
wait-on: 'http://localhost:5173'
browser: ${{ matrix.browser }}
- name: Run test (Windows)
run: npm test
run: CY_BROWSER=${{ matrix.browser }} npm test
if: matrix.os == 'windows-latest'
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ You can run

```
npm install
npm run test
npm test
```

for the automated cypress tests.
for the automated cypress tests. You can use the environment variable `CY_BROWSER` to select the
desired browser: `CY_BROWSER=chrome npm test`

### Docker image

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"watch:copyfiles": "nodemon --watch ./src --exec \"npm run build:copyfiles\"",
"build:copyfiles": "cd src && copyfiles \"**/*.json\" \"**/*.css\" \"**/*.ttf\" \"**/*.otf\" \"**/*.svg\" ../dist/",
"build": "tsc && webpack && npm run build:copyfiles",
"test": "npm run setup_demo && concurrently --hide 0 --kill-others \"npm start\" \"wait-on http://localhost:5173 && cypress run\" -n server,cypress -s command-cypress"
"test": "npm run setup_demo && concurrently --hide 0 --kill-others \"npm start\" \"wait-on http://localhost:5173 && cypress run --browser ${CY_BROWSER=electron}\" -n server,cypress -s command-cypress"
},
"dependencies": {
"@leanprover/infoview": "^0.7.3",
Expand Down

0 comments on commit 4cad406

Please sign in to comment.