diff --git a/scripts/ci/run-tests.sh b/scripts/ci/run-tests.sh index 09e09d51f..4f25cbdbd 100755 --- a/scripts/ci/run-tests.sh +++ b/scripts/ci/run-tests.sh @@ -12,6 +12,7 @@ function main { start_database build_and_test_frontend build_and_test_jar + run_cypress_tests } function install_npm_dependencies { @@ -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 "$@" \ No newline at end of file