GVKun编程网logo

使用 MSSQL 运行 Cypress - 超时(sqoop mysql超时)

3

对于想了解使用MSSQL运行Cypress-超时的读者,本文将提供新的信息,我们将详细介绍sqoopmysql超时,并且为您提供关于@cypress/code-coverage无法解析'../self

对于想了解使用 MSSQL 运行 Cypress - 超时的读者,本文将提供新的信息,我们将详细介绍sqoop mysql超时,并且为您提供关于@ cypress / code-coverage无法解析'../self-coverage-helper'@cypress、BrowserStack cypress Run > cypress-cucumber-preprocessor 依赖关系图 + cypress 文件夹出错、Cypress - 新测试文件未显示在 cypress UI 中、Cypress - 无法在 chrome/Firefox 上运行 cypress runner,但可以在我的工作笔记本电脑上运行的有价值信息。

本文目录一览:

使用 MSSQL 运行 Cypress - 超时(sqoop mysql超时)

使用 MSSQL 运行 Cypress - 超时(sqoop mysql超时)

我想在运行我的测试用例之前清理一个数据库,但我只是在运行它时遇到了问题。它只是超时,我不明白 - 希望你能帮助我:)

在测试用例中,我有以下代码块:

beforeEach(() => {
      cy.task("cleanUpDB",{
        sql:"UPDATE SQL GOES HERE"
      })

然后转到我的 cypress.config 文件并执行以下命令:

on("task",{
        cleanUpDB({ theQuery }) {
          return new Promise(async(resolve,reject) => {
            try{
              await sql.connect(DBConfig)
            const result = await sql.query(theQuery);
            console.log(result)
            return resolve(result);
          }
          catch (err) {
              // ... error checks
             }
          }
          )
        }
      })

这是我在测试运行器中遇到的错误:

@ cypress / code-coverage无法解析'../self-coverage-helper'@cypress

@ cypress / code-coverage无法解析'../self-coverage-helper'@cypress

如何解决@ cypress / code-coverage无法解析''../self-coverage-helper''@cypress

我尝试在cypress的index.js中运行require(''@ cypress / code-coverage / task'')。

Module not found: Error: Can''t resolve ''../self-coverage-helper'' in ''C:\\repo\\patientstrength_codecover\\node_modules\\@cypress\\code-coverage\\node_modules\\nyc''

在这里完全迷路了。 Package.json:

   "nyc": "^15.1.0","cypress": "^5.0.0","cypress-istanbul": "^1.3.0","cypress-localstorage-commands": "^1.2.2","cypress-multi-reporters": "^1.2.4","@cypress/code-coverage": "^3.8.1","@babel/core": "^7.11.4","@babel/plugin-Syntax-dynamic-import": "^7.8.3","@babel/plugin-Syntax-jsx": "^7.10.4","@babel/preset-env": "^7.11.0","@babel/preset-react": "^7.10.4",

解决方法

问题是我们正在使用带有基本脚本(例如gulp,jest和well)的“ root” package.json-我们也尝试从该root运行cypress。除了覆盖范围外,它还可以正常工作。

所以我们有:

  • /git/root/package.json
  • /git/root/solution1/package.json
  • /git/root/solution2/package.json

我们通过在/git/root/solution1/package.json和/git/root/solution2/package.json解决方案中首先简单地安装cypress和所有依赖项(!)来解决了该问题。不在/git/root/package.json中。

/git/root/package.json现在仅包含调用2 cypress安装的脚本。然后我们合并结果。确保有冗余

调用脚本如下:

"test:client1": "cd client1 && cd ClientApp && npm run coverage"

非常简单的方法。我们无法解决的是关于赛普拉斯配置和命令的冗余。可以优化。

BrowserStack cypress Run > cypress-cucumber-preprocessor 依赖关系图 + cypress 文件夹出错

BrowserStack cypress Run > cypress-cucumber-preprocessor 依赖关系图 + cypress 文件夹出错

如何解决BrowserStack cypress Run > cypress-cucumber-preprocessor 依赖关系图 + cypress 文件夹出错

使用 cypress 启动测试到浏览器堆栈时

目前,通过在我的开发环境 (ubuntu) 上运行命令进行调试

  1. npm run browserstack
  2. it calls the script from package.json "browserstack": "./node_modules/.bin/browserstack-cypress run --sync"

我的功能日志执行在浏览器构建仪表板中显示以下错误

  1. Running: features\\desktop.feature (NaN of undefined)
  2. Oops...we found an error preparing this test file:
  3. cypress\\integration\\features\\desktop.feature
  4. The error was:
  5. Error: Can''t walk dependency graph: Cannot find module ''C:Usershellodocumentsdocumentscypress_testcypress_test_folder
  6. ode_modulescypress-cucumber-preprocessorlib
  7. esolveStepDeFinition'' from ''cypress_test_folder\\cypress\\integration\\features''
  8. required by cypress_test_folder\\cypress\\integration\\features\\desktop.feature
  9. at cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:46:17
  10. at process (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:173:43)
  11. at ondir (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:188:17)
  12. at load (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:69:43)
  13. at onex (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:92:31)
  14. at cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:22:47
  15. at callback (C:\\Windows\\cypress_package\\6.8.0\\node_modules\\graceful-fs\\polyfills.js:289:20)
  16. at FSReqCallback.oncomplete (fs.js:172:21)
  17. This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
  18. - A missing file or dependency
  19. - A Syntax error in the file or one of its dependencies
  20. Fix the error in your code and re-run your tests.
  21. (Results)
  22. ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  23. │ Tests: 0 │
  24. │ Passing: 0 │
  25. │ Failing: 1 │
  26. │ Pending: 0 │
  27. │ Skipped: 0 │
  28. │ Screenshots: 0 │
  29. │ Video: false │
  30. │ Duration: 0 seconds │
  31. │ Spec Ran: features\\desktop.feature │
  32. └────────────────────────────────────────────────────────────────────────────────────────────────┘
  33. (Uploading Results)
  34. - nothing to Upload

我的 browserstack.json 如下

  1. {
  2. "auth": {
  3. "username": "<username>","access_key": "<access_key>"
  4. },"browsers": [
  5. {
  6. "os": "Windows 10","browser": "chrome","versions": ["latest"]
  7. }
  8. ],"run_settings": {
  9. "cypress_version" : "6","cypress_config_file": "./cypress.json","project_name": "myproject","build_name": "ui-automation","specs": ["cypress/integration/features/desktop.feature","cypress/integration/features/desktop/desktop.js"],"exclude": [],"parallels": "Here goes the number of parallels you want to run","npm_dependencies": {
  10. "cypress-cucumber-preprocessor": "^1.19.2","browserstack-cypress-cli": "^1.8.1","cypress": "^3.8.3","cypress-xpath": "^1.6.2"
  11. },"package_config_options": {
  12. "cypress_options": {
  13. "testFiles": "**/*.feature","ignoreTestFiles": "*.js","chromeWebSecurity": false
  14. },"cypress-cucumber-preprocessor_options": {
  15. "nonGlobalStepDeFinitions": true,"step_deFinitions": "cypress/integration/features/dekstop/"
  16. }
  17. },"headless": false
  18. },"connection_settings": {
  19. "local": false,"local_identifier": null,"local_mode": null,"local_config_file": null
  20. },"disable_usage_reporting": false
  21. }

按照开始指南和任何其他提示,我没有发现发生了什么,尤其是在浏览器堆栈日志中,它试图找到一个带有 Windows 路径的模块,而我所有的测试环境都在 linux ubuntu 上 > 我的目标接下来在 gitlab 上运行所有这些

解决方法

能否在broserstack.json https://www.browserstack.com/docs/automate/cypress/npm-packages 你可以参考这里的黄瓜丝柏样品:https://github.com/ashwingonsalves/cypress-browserstack-cucumber

Cypress - 新测试文件未显示在 cypress UI 中

Cypress - 新测试文件未显示在 cypress UI 中

如何解决Cypress - 新测试文件未显示在 cypress UI 中

在赛普拉斯文件夹 integration 中创建新测试文件未显示在赛普拉斯 UI 中。 在这个打印屏幕中,我创建了一个名为:NewTest.spec.js(绿色)的新文件。它没有在 Cypress 中显示。

它曾经工作过

解决方法

如果您在 cypress.json 文件中定义了 testFiles 列表,Cypress 将不会包含在集成文件夹中找到的所有规范文件,而是使用该列表来填充套件。

因此,检查 cypress.json 并将新的规范文件添加到顺序中的适当位置。

"testFiles": [
     "FirstTest.spec.js","NewTest.spec.js","ThirdTest.spec.js"
]

Cypress - 无法在 chrome/Firefox 上运行 cypress runner,但可以在我的工作笔记本电脑上运行

Cypress - 无法在 chrome/Firefox 上运行 cypress runner,但可以在我的工作笔记本电脑上运行

如何解决Cypress - 无法在 chrome/Firefox 上运行 cypress runner,但可以在我的工作笔记本电脑上运行

这是我在启动 chrome 时得到的堆栈跟踪信息:Cypress 版本是 7.3。:

标题:启动浏览器时出错

消息:赛普拉斯在重试 50 秒后未能连接到 Chrome DevTools 协议。

这通常表示打开 Chrome 浏览器时出现问题。

请求的 CDP 端口是 29079。

错误详情:

错误:连接 ECONNREFUSED 127.0.0.1:29079 在 TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

堆栈跟踪:

  1. Error: Cypress Failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.
  2. This usually indicates there was a problem opening the Chrome browser.
  3. The CDP port requested was [33m29079[39m.
  4. Error details:
  5. Error: connect ECONNREFUSED 127.0.0.1:29079
  6. at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
  7. at get (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\lib\\errors.js:988:15)
  8. at Object.throwErr [as throw] (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\lib\\errors.js:1006:9)
  9. at C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\lib\\browsers\\protocol.js:106:21
  10. at tryCatcher (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\util.js:16:23)
  11. at Promise._settlePromiseFromHandler (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\promise.js:547:31)
  12. at Promise._settlePromise (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\promise.js:604:18)
  13. at Promise._settlePromise0 (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\promise.js:649:10)
  14. at Promise._settlePromises (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\promise.js:725:18)
  15. at _drainQueueStep (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\async.js:93:12)
  16. at _drainQueue (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\async.js:86:9)
  17. at Async._drainQueues (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\async.js:102:5)
  18. at Immediate.Async.drainQueues [as _onImmediate] (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\bluebird\\js\\release\\async.js:15:14)
  19. at processImmediate (internal/timers.js:461:21)

我已经与支持团队交谈过,他们目前没有任何协议可以阻止 cypress 启动 chrome。我还查看了堆栈溢出中的早期解决方案,您可以在其中进入 ext/files 以注释掉 localhost 地址,但仍然无济于事。有人可以帮忙吗??

今天关于使用 MSSQL 运行 Cypress - 超时sqoop mysql超时的分享就到这里,希望大家有所收获,若想了解更多关于@ cypress / code-coverage无法解析'../self-coverage-helper'@cypress、BrowserStack cypress Run > cypress-cucumber-preprocessor 依赖关系图 + cypress 文件夹出错、Cypress - 新测试文件未显示在 cypress UI 中、Cypress - 无法在 chrome/Firefox 上运行 cypress runner,但可以在我的工作笔记本电脑上运行等相关知识,可以在本站进行查询。

本文标签: