diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba12867c85fc8699ace5e2a212f48b5d6dcdb500..3eec1d2657bcda2faac5ca05ed473cb8346f3799 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,27 +1,25 @@ stages: - test -variables: - npm_config_cache: "$CI_PROJECT_DIR/.npm" - CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress" + cache: key: ${CI_COMMIT_REF_SLUG} paths: - - .npm - - cache/Cypress - - node_modules + - node_modules/ + - .npm/ + test: image: cypress/browsers:node12.14.1-chrome85-ff81 stage: test script: - # install dependencies - - npm ci - # Kjør express-serveren i bakgrunnen - - npm start & - # Kjør testene - - npm test + # install dependencies + - npm ci + # start the server in the background + - npm run start:ci & + # run Cypress tests + - npm start artifacts: when: always paths: - - cypress/videos - - cypress/screenshots + - cypress/videos/**/*.mp4 + - cypress/screenshots/**/*.png expire_in: 1 day \ No newline at end of file diff --git a/.gitlab-cy.yml b/.gitlab-cy.yml index 5f7d4df6713ef5c9be5a19e63c381d47d6f18489..3eec1d2657bcda2faac5ca05ed473cb8346f3799 100644 --- a/.gitlab-cy.yml +++ b/.gitlab-cy.yml @@ -1,27 +1,25 @@ stages: - test -variables: - npm_config_cache: "$CI_PROJECT_DIR/.npm" - CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress" + cache: key: ${CI_COMMIT_REF_SLUG} paths: - - .npm - - cache/Cypress - - node_modules + - node_modules/ + - .npm/ + test: image: cypress/browsers:node12.14.1-chrome85-ff81 stage: test script: - # install dependencies - - npm ci - # Kjør express-serveren i bakgrunnen - - npm start & - # Kjør testene - - npm test + # install dependencies + - npm ci + # start the server in the background + - npm run start:ci & + # run Cypress tests + - npm start artifacts: when: always paths: - - cypress/videos - - cypress/screenshots - expire_in: 1 day \ No newline at end of file + - cypress/videos/**/*.mp4 + - cypress/screenshots/**/*.png + expire_in: 1 day \ No newline at end of file