简体   繁体   English

NX Cypress 在 GitHub 操作上运行两次

[英]NX Cypress run twice on the GitHub Action

I am using NX 14.5.1 and cypress 10.2.0.我正在使用 NX 14.5.1 和 cypress 10.2.0。 When I run e2e tests on GitHub actions, my tests always run twice.当我对 GitHub 操作运行 e2e 测试时,我的测试总是运行两次。 Sometimes one of them causes an error.有时其中一个会导致错误。

This is my github workflow:这是我的 github 工作流程:

jobs:
  continuous_integration:
    runs-on: ubuntu-latest
    timeout-minutes: 45
    strategy:
      fail-fast: false
      matrix:
      # run copies of the current job in parallel
      containers: [1, 2, 3, 4, 5]
    steps:
      - name: 🏁 Checkout Repo
        uses: actions/checkout@v3
  
      - name: 🏁 Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: 'npm'

      - name: Install Firebase Emulator Suite
        run: npm install -g firebase-tools@9.20.0

      - name: 💾 Install Dependencies
        run: npm ci

      - name: ✅ E2E Tests
        uses: cypress-io/github-action@v4
        with:
          install: false
          start: |
            npm run e2e:firebase
            npm run e2e
          wait-on: http://localhost:4200
          wait-on-timeout: 120
          working-directory: apps/e2e
          record: true
          parallel: true
        env:
          FIREBASE_TOKEN: '${{ secrets.NX_FIREBASE_TOKEN }}'

And the result is like this result e2e test on GitHub Action结果就像GitHub 上的结果 e2e 测试

✓ should go to My Cards page (5043ms)
✓ should open Paint Point modal (3831ms)
✓ should open Insight modal (3323ms)
✓ should open Idea modal (2591ms)
(Attempt 1 of 3) should go to My Cards page
✓ should go to My Cards page (2328ms)
✓ should open Paint Point modal (1978ms)
✓ should open Insight modal (2302ms)
✓ should open Idea modal (2245ms)
✓ should create Paint Point card (4321ms)
(Attempt 1 of 3) should create Paint Point card
✓ should create Insight card (7147ms)
✓ should create Idea card (8727ms)
✓ should create Paint Point card (13580ms)
✓ should show modal from header create button (7298ms)

Do I miss a GitHub workflow configuration here?我在这里错过了 GitHub 工作流程配置吗?

I think that's because you will need to split the workflow into 2 jobs as describe here .我认为这是因为您需要将工作流程拆分为 2 个作业,如此处所述

Also you would need to make sure you are using their container image as mentioned Here此外,您还需要确保您使用的是这里提到的他们的容器图像

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 赛普拉斯 Github 操作在运行期间引发错误 - Cypress Github action throwing an error during run Github Action Cypress Run 在测试错误时静默失败 - Github Action Cypress Run silently fails on test errors GitHub Action [cypress CI 集成]:如何在运行 cypress run 命令之前设置 env 变量 - GitHub Action [cypress CI integration ]: How to set env variables before running cypress run command 如何在 nrwl nx 工作区中使用标签运行 cypress 测试 - How to run cypress tests with tags in nrwl nx workspace 如何在 github 操作上设置计划的柏树测试以仅运行一个规范文件? - How to set up a scheduled cypress test on github action to run one spec file only? 如何使用 GitHub 操作将环境变量发送到赛普拉斯? - How to send env vars to Cypress using GitHub action? 赛普拉斯未在 ci SyntaxError 中运行:使用 cypress-io/github-action@v2 typescript 的意外令牌“导出” - Cypress is not running in ci SyntaxError: Unexpected token 'export' with cypress-io/github-action@v2 typescript 在 Github 中重新运行赛普拉斯测试 操作不起作用 - Re-run Cypress test in Github Actions does not work 如何在 GitHub 操作上使用 Cypress CI 运行和连接到仿真器? - How to Run & Connect to Emulators with Cypress CI on GitHub Actions? 尝试运行 nx.dev e2e 测试时出现错误“找不到模块‘cypress/package.json’” - Trying to run nx.dev e2e tests I get the error "Cannot find module 'cypress/package.json'"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM