【问题标题】:Cypress Testing: stuck at wait-on http://localhost:3000赛普拉斯测试:卡在等待 http://localhost:3000
【发布时间】:2021-08-06 23:25:37
【问题描述】:

我正在使用 circleci 运行 cypress

workflows:
  version: 2.1
  test_and_release:
    jobs:
      - cypress/run:
          working_directory: cats-client
          start: npm start
          wait-on: 'http://localhost:3000'
          filters:
            tags:
              only: /v?\d+\.\d+(\.\d+)?/
            branches:
              only: /.*/

但它很糟糕等待命令

====>> Persisting to Workspace (skipped)
Warning: skipping this step: Missing workflow workspace identifiers, this step must be run in the context of a workflow
====>> Start
  #!/bin/bash -eo pipefail
npm start
====>> Wait-on http://localhost:3000
  #!/bin/bash -eo pipefail
npx wait-on http://localhost:3000
npx: installed 13 in 3.256s
Error: 
Too long with no output (exceeded 10m0s): context deadline exceeded

Step timedout
Error: runner failed (exited with 101)
Task failed
Error: task failed

我试图解决这个问题降级react-scripts --> 3.4.0

https://github.com/facebook/create-react-app/issues/8688#issuecomment-602678446

但还是同样的问题

【问题讨论】:

  • 在本地运行npm start会得到什么?
  • 它工作得很好,当我在本地尝试该命令时 npm start & node_modules/.bin/cypress 运行它的工作
  • 可以在本地试试npm start & wait-on http://localhost:3000 && node_modules/.bin/cypress run吗?
  • 是的,这个命令在本地工作

标签: reactjs cypress circleci


【解决方案1】:

该问题与 react-scripts 相关,已通过从 3.4.3 升级到 4.0.3 得到修复

npm install --save --save-exact react-scripts@4.0.3

参考:https://github.com/facebook/create-react-app/blob/main/CHANGELOG.md

您需要删除 package-lock.json + node_modules 文件夹

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-25
    • 1970-01-01
    • 2022-10-02
    • 1970-01-01
    • 1970-01-01
    • 2023-02-14
    • 2021-11-06
    相关资源
    最近更新 更多