Parallel processing Chrome浏览器在运行时保持打开状态;“假平行度”;和TestCafe
我目前正在使用TestCafe作为我公司的主要测试框架。我最近遇到了一个问题:我们有一个设计好的管道,它以并行的方式启动测试,但不是Testcafe应该工作的方式 我知道testcafe可以通过以下方式通过并发测试执行来处理并行性: testcafe-c 3 chrome测试/test.js 但是,我们的管道在其自己的浏览器中播放每个testcafe测试,而不使用并发测试执行过程。结果是,在执行结束时,任务管理器中仍有许多chrome浏览器处于打开状态。我不知道如何处理这个问题。。。我已经尝试在我的装置的“aftereach”处插入一些关于window.close()的代码,但这不起作用 我必须提到的是,一次执行一个测试并不会产生这种效果,而且所有的chrome浏览器都是正确关闭的 谢谢你的帮助 西尔万 这是执行的代码:Parallel processing Chrome浏览器在运行时保持打开状态;“假平行度”;和TestCafe,parallel-processing,automated-tests,e2e-testing,web-testing,testcafe,Parallel Processing,Automated Tests,E2e Testing,Web Testing,Testcafe,我目前正在使用TestCafe作为我公司的主要测试框架。我最近遇到了一个问题:我们有一个设计好的管道,它以并行的方式启动测试,但不是Testcafe应该工作的方式 我知道testcafe可以通过以下方式通过并发测试执行来处理并行性: testcafe-c 3 chrome测试/test.js 但是,我们的管道在其自己的浏览器中播放每个testcafe测试,而不使用并发测试执行过程。结果是,在执行结束时,任务管理器中仍有许多chrome浏览器处于打开状态。我不知道如何处理这个问题。。。我已经尝试在
execution {
String nodejsPath = pathfileOfTestDirectory("nodejs/")
String nodejsModulePath = nodejsPath + "/lib/node_modules"
String npmPath = pathfileOfTestDirectory("nodejs/npm.cmd")
new File(resultDir).mkdirs();
logcatoutput resultDir + "logcat.log"
inDirectory pathfileOfTestDirectory("tests-e2e")
within 60, TimeUnit.MINUTES
env "Path", readEnv("Path") + ";" + nodejsPath
env "NODE_PATH", nodejsModulePath
String browserPath;
switch(browser) {
case "firefox":
//browserPath = pathfileOfTestDirectory("/resources/browsers/firefox/firefox.exe")
browserPath = pathfileOfTestDirectory("/resources/browsers/chrome/Application/chrome.exe")
break
case "chrome" :
browserPath = pathfileOfTestDirectory("/resources/browsers/chrome/Application/chrome.exe")
break
}
command npmPath, "run",
"testcafe",
"--scripts-prepend-node-path",// ensure the nodejs installation of the workspace is used
"--",
"path:`${browserPath}`",
"testcafe/",
"--targetEnv=" + targetEnv,
"--targetPage=" + targetPage,
"--test=\"${testName}\"", "-q",
"-r", "json:${resultDir}result.json",
"-s", "${resultDir}"
logger.info("Execution done")
}
你能分享一下你的管道系统的代码吗?刚刚添加了代码;)能否尝试将浏览器指定为
“chrome:
${browserPath}”
和“firefox:{$browserPath}”
?TestCafe有一种特殊的终止Chrome和Firefox浏览器的方法,但只有当您明确使用Chrome
和Firefox
浏览器提供程序时才启用。好的,我会试试!