Skip to content

Commit 6a21514

Browse files
authored
Merge pull request #2161 from oasisprotocol/lw/rm-cy
Migrate Cypress e2e tests to playwright and remove Oasis Monitor docker config
2 parents 6daeb27 + b38b607 commit 6a21514

57 files changed

Lines changed: 212 additions & 26126 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changelog/2161.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrate Cypress e2e tests to Playwright and remove Oasis Monitor docker config

.github/workflows/ci-test.yml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,10 @@ jobs:
9191
path: playwright/test-results
9292
retention-days: 5
9393

94-
cypress:
95-
# NOTE: This name appears in GitHub's Checks API.
96-
name: cypress
97-
needs: [yarn_cache]
98-
runs-on: ubuntu-latest
99-
steps:
100-
- name: Checkout code
101-
uses: actions/checkout@v4
102-
- name: Set up Node.js 18
103-
uses: actions/setup-node@v4
104-
with:
105-
node-version: '18.x'
106-
cache: yarn
107-
- name: Install dependencies
108-
run: yarn install --frozen-lockfile
109-
- run: docker compose pull
110-
- uses: satackey/action-docker-layer-caching@v0.0.11
111-
# Ignore the failure of a step and avoid terminating the job.
112-
continue-on-error: true
113-
- run: NODE_ENV=test REACT_APP_LOCALNET=1 REACT_APP_BACKEND=oasismonitor yarn start &
114-
- run: docker compose up --build -d
115-
- run: npx wait-on http://localhost:3000/ --timeout 60000
116-
- run: yarn cypress:run
117-
- name: 'Upload coverage report'
118-
uses: actions/upload-artifact@v4
119-
with:
120-
name: cypress-coverage
121-
path: cypress-coverage
122-
retention-days: 5
123-
12494
upload-coverage:
12595
# NOTE: This name appears in GitHub's Checks API.
12696
name: coverage
127-
needs: [cypress, jest]
97+
needs: [jest]
12898
runs-on: ubuntu-latest
12999
steps:
130100
- name: Checkout code
@@ -135,7 +105,3 @@ jobs:
135105
with:
136106
files: ./jest-coverage/coverage-final.json
137107
flags: jest
138-
- uses: codecov/codecov-action@v3
139-
with:
140-
files: ./cypress-coverage/coverage-final.json
141-
flags: cypress

.gitignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Don't check auto-generated stuff into git
22
.parcel-cache/
3-
cypress-coverage/
43
coverage/
54
build/
65
build-ext/
@@ -20,15 +19,5 @@ yarn-error.log*
2019
\#*
2120
.\#*
2221

23-
# Docker
24-
/node
25-
/docker/oasis-node/node
26-
2722
# Local debug
2823
debug*.c
29-
30-
# Cypress
31-
/cypress/screenshots/
32-
/cypress/videos/
33-
/.nyc_output/
34-
/instrumented/

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
build/
22
node_modules/
3-
cypress/
43
coverage/
54
**/node/**
65
package-lock.json

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
"typescriptHero.imports.insertSemicolons": false,
2121
"files.exclude": {
2222
"**/__snapshots__/": true,
23-
".nyc_output/": true,
24-
"cypress-coverage/": true,
2523
"coverage/": true,
2624
".parcel-cache/": true,
2725
"build/": true,

README.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ yarn install
6565
yarn start
6666
```
6767

68-
Alternatively, to get started with a local network:
69-
70-
```shell
71-
docker-compose up --build -d
72-
yarn install
73-
REACT_APP_LOCALNET=1 yarn start
74-
```
75-
7668
Then go to <http://localhost:3000> to access the wallet.
7769

7870
### Test accounts
@@ -93,9 +85,6 @@ oasis1qq5t7f2gecsjsdxmp5zxtwgck6pzpjmkvc657z6l
9385

9486
## Architecture
9587

96-
This code needs multiple components to run, all provided in the
97-
[docker-compose.yml] for local development.
98-
9988
![Architecture diagram](docs/images/architecture.svg)
10089

10190
- [envoy-proxy], used as a gRPC gateway for live access to the oasis-node, to
@@ -117,9 +106,9 @@ API that web wallet is using is determined during a build time.
117106

118107
The repository has two different test strategies:
119108

120-
- E2E (End-to-end) tests, run with [Cypress], located in [cypress/](/cypress).
121-
These tests require the react app to be accessible on port `3000` and the
122-
docker-compose stack to be up.
109+
- E2E (End-to-end) tests, run with [Playwright], located in
110+
[playwright/](/playwright).
111+
These tests require the react app to be accessible on port `3000`.
123112
- Unit & functional tests, run with [Jest], located throughout the codebase
124113

125114
To run all tests:
@@ -138,12 +127,6 @@ yarn start
138127
# Or `yarn start:prod` and `yarn test:prod` to test production builds.
139128
# Or `xvfb-run yarn test` to prevent browser windows opening.
140129

141-
# Run cypress tests
142-
docker-compose up -d
143-
# Run this in another terminal to keep it open
144-
REACT_APP_LOCALNET=1 REACT_APP_BACKEND=oasismonitor yarn start
145-
yarn cypress:run
146-
147130
# Manually check that content-security-policy in getSecurityHeaders.js doesn't
148131
# break any functionality
149132
yarn start:prod
@@ -218,13 +201,11 @@ Adding a new language:
218201

219202
[demo-video]: https://github.com/oasisprotocol/wallet/assets/3758846/ef11fbea-dd55-42b1-87a4-1b74509a2809
220203
[chromewebstore.google.com]: https://chromewebstore.google.com/detail/rose-wallet/ppdadbejkmjnefldpcdjhnkpbjkikoip
221-
[docker-compose.yml]: docker-compose.yml
222204
[envoy-proxy]: https://www.envoyproxy.io
223205
[oasis-nexus]: https://github.com/oasisprotocol/nexus
224206
[oasis-nexus-api-spec]: https://nexus.oasis.io/v1/spec/v1.html
225207
[oasis-scan]: https://www.oasisscan.com
226208
[scan-api-repo]: https://github.com/bitcat365/oasisscan-backend#oasisscan-api
227-
[Cypress]: https://www.cypress.io/
228209
[Jest]: https://github.com/facebook/jest
229210
[prettier]: https://prettier.io/
230211
[eslint]: https://github.com/eslint/eslint

cypress.config.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

cypress/e2e/create-wallet.cy.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

cypress/e2e/encryption-unit-tests.cy.ts

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)