Skip to content

Commit 44cf529

Browse files
authored
feat: use circleci chrome for testing and edge (#534)
1 parent 8cf1d17 commit 44cf529

File tree

5 files changed

+33
-19
lines changed

5 files changed

+33
-19
lines changed

.circleci/test-deploy.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2.1
22
orbs:
33
orb-tools: circleci/[email protected]
4+
browser-tools: circleci/[email protected]
45
# The orb will be injected here by the "continue" job.
56
filters: &filters
67
tags:
@@ -32,6 +33,18 @@ jobs:
3233
- cypress/run-tests:
3334
working-directory: examples/angular-app
3435
cypress-command: "npx cypress run --component --parallel --record --group 2x-chrome --browser chrome"
36+
run-ct-tests-in-chrome-for-testing:
37+
executor:
38+
name: cypress/default
39+
parallelism: 2
40+
steps:
41+
- run: echo "This step assumes dependencies were installed using the cypress/install job"
42+
- attach_workspace:
43+
at: ~/
44+
- browser-tools/install_chrome_for_testing
45+
- cypress/run-tests:
46+
working-directory: examples/angular-app
47+
cypress-command: "npx cypress run --component --parallel --record --group 2x-edge --browser chrome-for-testing"
3548
run-ct-tests-in-firefox:
3649
docker:
3750
- image: cypress/browsers:22.16.0
@@ -44,13 +57,14 @@ jobs:
4457
working-directory: examples/angular-app
4558
cypress-command: "npx cypress run --component --parallel --record --group 2x-firefox --browser firefox"
4659
run-ct-tests-in-edge:
47-
docker:
48-
- image: cypress/browsers:22.16.0
60+
executor:
61+
name: cypress/default
4962
parallelism: 2
5063
steps:
5164
- run: echo "This step assumes dependencies were installed using the cypress/install job"
5265
- attach_workspace:
5366
at: ~/
67+
- browser-tools/install_edge
5468
- cypress/run-tests:
5569
working-directory: examples/angular-app
5670
cypress-command: "npx cypress run --component --parallel --record --group 2x-edge --browser edge"
@@ -146,6 +160,11 @@ workflows:
146160
name: Run CT Tests in Chrome
147161
requires:
148162
- Install & Persist
163+
- run-ct-tests-in-chrome-for-testing:
164+
filters: *filters
165+
name: Run CT Tests in Chrome for Testing
166+
requires:
167+
- Install & Persist
149168
- run-ct-tests-in-firefox:
150169
filters: *filters
151170
name: Run CT Tests in Firefox
@@ -183,6 +202,7 @@ workflows:
183202
- Run CT in Parallel
184203
- Install & Persist
185204
- Run CT Tests in Chrome
205+
- Run CT Tests in Chrome for Testing
186206
- Run CT Tests in Firefox
187207
- Run CT Tests in Edge
188208
- Verify skip-checkout
@@ -209,6 +229,7 @@ workflows:
209229
- Run CT in Parallel
210230
- Install & Persist
211231
- Run CT Tests in Chrome
232+
- Run CT Tests in Chrome for Testing
212233
- Run CT Tests in Firefox
213234
- Run CT Tests in Edge
214235
- Verify skip-checkout

src/commands/install.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ parameters:
1616
description: |
1717
Cypress runs by default in the Electron browser. Use this flag to install additional browsers to run your tests in.
1818
This is only needed if you are passing the `--browser` flag in your `cypress-command`.
19-
This parameter leverages the `circleci/browser-tools` orb and includes Chrome and FireFox.
20-
If you need additional browser support you can set this to false and use an executor with a docker image
19+
This parameter leverages the `circleci/browser-tools` orb and includes Chrome, Chrome for Testing, Edge, Firefox and the geckodriver.
20+
If you need additional browser support you can set this to false and use an executor with a Docker image
2121
that includes the browsers of your choosing. See https://hub.docker.com/r/cypress/browsers/tags
2222
type: boolean
2323
default: false
@@ -63,6 +63,8 @@ steps:
6363
steps:
6464
- browser-tools/install_browser_tools:
6565
install_chromedriver: false
66+
install_chrome_for_testing: true
67+
install_edge: true
6668
- restore_cache:
6769
name: Restore Cypress cache
6870
key: << parameters.cypress-cache-key >>

src/examples/browser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
description: >
2-
Run Cypress tests using specified browser. `install_browsers: true` installs the default browsers Chrome and Firefox from the CircleCI Browser Tools orb at https://circleci.com/developer/orbs/orb/circleci/browser-tools#commands-install_browser_tools. See https://circleci.com/developer/orbs/orb/cypress-io/cypress#usage-edge, for current Microsoft Edge support.
2+
Run Cypress tests using specified browser. `install_browsers: true` installs the default browsers Chrome and Firefox with the geckodriver, and the optional browsers Chrome for Testing and Edge from the CircleCI Browser Tools orb at https://circleci.com/developer/orbs/orb/circleci/browser-tools#commands-install_browser_tools.
33
usage:
44
version: 2.1
55
orbs:

src/examples/edge.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,10 @@ usage:
44
version: 2.1
55
orbs:
66
cypress: cypress-io/cypress@4
7-
executors:
8-
cypress-browsers:
9-
docker:
10-
- image: cypress/browsers:22.15.0
11-
jobs:
12-
edge-test:
13-
executor: cypress-browsers
14-
steps:
15-
- cypress/install
16-
- cypress/run-tests:
17-
start-command: "npm run start:dev"
18-
cypress-command: 'npx cypress run --browser edge'
197
workflows:
208
use-my-orb:
219
jobs:
22-
- edge-test
10+
- cypress/run:
11+
start-command: "npm run start:dev"
12+
cypress-command: "npx cypress run --browser edge"
13+
install-browsers: true

src/jobs/run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ parameters:
2323
description: |
2424
Cypress runs by default in the Electron browser. Use this flag to install additional browsers to run your tests in.
2525
This is only needed if you are passing the `--browser` flag in your `cypress-command`.
26-
This parameter leverages the `circleci/browser-tools` orb and includes Chrome and FireFox.
26+
This parameter leverages the `circleci/browser-tools` orb and includes Chrome, Chrome for Testing, Edge, Firefox and the geckodriver.
2727
If you need additional browser support you can set this to false and use an executor with a docker image
2828
that includes the browsers of your choosing. See https://hub.docker.com/r/cypress/browsers/tags
2929
type: boolean

0 commit comments

Comments
 (0)