Skip to content

Commit fe93945

Browse files
Merge pull request #1 from aroskanalen/feature/1541-cypress-becomes-playwright
1541 cypress becomes playwright
2 parents 00955c1 + 9ca3d43 commit fe93945

File tree

78 files changed

+2722
-9277
lines changed

Some content is hidden

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

78 files changed

+2722
-9277
lines changed

.eslintrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"airbnb",
55
"prettier",
66
"plugin:jsdoc/recommended",
7-
"plugin:prettier/recommended",
8-
"plugin:cypress/recommended"
7+
"plugin:prettier/recommended"
98
],
109
"ignorePatterns": ["*.yml"],
1110
"parser": "babel-eslint",

.github/workflows/pr.yml

+15-12
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ jobs:
3131
docker compose run --rm node yarn install
3232
docker compose run --rm node yarn check-coding-standards
3333
34-
cypress:
35-
name: Cypress
34+
playwright-tests:
35+
name: Playwright
3636
runs-on: ubuntu-latest
3737
strategy:
3838
fail-fast: false
39-
matrix:
40-
browser: ["chrome"]
4139
steps:
4240
- name: Checkout
4341
uses: actions/checkout@v3
@@ -48,16 +46,21 @@ jobs:
4846
- name: Install client
4947
run: docker compose run node yarn
5048

51-
- name: Cypress run
52-
run: docker compose run cypress run --browser ${{ matrix.browser }}
49+
- name: Run playwright
50+
env:
51+
CI: 'true'
52+
run: |
53+
docker compose run --rm node yarn install
54+
docker compose run --rm playwright npx playwright install --with-deps
55+
docker compose run --rm playwright npx playwright test --retries 3
56+
5357
54-
- name: Archive screenshots
55-
if: ${{ failure() }}
56-
uses: actions/upload-artifact@v2
58+
- uses: actions/upload-artifact@v3
59+
if: always()
5760
with:
58-
name: cypress-screenshots-${{ matrix.browser }}
59-
path: cypress/screenshots
60-
retention-days: 7
61+
name: playwright-report
62+
path: playwright-report/
63+
retention-days: 30
6164

6265
changelog:
6366
runs-on: ubuntu-latest

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ yarn-error.log*
2525
# Ignore VS-code
2626
.vscode
2727

28-
# Cypress
29-
cypress/videos/*
30-
cypress/screenshots/*
31-
3228
# Temp files
3329
temp/
3430

@@ -38,3 +34,7 @@ json-server/
3834
public/config.json
3935
public/access-config.json
4036
public/release.json
37+
/test-results/
38+
/playwright-report/
39+
/blob-report/
40+
/playwright/.cache/

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#244](https://github.com/aroskanalen/display-admin-client/pull/1)
8+
- Migrate from Cypress to playwright
9+
710
- [#243](https://github.com/aroskanalen/display-admin-client/pull/2)
811
- Migrate from CRA to Vite
912
- Upgrade node from 14 -> 20

README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,20 @@ docker compose exec node npm --prefix src/redux/api install
6262
docker compose exec node npm --prefix src/redux/api start
6363
```
6464

65-
## Testing with cypress
65+
## Testing with playwright
6666

67-
We use [cypress](https://www.cypress.io/) for testing.
67+
We use [playwright](https://playwright.dev/) for testing.
6868

69-
To run cypress tests in the cypress container:
69+
To run playwright tests with docker:
7070

7171
```shell
72-
docker compose run --rm cypress run
72+
docker compose run --rm playwright npx playwright test
73+
```
74+
75+
To test with user interface, up the containers and change the baseUrl in playwright.config.ts, then:
76+
77+
```shell
78+
yarn playwright test --ui
7379
```
7480

7581
### Linting

cypress/fixtures/error.json

-6
This file was deleted.

cypress/fixtures/groups/group-successful.json

-20
This file was deleted.

cypress/fixtures/groups/groups.json

-146
This file was deleted.

0 commit comments

Comments
 (0)