|
@@ -0,0 +1,61 @@
|
|
|
|
|
+# @see https://docs.cypress.io/guides/continuous-integration/gitlab-ci
|
|
|
|
|
+
|
|
|
|
|
+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 --frozen-lockfile
|
|
|
|
|
+ # check Cypress binary path and cached versions
|
|
|
|
|
+ - npx cypress cache path
|
|
|
|
|
+ - npx cypress cache list
|
|
|
|
|
+ - yarn build:ci
|
|
|
|
|
+
|
|
|
|
|
+ui-chrome:
|
|
|
|
|
+ image: cypress/browsers:node14.17.0-chrome88-ff89
|
|
|
|
|
+ stage: test
|
|
|
|
|
+ parallel: 5
|
|
|
|
|
+ script:
|
|
|
|
|
+ - yarn start:ci & npx wait-on http://localhost:3000
|
|
|
|
|
+ - npx cypress run --record --parallel --browser chrome --group "Chrome" --spec "test/cypress/integration/*"
|
|
|
|
|
+
|
|
|
|
|
+ui-chrome-mobile:
|
|
|
|
|
+ image: cypress/browsers:node14.17.0-chrome88-ff89
|
|
|
|
|
+ stage: test
|
|
|
|
|
+ parallel: 5
|
|
|
|
|
+ script:
|
|
|
|
|
+ - yarn start:ci & npx wait-on http://localhost:3000
|
|
|
|
|
+ - npx cypress run --record --parallel --browser chrome --group "Chrome - Mobile" --spec "test/cypress/integration/*" --config "viewportWidth=375,viewportHeight=667"
|
|
|
|
|
+
|
|
|
|
|
+ui-firefox:
|
|
|
|
|
+ image: cypress/browsers:node14.17.0-chrome88-ff89
|
|
|
|
|
+ stage: test
|
|
|
|
|
+ parallel: 5
|
|
|
|
|
+ script:
|
|
|
|
|
+ - yarn start:ci & npx wait-on http://localhost:3000
|
|
|
|
|
+ - npx cypress run --record --parallel --browser firefox --group "Firefox" --spec "test/cypress/integration/*"
|
|
|
|
|
+
|
|
|
|
|
+ui-firefox-mobile:
|
|
|
|
|
+ image: cypress/browsers:node14.17.0-chrome88-ff89
|
|
|
|
|
+ stage: test
|
|
|
|
|
+ parallel: 5
|
|
|
|
|
+ script:
|
|
|
|
|
+ - yarn start:ci & npx wait-on http://localhost:3000
|
|
|
|
|
+ - npx cypress run --record --parallel --browser firefox --group "Firefox - Mobile" --spec "test/cypress/integration/*" --config "viewportWidth=375,viewportHeight=667"
|