Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cypress to playwright migration #3513

Merged
merged 26 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1fcd6f4
Begynt på migrering fra Cypress til Playwright
stigus Jun 3, 2024
ee5843f
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 3, 2024
9edad99
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 4, 2024
3ee33b8
Mer playwright oppsett og mocking
stigus Jun 4, 2024
ae15a1c
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 5, 2024
1386282
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 10, 2024
418fea5
update
stigus Jun 10, 2024
252340f
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 10, 2024
1ae5cfd
Endret frontend oppsett til å støtte playwright og refaktorert en god…
stigus Jun 12, 2024
f20251a
Lagt til playwright tester og refaktorert alle referanser fra cypress…
stigus Jun 13, 2024
597aaab
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 13, 2024
0c1d365
Fjernet alt Cypress oppsett og migrert siste rest over til playwright
stigus Jun 13, 2024
3f6ed5e
Fikset feilende Test-Norge.spec.ts test
stigus Jun 13, 2024
4b76bc5
Fix playwright deploy
stigus Jun 13, 2024
feac5cb
Fix playwright deploy
stigus Jun 13, 2024
996fc32
Fix playwright deploy
stigus Jun 13, 2024
76a094a
Mindre endringer playwright
stigus Jun 13, 2024
b468604
Setter opp sharding for playwright github actions
stigus Jun 13, 2024
0a11e36
Setter opp sharding for playwright github actions
stigus Jun 13, 2024
aebc002
Mindre endringer for playwright CI oppsett
stigus Jun 13, 2024
c29c183
Mindre endringer for playwright CI oppsett
stigus Jun 13, 2024
8de8cb2
* Mindre endringer på playwright test og oppdatering.
stigus Jun 14, 2024
f471ded
* Readme skrivefeil
stigus Jun 14, 2024
5d9a944
Merge branch 'master' into feature/cypress-to-playwright-migration
stigus Jun 14, 2024
2f1206b
Merge branch 'refs/heads/master' into feature/cypress-to-playwright-m…
stigus Jun 17, 2024
8f32442
Merge og update
stigus Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/app.dolly-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ on:
- libs/security-core
- apps/dolly-frontend/**
- .github/workflows/app.dolly-frontend.yml
- .github/workflows/common.cypress.yml
- .github/workflows/common.playwright.yml

jobs:

cypress:
uses: ./.github/workflows/common.cypress.yml
playwright:
uses: ./.github/workflows/common.playwright.yml
with:
working-directory: "apps/dolly-frontend"
secrets:
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/common.cypress.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/common.playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Playwright Tests
on:
workflow_call:
inputs:
working-directory:
type: string
description: "The working directory for the job, e.g. apps/dolly-frontend (without leading/trailing slash)."
required: true
secrets:
READER_TOKEN:
required: true
jobs:
playwright-tests:
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [ 1, 2, 3, 4, 5 ]
shardTotal: [ 5 ]
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://npm.pkg.github.com/
scope: "@navikt"
- name: Install dependencies
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npm ci
- name: Install Playwright Browsers
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npx playwright install --with-deps
- name: Run Playwright tests
working-directory: ${{ inputs.working-directory }}/src/main/js
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
23 changes: 23 additions & 0 deletions apps/dolly-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,26 @@ Deretter må du fjerne "local" fra profiles i LocalConfig og legge til "local" i
dette tilbake
før noe pushes til master). Etter dette kan du kjøre applikasjonen som beskrevet i JavaScript.

### Playwright - E2E testing

Playwright brukes til å teste mesteparten av funksjonaliteten i Dolly ved kodeendringer.

Dersom en eller flere av de tre nettleserne som Playwright utfører tester på mangler (Chrome, Firefox og Edge), kjør:

```
sudo npx playwright install msedge
sudo npx playwright install firefox
sudo npx playwright install chrome
```

Deretter kan testene kjøres med kommandoen:

```
npm run test:playwright-run
```

For debugging av testene og utvikling av nye tester brukes:

```
npm run test:playwright-dev
```
9 changes: 5 additions & 4 deletions apps/dolly-frontend/src/main/js/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ stats.json
# Code counter extension
/.VSCodeCounter

# Cypress
/cypress/videos/
/cypress/screenshots/
/cypress/downloads/
# Playwright
/test-results/
/blob-report/
/playwright-report/
/playwright/.cache/
28 changes: 0 additions & 28 deletions apps/dolly-frontend/src/main/js/cypress.config.ts

This file was deleted.

This file was deleted.

This file was deleted.

32 changes: 0 additions & 32 deletions apps/dolly-frontend/src/main/js/cypress/e2e/DollySoek.cy.ts

This file was deleted.

This file was deleted.

67 changes: 0 additions & 67 deletions apps/dolly-frontend/src/main/js/cypress/e2e/Gruppe.cy.ts

This file was deleted.

83 changes: 0 additions & 83 deletions apps/dolly-frontend/src/main/js/cypress/e2e/GruppeHeader.cy.ts

This file was deleted.

Loading