jeudi 28 janvier 2021

save screenshots in cypress by docker gitlab ci /cd

i used cypress for test restfull.

after screenshots save but not save !

Is there a way to save screenshots and videos? Or we can log. We could not get any results with

console.log ()
cy.log()
ct.console.log()

in gitlab-ci.ynml :

stages:
  - build
  - 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

install:
  image: cypress/base:10
  stage: build

  script:
    - npm ci
    - $(npm bin)/cypress cache path
    - $(npm bin)/cypress cache list
    - $(npm bin)/cypress verify

cypress-e2e:
  image: cypress/base:10
  stage: test
  script:
    - $(npm bin)/cypress run
  artifacts:
    expire_in: 1 week
    when: always
    paths:
    - cypress/screenshots
    - cypress/videos
    reports:
      junit:
        - results/TEST-*.xml

Aucun commentaire:

Enregistrer un commentaire