Cypress 我们如何从`.cirlceci/config.yml`文件中调用package.json中给出的`cy:testflight`

Cypress 我们如何从`.cirlceci/config.yml`文件中调用package.json中给出的`cy:testflight`,cypress,circleci,Cypress,Circleci,对于我的CircleciCI/CD管道中的cypress测试,如何从.cirlceci/config.yml调用Package.json文件的scripts部分下给出的命令cy:test flight。另外,我想设置以下参数record true,并将parallel设置为3。有人能建议如何使用.cirlceci/config.yml Package.json "scripts": { "cy:run": "cypress run", "get-token-flight": "n

对于我的
Circleci
CI/CD管道中的cypress测试,如何从
.cirlceci/config.yml
调用Package.json文件的scripts部分下给出的命令
cy:test flight
。另外,我想设置以下参数
record true
,并将parallel设置为3。有人能建议如何使用
.cirlceci/config.yml

Package.json

"scripts": {
    "cy:run": "cypress run",
    "get-token-flight": "node get-token.js && mv tokenData.json cypress/fixtures && mv cookies.json cypress/fixtures",
    "cy:open:flight": "npm run get-token-flight && cypress open",
    "cy:test-flight": "set CYPRESS_RETRIES=2 && npm run get-token-flight && cypress run --record --key <key-here> cypress --env configFile=flight-app --browser chrome"
  }

下面是我的
圆圈.yml
的一个示例:

version: 2.1
jobs:
  test:
    docker:
    - image: cypress/base:10
    steps:
    - checkout
    - restore_cache:
        keys:
        - cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
    - run:
        name: Yarn install
        command: yarn install --frozen-lockfile
    - save_cache:
        key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
        paths:
        - ~/.cache
    - run:
        command: yarn lint
    - run:
        command: yarn test
    - run:
        command: yarn test-e2e
    - run:
        command: yarn run semantic-release
workflows:
  build:
    jobs:
    - test
  version: 2

因此,您可以将
纱线测试-e2e
替换为
npm run cy:test flight


另外,这里有一组使用cypress orb的示例

谢谢..我没有分支版本..所以我应该在下面的
-cache-{{arch}}-{.Master}-{{checksum”package.json}中添加Master而不是branch
如何在config.yml中添加
记录
Parralel=3
。下面是一组使用cypress orb的示例
version: 2.1
jobs:
  test:
    docker:
    - image: cypress/base:10
    steps:
    - checkout
    - restore_cache:
        keys:
        - cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
    - run:
        name: Yarn install
        command: yarn install --frozen-lockfile
    - save_cache:
        key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
        paths:
        - ~/.cache
    - run:
        command: yarn lint
    - run:
        command: yarn test
    - run:
        command: yarn test-e2e
    - run:
        command: yarn run semantic-release
workflows:
  build:
    jobs:
    - test
  version: 2