# @see https://docs.cypress.io/guides/continuous-integration/gitlab-ci # Consult the results on the Cypress dashboard: https://dashboard.cypress.io/ stages: - build - test ## Set environment variables for folders in "cache" job settings for npm modules and Cypress binary variables: npm_config_cache: '$CI_PROJECT_DIR/.npm' CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress' cache: key: ${CI_COMMIT_REF_SLUG} paths: - .cache/* - cache/Cypress - node_modules - build ## Install NPM dependencies and Cypress install: image: cypress/browsers:node14.17.0-chrome88-ff89 stage: build script: - yarn install --dev - npx cypress cache path - npx cypress cache list chrome: image: cypress/browsers:node14.17.0-chrome88-ff89 stage: test script: - yarn dev:ci & npx wait-on http://localhost:3004 - yarn cypress:run --browser chrome artifacts: when: on_failure paths: - tests/cypress/videos/**/*.mp4 - tests/cypress/screenshots/**/*.png expire_in: 3 day chrome-mobile: image: cypress/browsers:node14.17.0-chrome88-ff89 stage: test script: - yarn dev:ci & npx wait-on http://localhost:3004 - yarn cypress:run --browser chrome --config "viewportWidth=375,viewportHeight=667" artifacts: when: on_failure paths: - tests/cypress/videos/**/*.mp4 - tests/cypress/screenshots/**/*.png expire_in: 3 day firefox: image: cypress/browsers:node14.17.0-chrome88-ff89 stage: test script: - yarn dev:ci & npx wait-on http://localhost:3004 - yarn cypress:run --browser firefox artifacts: when: on_failure paths: - tests/cypress/videos/**/*.mp4 - tests/cypress/screenshots/**/*.png expire_in: 3 day firefox-mobile: image: cypress/browsers:node14.17.0-chrome88-ff89 stage: test script: - yarn dev:ci & npx wait-on http://localhost:3004 - yarn cypress:run --browser firefox --config "viewportWidth=375,viewportHeight=667" artifacts: when: on_failure paths: - tests/cypress/videos/**/*.mp4 - tests/cypress/screenshots/**/*.png expire_in: 3 day