You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## How do I group tests ran in a matrix or across multiple runners into the same test run?
34
+
24
35
By default, each invocation of Cypress is grouped into a test run by a UUID generated when the run begins. To group multiple invocations of Cypress into the same run, set `RECORD_REPLAY_METADATA_TEST_RUN_ID` to the same UUID value and that will be used instead of generating a UUID for each.
25
36
26
37
Below is an example which runs three test suites using a matrix in Github Actions but groups the results into the same test run in Replay:
Copy file name to clipboardexpand all lines: src/app/reference/test-runners/cypress-io/github-actions/page.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: GitHub actions
3
3
---
4
4
5
-
Cypress team has created its [official GitHub Action](https://github.com/cypress-io/github-action). The action provides dependency installation, built-in caching, and multiple options for advanced workflow configuration.
5
+
Cypress team has created its [official GitHub Action](https://github.com/cypress-io/github-action). The action provides dependency installation, built-in caching, and multiple options for advanced workflow configuration.
6
6
7
7
Using this GitHub Action is optional and some teams prefer their own custom setup. Replay integrates well with both workflows, as shown in examples below
8
8
@@ -25,6 +25,8 @@ jobs:
25
25
steps:
26
26
- name: Checkout
27
27
uses: actions/checkout@v4
28
+
- name: Install Replay Chromium
29
+
run: npx replayio install
28
30
- name: Cypress run
29
31
uses: cypress-io/github-action@v6
30
32
with:
@@ -41,10 +43,12 @@ jobs:
41
43
## Using GitHub Actions without `cypress-io/github-action`
42
44
43
45
Without using GitHub Actions and running your Cypress tests by calling a script, the main principles stay the same:
46
+
44
47
- you need to make sure to pass `REPLAY_API_KEY` to your test run
45
48
- add step to your pipeline to upload your replays
46
49
47
50
There are a couple of different ways to achieve this. For example, you can update your `package.json` file with a custom script that runs your Cypress tests with Replay Browser
Copy file name to clipboardexpand all lines: src/app/reference/test-runners/cypress-io/troubleshooting-guide/page.md
+13-14
Original file line number
Diff line number
Diff line change
@@ -30,20 +30,18 @@ Available browsers found on your system are:
30
30
- firefox:dev
31
31
- firefox:nightly
32
32
- electron
33
-
- Replay Firefox
34
33
```
35
34
36
35
- This is expected (for now). Check first whether the process exits immediately, chances are the test ends up proceeding as expected!
37
36
- While modifying `cypress.config.js`, make sure you’re returning the `config` object in `setupNodeEvents`
38
-
- Make sure you’re using the correct browser for your operating system. `replay-chromium` is only supported on linux, whereas `replay-firefox` supports both mac and linux.
39
-
- The environment variable `[CYPRESS_INSTALL_BINARY](https://docs.cypress.io/guides/references/advanced-installation)` may be suppressing the browser install step. If it’s set to `0`, make sure to add an explicit workflow step to install the browsers (`npx @replayio/cypress install`)
37
+
- Make sure you’re using the correct browser for your operating system. `replay-chromium` is only supported on linuxand mac
38
+
- The environment variable `[CYPRESS_INSTALL_BINARY](https://docs.cypress.io/guides/references/advanced-installation)` may be suppressing the browser install step. If it’s set to `0`, make sure to add an explicit workflow step to install the browsers (`npx replayio install`)
40
39
- Your caching strategy might be keeping our plugin from pulling in the correct browser. Start debugging it by turning off all caching, e.g. `actions/cache`
41
40
42
41
# How do I use Replay with versions earlier than 10.9?
43
42
44
43
Replay works best with Cypress 10.9 or later but can be used with Cypress 8 or later with some additional environment configuration:
45
44
46
-
-`RECORD_ALL_CONTENT` must be set when using `replay-firefox` to record replays
47
45
-`RECORD_REPLAY_METADATA_FILE` must be set for either browser to capture metadata about the test run.
48
46
49
47
When running locally, you can set these variables in your npm scripts so they are set every time:
@@ -58,14 +56,15 @@ When running locally, you can set these variables in your npm scripts so they ar
58
56
On CI, you can set these environment variables on the task that runs your tests:
If you’re using DeploySentinel, you may notice that either you are unable to record replays or the replays created do not show the Cypress Panel when you open them. This is caused by environment variables set by our plugin that are not passed on by DeploySentinel.
85
84
86
-
Fortunately, you can set this manually on the command line or in your CI configuration. Follow the [instructions for running with earlier versions of Cypress](/reference/test-runners/cypress-io/faq) to configure `RECORD_REPLAY_METADATA_FILE` (and `RECORD_ALL_CONTENT` if you’re using Firefox).
85
+
Fortunately, you can set this manually on the command line or in your CI configuration. Follow the [instructions for running with earlier versions of Cypress](/reference/test-runners/cypress-io/faq) to configure `RECORD_REPLAY_METADATA_FILE`
87
86
88
87
```bash
89
88
RECORD_REPLAY_METADATA_FILE=/tmp/replay-metadata.json npx run cypress
@@ -96,22 +95,22 @@ When the browser hangs while running a test, it is likely an interaction between
96
95
You can run the test in **diagnostic mode** by passing in a mode flag.
97
96
98
97
```bash
99
-
npx @replayio/cypress run --mode diagnostics --level full
98
+
npx @replayio/cypress run --mode diagnostics --level full
100
99
```
101
100
102
-
For more information, see [Diagnostic modes](/reference/test-runners/cypress-io/overview)
101
+
For more information, see [Diagnostic modes](/reference/test-runners/cypress-io/overview)
103
102
104
103
We also recommend going for the simplest reproduction which includes running the fewest specs possible and setting a timeout so that the test fails as soon as possible.
105
104
106
105
You can use the **Cypress timeout** command to set a timeout
107
106
108
107
```jsx
109
-
describe("test spec", () => {
110
-
it("test case", () => {
108
+
describe('test spec', () => {
109
+
it('test case', () => {
111
110
// set the timeout to 1min
112
-
cy.visit("/login", { timeout:60000 });
113
-
});
114
-
});
111
+
cy.visit('/login', { timeout:60000 })
112
+
})
113
+
})
115
114
```
116
115
117
116
You can set a single spec to run, by using the `--spec` flag
Copy file name to clipboardexpand all lines: src/app/reference/test-runners/playwright/troubleshooting/page.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Error: ENOENT: no such file or directory, open '/home/runner/.replay/PLAYWRIGHT_
29
29
If you’re seeing this error in CI, it’s likely that the replay browser wasn’t installed correctly. The browser should be installed alongside all your other dependencies, but in the case that it’s not, try the following:
30
30
31
31
1. Disable caching
32
-
2. Have an explicit step for installing the replay browser - `npx @replayio/playwright install`
32
+
2. Have an explicit step for installing the replay browser - `npx replayio install`
0 commit comments