Skip to content

Commit 1c1ca79

Browse files
MikeMcC399mjhenkes
andauthored
reorganize browser tests (#818)
rename chrome directory to browser run edge test in ubuntu-22.04 remove electron test from chrome test add cypress run scripts for different browsers update image-size to 1.0.2 Co-authored-by: Matt Henkes <[email protected]>
1 parent 9e55093 commit 1c1ca79

18 files changed

+126
-145
lines changed

.github/workflows/example-chrome.yml

+18-46
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,46 @@ jobs:
2323
# print information about detected browsers, etc
2424
# see https://on.cypress.io/command-line#cypress-info
2525
build: npx cypress info
26-
working-directory: examples/v9/chrome
27-
28-
- name: Electron
29-
uses: ./
30-
with:
31-
working-directory: examples/v9/chrome
32-
33-
# store screenshot captured during the test
34-
- uses: actions/upload-artifact@v3
35-
with:
36-
name: screenshots-in-electron-v9
37-
path: examples/v9/chrome/cypress/screenshots
38-
39-
- run: npx image-size cypress/screenshots/**/*.png
40-
working-directory: examples/v9/chrome
26+
working-directory: examples/v9/browser
4127

4228
- name: Chrome
4329
uses: ./
4430
with:
45-
working-directory: examples/v9/chrome
31+
working-directory: examples/v9/browser
4632
browser: chrome
4733

4834
- uses: actions/upload-artifact@v3
4935
with:
5036
name: screenshots-in-chrome-v9
51-
path: examples/v9/chrome/cypress/screenshots
37+
path: examples/v9/browser/cypress/screenshots
5238

5339
- uses: actions/upload-artifact@v3
5440
with:
5541
name: video-in-chrome-v9
56-
path: examples/v9/chrome/cypress/videos
42+
path: examples/v9/browser/cypress/videos
5743

5844
- run: npx image-size cypress/screenshots/**/*.png
59-
working-directory: examples/v9/chrome
45+
working-directory: examples/v9/browser
6046

6147
- name: Chrome headed
6248
uses: ./
6349
with:
64-
working-directory: examples/v9/chrome
50+
working-directory: examples/v9/browser
6551
browser: chrome
6652
headed: true
6753

6854
- uses: actions/upload-artifact@v3
6955
with:
7056
name: screenshots-in-headed-chrome-v9
71-
path: examples/v9/chrome/cypress/screenshots
57+
path: examples/v9/browser/cypress/screenshots
7258

7359
- uses: actions/upload-artifact@v3
7460
with:
7561
name: video-in-headed-chrome-v9
76-
path: examples/v9/chrome/cypress/videos
62+
path: examples/v9/browser/cypress/videos
7763

7864
- run: npx image-size cypress/screenshots/**/*.png
79-
working-directory: examples/v9/chrome
65+
working-directory: examples/v9/browser
8066

8167
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cypress v10 and higher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
8268

@@ -93,57 +79,43 @@ jobs:
9379
# print information about detected browsers, etc
9480
# see https://on.cypress.io/command-line#cypress-info
9581
build: npx cypress info
96-
working-directory: examples/chrome
97-
98-
- name: Electron
99-
uses: ./
100-
with:
101-
working-directory: examples/chrome
102-
103-
# store screenshot captured during the test
104-
- uses: actions/upload-artifact@v3
105-
with:
106-
name: screenshots-in-electron
107-
path: examples/chrome/cypress/screenshots
108-
109-
- run: npx image-size cypress/screenshots/**/*.png
110-
working-directory: examples/chrome
82+
working-directory: examples/browser
11183

11284
- name: Chrome
11385
uses: ./
11486
with:
115-
working-directory: examples/chrome
87+
working-directory: examples/browser
11688
browser: chrome
11789

11890
- uses: actions/upload-artifact@v3
11991
with:
12092
name: screenshots-in-chrome
121-
path: examples/chrome/cypress/screenshots
93+
path: examples/browser/cypress/screenshots
12294

12395
- uses: actions/upload-artifact@v3
12496
with:
12597
name: video-in-chrome
126-
path: examples/chrome/cypress/videos
98+
path: examples/browser/cypress/videos
12799

128100
- run: npx image-size cypress/screenshots/**/*.png
129-
working-directory: examples/chrome
101+
working-directory: examples/browser
130102

131103
- name: Chrome headless
132104
uses: ./
133105
with:
134-
working-directory: examples/chrome
106+
working-directory: examples/browser
135107
browser: chrome
136108
headed: false
137109

138110
- uses: actions/upload-artifact@v3
139111
with:
140112
name: screenshots-in-headless-chrome
141-
path: examples/chrome/cypress/screenshots
113+
path: examples/browser/cypress/screenshots
142114

143115
- uses: actions/upload-artifact@v3
144116
with:
145117
name: video-in-headless-chrome
146-
path: examples/chrome/cypress/videos
118+
path: examples/browser/cypress/videos
147119

148120
- run: npx image-size cypress/screenshots/**/*.png
149-
working-directory: examples/chrome
121+
working-directory: examples/browser

.github/workflows/example-edge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
tests:
11-
runs-on: windows-latest
11+
runs-on: ubuntu-22.04
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3
@@ -20,5 +20,5 @@ jobs:
2020
# print information about detected browsers, etc
2121
# see https://on.cypress.io/command-line#cypress-info
2222
build: npm run info
23-
working-directory: examples/chrome
23+
working-directory: examples/browser
2424
browser: edge

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ name: Edge
139139
on: push
140140
jobs:
141141
edge:
142-
runs-on: windows-latest
142+
runs-on: ubuntu-22.04
143143
name: E2E on Edge
144144
steps:
145145
- uses: actions/checkout@v3
File renamed without changes.
File renamed without changes.

examples/chrome/package-lock.json examples/browser/package-lock.json

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/browser/package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "example-browser",
3+
"version": "1.1.0",
4+
"description": "running Cypress using different browsers",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "npm run cy:run",
8+
"info": "cypress info",
9+
"cy:run": "cypress run",
10+
"cy:run:chrome": "cypress run --browser chrome",
11+
"cy:run:edge": "cypress run --browser edge"
12+
},
13+
"author": "",
14+
"license": "ISC",
15+
"private": true,
16+
"devDependencies": {
17+
"cypress": "12.7.0",
18+
"image-size": "^1.0.2"
19+
}
20+
}

examples/chrome/package.json

-17
This file was deleted.

examples/firefox/package-lock.json

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/firefox/package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
{
22
"name": "example-firefox",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "running Cypress using Firefox",
55
"main": "index.js",
66
"scripts": {
7-
"test": "cypress run"
7+
"test": "npm run cy:run:firefox",
8+
"info": "cypress info",
9+
"cy:run": "cypress run",
10+
"cy:run:firefox": "cypress run --browser firefox"
811
},
912
"author": "",
1013
"license": "ISC",
1114
"private": true,
1215
"devDependencies": {
1316
"cypress": "12.7.0",
14-
"image-size": "0.8.3"
17+
"image-size": "^1.0.2"
1518
}
1619
}
File renamed without changes.

0 commit comments

Comments
 (0)