对于想了解使用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超时)
- @ 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超时)
我想在运行我的测试用例之前清理一个数据库,但我只是在运行它时遇到了问题。它只是超时,我不明白 - 希望你能帮助我:)
在测试用例中,我有以下代码块:
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的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 文件夹出错
使用 cypress 启动测试到浏览器堆栈时
目前,通过在我的开发环境 (ubuntu) 上运行命令进行调试
npm run browserstack
it calls the script from package.json "browserstack": "./node_modules/.bin/browserstack-cypress run --sync"
我的功能日志执行在浏览器构建仪表板中显示以下错误
Running: features\\desktop.feature (NaN of undefined)
Oops...we found an error preparing this test file:
cypress\\integration\\features\\desktop.feature
The error was:
Error: Can''t walk dependency graph: Cannot find module ''C:Usershellodocumentsdocumentscypress_testcypress_test_folder
ode_modulescypress-cucumber-preprocessorlib
esolveStepDeFinition'' from ''cypress_test_folder\\cypress\\integration\\features''
required by cypress_test_folder\\cypress\\integration\\features\\desktop.feature
at cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:46:17
at process (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:173:43)
at ondir (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:188:17)
at load (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:69:43)
at onex (cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:92:31)
at cypress_test_folder\\node_modules\\browser-resolve\\node_modules\\resolve\\lib\\async.js:22:47
at callback (C:\\Windows\\cypress_package\\6.8.0\\node_modules\\graceful-fs\\polyfills.js:289:20)
at FSReqCallback.oncomplete (fs.js:172:21)
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
- A missing file or dependency
- A Syntax error in the file or one of its dependencies
Fix the error in your code and re-run your tests.
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 0 │
│ Passing: 0 │
│ Failing: 1 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: 0 seconds │
│ Spec Ran: features\\desktop.feature │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Uploading Results)
- nothing to Upload
我的 browserstack.json 如下
{
"auth": {
"username": "<username>","access_key": "<access_key>"
},"browsers": [
{
"os": "Windows 10","browser": "chrome","versions": ["latest"]
}
],"run_settings": {
"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": {
"cypress-cucumber-preprocessor": "^1.19.2","browserstack-cypress-cli": "^1.8.1","cypress": "^3.8.3","cypress-xpath": "^1.6.2"
},"package_config_options": {
"cypress_options": {
"testFiles": "**/*.feature","ignoreTestFiles": "*.js","chromeWebSecurity": false
},"cypress-cucumber-preprocessor_options": {
"nonGlobalStepDeFinitions": true,"step_deFinitions": "cypress/integration/features/dekstop/"
}
},"headless": false
},"connection_settings": {
"local": false,"local_identifier": null,"local_mode": null,"local_config_file": null
},"disable_usage_reporting": false
}
按照开始指南和任何其他提示,我没有发现发生了什么,尤其是在浏览器堆栈日志中,它试图找到一个带有 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 中
在赛普拉斯文件夹 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,但可以在我的工作笔记本电脑上运行
这是我在启动 chrome 时得到的堆栈跟踪信息:Cypress 版本是 7.3。:
标题:启动浏览器时出错
消息:赛普拉斯在重试 50 秒后未能连接到 Chrome DevTools 协议。
这通常表示打开 Chrome 浏览器时出现问题。
请求的 CDP 端口是 29079。
错误详情:
错误:连接 ECONNREFUSED 127.0.0.1:29079 在 TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
堆栈跟踪:
Error: Cypress Failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.
This usually indicates there was a problem opening the Chrome browser.
The CDP port requested was [33m29079[39m.
Error details:
Error: connect ECONNREFUSED 127.0.0.1:29079
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
at get (C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\lib\\errors.js:988:15)
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)
at C:\\Users\\giannia\\AppData\\Local\\Cypress\\Cache\\7.3.0\\Cypress\\resources\\app\\packages\\server\\lib\\browsers\\protocol.js:106:21
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)
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)
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)
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)
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)
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)
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)
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)
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)
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,但可以在我的工作笔记本电脑上运行等相关知识,可以在本站进行查询。
本文标签: