找不到 Cypress 测试运行结果

bai*_*idz 5 vue.js cypress github-actions

我通过创建了一个新的 Vue 项目npm init vue@latest并选择了 Cypress。

目前还没有测试,我有一个占位符/cypress/e2e/example.cy.ts测试

describe("My First Test", () => {
  it("visits the app root url", () => {
    cy.visit("/");
  });
});
Run Code Online (Sandbox Code Playgroud)

我正在使用 Cypress v11.0.1,并且有一个脚本可以在我的 Github Actions 中运行 cypress 测试

"test:e2e:ci": "start-server-and-test preview :4173 'cypress run --e2e'",
Run Code Online (Sandbox Code Playgroud)

这是我的 Cypress 动作

  - name: Check if e2e tests are passing
    uses: cypress-io/github-action@v4
    with:
      build: npm run build
      start: npm run test:e2e:ci
Run Code Online (Sandbox Code Playgroud)

有时(这种情况很少发生) Github 工作流程会失败

在此输入图像描述

正如您所看到的,测试本身通过了。我可以通过再次运行来修复管道......

有人知道为什么会发生这种情况以及如何避免此错误?

如果您需要更多信息(例如配置文件),请告诉我