我有一个量角器项目,它按我的预期启动并运行规范,但将近 2 分钟后,它开始在其他测试用例上出现此错误。我不知道为什么。一周前它运行良好,但现在我遇到了这个错误,它没有给出(或我看不到(有关错误的任何细节。
"Error: Failed: WebDriverError at stack (Z:\dev\lmwnode_modules\protractornode_modules\jasmine-core\lib\jasmine-core\jasmine.js:2200:17) at buildExpectationResult (Z:\dev\lmwnode_modules\protractornode_modules\jasmine-core\lib\jasmine-core\jasmine.js:2170:14) at Spec.expectationResultFactory (Z:\dev\lmwnode_modules\protractornode_modules\jasmine-core\lib\jasmine-core\jasmine.js:777:18) at Spec.addExpectationResult (Z:\dev\lmwnode_modules\protractornode_modules\jasmine-core\lib\jasmine-core\jasmine.js:450:34) at Env.fail (Z:\dev\lmwnode_modules\protractornode_modules\jasmine-core\lib\jasmine-core\jasmine.js:1192:25) at Function.next.fail (Z:\dev\lmwnode_modules\protractornode_modules\jasmine-core\lib\jasmine-core\jasmine.js:4046:19) at Z:\dev\lmwnode_modules\protractornode_modules\jasminewd2\index.js:64:48 at ControlFlow.emit (Z:\dev\lmwnode_modules\protractornode_modules\selenium-webdriver\lib\events.js:62:21) at ControlFlow.shutdown_ (Z:\dev\lmwnode_modules\protractornode_modules\selenium-webdriver\lib\promise.js:2565:10) at shutdownTask_.MicroTask (Z:\dev\lmwnode_modules\protractornode_modules\selenium-webdriver\lib\promise.js:2490:53)"
有关项目的信息:它运行两个浏览器并使用chromedriver_2.31.exe。
量角器.js=>
directConnect: false,
splitTestsBetweenCapabilties: true,
multiCapabilities:[
{
shardTestFiles: false,
maxInstances: 1,
maxSessions: 1,
sequential: true,
parallelCapability: true,
browserName: 'chrome',
specs: [
'./tests/login/*.js',
'./tests/header/*.js',
'./tests/my-profile/*.js',
'./tests/nominee/*.js',
'./tests/left-menu/*.js',
'./tests/contact-us/*.js',
'./tests/relations/*.js',
'./tests/coordinator/*.js',
'./tests/sitemap/*.js',
'./tests/landing/*.js',
'./tests/vouchers/*.js',
'./tests/extend/*.js',
'./tests/activity/*.js'
]
},
{
shardTestFiles: false,
maxInstances: 1,
maxSessions: 1,
sequential: true,
parallelCapability: true,
browserName: 'chrome',
specs: [
'./tests/enrollment/*.js',
'./tests/claim-/*.js',
'./tests/transfer/*.js',
'./tests/donate/*.js',
'./tests/buy/*.js',
'./tests/calculator/*.js'
]
}
]
包.json =>{
"devDependencies": {
"grunt-cli": "^1.2.0",
"grunt-protractor-runner": "^4.0.0",
"jasmine-spec-reporter": "^3.2.0",
"protractor": "^5.0.0",
"jasmine-reporters": "^2.0.0"
}
}
如果您使用的是办公室笔记本电脑,您能否检查系统中是否有任何加密。这些加密很少会破坏节点模块,从而导致测试用例的失败。
这是我能猜到的唯一原因,因为您之前运行了所有测试用例
PS :我遇到了同样的问题