Skip to content

Commit

Permalink
Playwright tester i PSB (v2) (#1859)
Browse files Browse the repository at this point in the history
  • Loading branch information
frodehansen2 committed Jun 5, 2024
1 parent 35d7f70 commit 4c15275
Show file tree
Hide file tree
Showing 64 changed files with 1,264 additions and 2,507 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-pots-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@navikt/pleiepenger-sykt-barn': minor
---

Erstatte cypress med playwright
37 changes: 14 additions & 23 deletions .github/workflows/test.pleiepenger-sykt-barn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand All @@ -43,7 +42,8 @@ jobs:
- name: Run code tests
run: yarn test --filter=pleiepenger-sykt-barn

run-cypress-test:
run-playwright-test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -55,31 +55,22 @@ jobs:
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Build and start e2e server
uses: cypress-io/github-action@v6.7.0
env:
DEKORATOR_URL: https://www.nav.no/dekoratoren/?simple=true&chatbot=false
PUBLIC_PATH: /familie/sykdom-i-familien/soknad/pleiepenger
FRONTEND_API_PATH: http://localhost:8082/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
project: ./apps/pleiepenger-sykt-barn/e2e
build: yarn turbo run build --filter=@navikt/pleiepenger-sykt-barn
start: yarn turbo start-e2e-server --filter=pleiepenger-sykt-barn
wait-on: 'http://localhost:8080'
wait-on-timeout: 60
runTests: false
- name: Install dependencies
run: yarn

- name: Run cypress tests
run: yarn turbo cypress-run --filter=pleiepenger-sykt-barn
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps

- name: Build application
run: yarn build --filter=pleiepenger-sykt-barn

- name: Run tests
run: yarn turbo playwright-test --filter=pleiepenger-sykt-barn
2 changes: 1 addition & 1 deletion apps/pleiepenger-sykt-barn/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ API_URL=http://localhost:8089
APP_VERSION=dev
APPSTATUS_DATASET=staging
APPSTATUS_PROJECT_ID=ryujtq87
CYPRESS_ENV=false
DEKORATOR_URL=https://www.nav.no/dekoratoren/?simple=true&chatbot=false
FRONTEND_API_PATH=http://localhost:8089/
FRONTEND_INNSYN_API_PATH=http://localhost:8089/
Expand All @@ -13,3 +12,4 @@ LOGIN_URL=http://localhost:8081/auth-mock/cookie?subject=mockSubject&redirect_lo
MIN_SIDE_URL=https://www.intern.dev.nav.no/minside
NODE_ENV=development
PUBLIC_PATH=/familie/sykdom-i-familien/soknad/pleiepenger
USE_AMPLITUDE=false
2 changes: 2 additions & 0 deletions apps/pleiepenger-sykt-barn/api-mock/mock-server.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ const privatArbeidsgiverMock = {
ansattFom: '2021-01-01',
ansattTom: '2021-12-31',
};

const frilansoppdrag = {
type: 'type oppdrag',
organisasjonsnummer: '991012133',
navn: 'Hurdal frilanssenter',
ansattFom: '2022-01-01',
ansattTom: '2022-01-15',
};

const frilansoppdrag2 = {
type: 'type oppdrag',
organisasjonsnummer: '991012134',
Expand Down
12 changes: 0 additions & 12 deletions apps/pleiepenger-sykt-barn/e2e/cypress.config.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions apps/pleiepenger-sykt-barn/e2e/cypress/fixtures/example.json

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4c15275

Please sign in to comment.