Skip to content

Commit 7102bff

Browse files
committed
Add Replay
1 parent a4779fc commit 7102bff

File tree

5 files changed

+812
-381
lines changed

5 files changed

+812
-381
lines changed

.circleci/config.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
build:
88
docker:
99
# specify the version you desire here
10-
# - image: circleci/node:10
11-
- image: cypress/base:10
10+
# - image: circleci/node:18
11+
- image: cypress/base:16
1212

1313
# Specify service dependencies here if necessary
1414
# CircleCI maintains a library of pre-built images
@@ -34,5 +34,9 @@ jobs:
3434
- node_modules
3535
key: v1-dependencies-{{ checksum "package.json" }}
3636

37-
# run tests!
3837
- run: yarn test
38+
39+
- run:
40+
command: npx @replayio/replay upload-all
41+
environment:
42+
RECORD_REPLAY_API_KEY: rwk_BfwnKwjoc9FfK1cG1tdZ8x1zt8h2YuTqHcCdhb4v8zZ

cypress.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"baseUrl": "http://localhost:8000/"
2+
"baseUrl": "http://localhost:8000/",
3+
"screenshotOnRunFailure": false,
4+
"video": false
35
}

cypress/plugins/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const cypressReplay = require('@replayio/cypress')
12
// ***********************************************************
23
// This example plugins/index.js can be used to load plugins
34
//
@@ -10,8 +11,13 @@
1011

1112
// This function is called when a project is opened or re-opened (e.g. due to
1213
// the project's config changing)
13-
14+
/**
15+
* @type {Cypress.PluginConfig}
16+
*/
17+
// eslint-disable-next-line no-unused-vars
1418
module.exports = (on, config) => {
1519
// `on` is used to hook into various events Cypress emits
1620
// `config` is the resolved Cypress config
21+
cypressReplay.default(on, config)
22+
return config
1723
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212
"export": "./packages/export/cli.js http://localhost:8000/print -o docs/public/deck.pdf",
1313
"cypress:open": "cypress open",
1414
"cypress:run": "cypress run",
15+
"cypress:record": "RECORD_ALL_CONTENT=1 RECORD_REPLAY_METADATA_FILE=$(mktemp) cypress run --browser 'Replay Firefox'",
1516
"test:dev": "start-server-and-test start http://localhost:8000 cypress:open",
1617
"jest": "jest",
17-
"test": "jest && start-server-and-test start http://localhost:8000 cypress:run"
18+
"test": "RECORD_ALL_CONTENT=1 RECORD_REPLAY_METADATA_FILE=$(mktemp) jest && start-server-and-test start http://localhost:8000 cypress:run --browser 'Replay Firefox'"
1819
},
1920
"devDependencies": {
2021
"@babel/core": "^7.8.4",
2122
"@babel/preset-env": "^7.8.4",
2223
"@babel/preset-react": "^7.8.3",
2324
"@testing-library/react": "^10.0.2",
24-
"cypress": "^4.3.0",
25+
"@replayio/cypress": "^0.2.7",
26+
"cypress": "^9.7.0",
2527
"husky": "^4.2.1",
2628
"jest": "^25.1.0",
2729
"jest-emotion": "^10.0.27",

0 commit comments

Comments
 (0)