【发布时间】:2020-07-03 09:01:03
【问题描述】:
我目前正在尝试使用他们的 CI/CD 平台在 Gitlab 上运行我的 E2E 测试。
我目前的问题是我的开发服务器和 cypress 不能同时运行,以便 E2E 测试可以运行。
这是我当前的.gitlab-ci.yml 文件:
image: node
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
stages:
- setup
- test
setup:
stage: setup
image: cypress/base:10
script:
- npm ci
# check Cypress binary path and cached versions
# useful to make sure we are not carrying around old versions
- npx cypress cache path
- npx cypress cache list
cypress:
stage: test
image: cypress/base:10
script:
# I need to start a dev server here in the background
- cypress run --record --key <my_key> --parallel
artifacts:
when: always
paths:
- cypress/videos/**/*.mp4
- cypress/screenshots/**/*.png
expire_in: 7 day
【问题讨论】:
标签: vue.js continuous-integration gitlab gitlab-ci cypress