Testing with Cypress and performing API and UI tests.
This is done by creating a cypress docker image and running against the target application.
This creates an allure report in the end.
version: '1.0'
steps:
build_image:
type: build
title: Building image...
working_directory: ${{main_clone}}
dockerfile: docker/Dockerfile
image_name: test/cypresspoc
tag: '${{CF_BRANCH_TAG_NORMALIZED}}'
no_cache: true
run_tests:
title: Running tests...
image: ${{build_image}}
working_directory: ${{main_clone}}
fail_fast: false
commands:
- npm install
- npm run api-test-web
copy_reports:
title: Copying Allure results...
image: ${{build_image}}
working_directory: ${{main_clone}}
commands:
- cp -r -f ./allure-results $CF_VOLUME_PATH/allure-results
generate_reports:
title: Generating reports...
image: codefresh/cf-docker-test-reporting
working_directory: /codefresh/volume
environment:
- BUCKET_NAME=cypress_poc
- CF_STORAGE_INTEGRATION=google
mark_status:
title: Marking build based on test results...
image: ${{build_image}}
commands:
- echo "Cypress tests failed, please see report."
- exit 1
when:
condition:
all:
myCondition: run_tests.result == 'failure'