Skip to content

Commit

Permalink
OPHYK-212 Run cypress tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rce committed Dec 9, 2024
1 parent 08933e9 commit 5f78f47
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/ci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function main {
start_database
build_and_test_frontend
build_and_test_jar
run_cypress_tests
}

function install_npm_dependencies {
Expand Down Expand Up @@ -46,4 +47,25 @@ function build_and_test_jar {
./gradlew clean build
}

function run_cypress_tests {
cd "${repo}/mock-api" && npm run mock-api &
cd "${repo}/organisaatio-ui" && npm run start &
cd "${repo}"
java -jar -Xms2g -Xmx2g \
-Dspring.config.location=classpath:application.properties,classpath:application-test-envs.properties \
-Dspring.profiles.active=dev \
-Dspring.flyway.enabled=true \
-Durl-virkailija=http://localhost:9000 \
-Dhost.virkailija=localhost:9000 \
-Durl-ytj=http://localhost:9000/ytj \
-Durl-oidservice=http://localhost:9000/oidservice \
-Dcas.service.organisaatio-service=http://localhost:8080/organisaatio-service-not-available \
organisaatio-service/build/libs/organisaatio-service.jar &

cd "${repo}/organisaatio-ui"
npm run cypress:ci

kill $( jobs -p || true )
}

main "$@"

0 comments on commit 5f78f47

Please sign in to comment.