From f53b7791d1d678bc2facda5d19d208f7281b85c2 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 10 May 2023 10:31:25 +0200 Subject: [PATCH] Add component tests to pipeline --- bitbucket-pipelines.yml | 18 ++++++++++++++++-- client/package.json | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 57966829..5d4d076a 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -74,7 +74,6 @@ definitions: - npm ci --prefix client - npm run "install:cypress" --prefix client - npm run dev --prefix client 2>&1 > /dev/null & - - sleep 30 - curl http://localhost:8080/beta-login - npm run --prefix client test:cypress:frontend - &frontend-test-parallel @@ -91,9 +90,24 @@ definitions: - npm ci --prefix client - npm run "install:cypress" --prefix client - npm run dev --prefix client 2>&1 > /dev/null & - - sleep 30 - curl http://localhost:8080/beta-login - npm run --prefix client currents + - &component-test + name: run cypress frontend tests + caches: + - node + - clientmodules + - npm + - cypress + artifacts: + - client/cypress/**/*.png + - client/cypress/**/*.mp4 + script: + - npm ci --prefix client + - npm run "install:cypress" --prefix client + - npm run dev --prefix client 2>&1 > /dev/null & + - curl http://localhost:8080/beta-login + - npm run --prefix client cypress:component:test - &jest-test name: run jest tests caches: diff --git a/client/package.json b/client/package.json index e451fcd1..9398f0b7 100644 --- a/client/package.json +++ b/client/package.json @@ -18,10 +18,12 @@ "open:cypress:frontend": "npm run cypress:frontend:open", "test:cypress:e2e": "npm run cypress:e2e:test", "test:cypress:frontend": "npm run cypress:frontend:test", + "test:cypress:component": "npm run cypress:component:test", "cypress:e2e:open": "cypress open --config-file cypress.e2e.ts", "cypress:frontend:open": "cypress open --config-file cypress.frontend.ts", "cypress:e2e:test": "cypress run --config-file cypress.e2e.ts", "cypress:frontend:test": "cypress run --config-file cypress.frontend.ts", + "cypress:component:test": "cypress run --config-file cypress.frontend.ts --component", "install:cypress": "cypress install", "test:unit": "jest", "cypress:parallel": "CYPRESS_API_URL=\"https://iterativ-cypress-director.herokuapp.com/\" cy2 run --parallel --record --key somekey --config-file cypress.frontend.json --ci-build-id some-id",