从角度5.2.0开始,我的e2e测试运行正常。对5.2.9的更新给出了以下错误。我已尝试增加allScriptsTimeout
和getPageTimeout
的量角器配置,但它只会增加错误发生之前的等待时间。
[06:50:19] E/protractor - Could not find Angular on page http://localhost:49152/ : retries looking for angular exceeded
Landing Page
✗ should contain layout elements
- Failed: Angular could not be found on the page http://localhost:49152/. If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
at executeAsyncScript_.then (/home/projects/node_modules/protractor/built/browser.js:720:27)
at ManagedPromise.invokeCallback_ (/home/projects/node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (/home/projects/node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (/home/projects/node_modules/selenium-webdriver/lib/promise.js:3067:27)
at asyncRun (/home/projects/node_modules/selenium-webdriver/lib/promise.js:2927:27)
at /home/projects/node_modules/selenium-webdriver/lib/promise.js:668:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: Run it("should contain layout elements") in control flow
at UserContext.<anonymous> (/home/projects/node_modules/jasminewd2/index.js:94:19)
at /home/projects/node_modules/jasminewd2/index.js:64:48
at ControlFlow.emit (/home/projects/node_modules/selenium-webdriver/lib/events.js:62:21)
at ControlFlow.shutdown_ (/home/projects/node_modules/selenium-webdriver/lib/promise.js:2674:10)
at shutdownTask_.MicroTask (/home/projects/node_modules/selenium-webdriver/lib/promise.js:2599:53)
at MicroTask.asyncRun (/home/projects/node_modules/selenium-webdriver/lib/promise.js:2728:9)
at /home/projects/node_modules/selenium-webdriver/lib/promise.js:668:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From asynchronous test:
Error
at Suite.<anonymous> (/home/projects/e2e/app.e2e-spec.ts:10:3)
at Object.<anonymous> (/home/projects/e2e/app.e2e-spec.ts:3:1)
at Module._compile (module.js:652:30)
at Module.m._compile (/home/projects/node_modules/ts-node/src/index.ts:422:23)
at Module._extensions..js (module.js:663:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/projects/node_modules/ts-node/src/index.ts:425:12)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
**************************************************
* Failures *
**************************************************
1) Landing Page should contain layout elements
- Failed: Angular could not be found on the page http://localhost:49152/. If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
Executed 1 of 1 spec (1 FAILED) in 11 secs.
[06:50:19] I/launcher - 0 instance(s) of WebDriver still running
[06:50:19] I/launcher - chrome #01 failed 1 test(s)
[06:50:19] I/launcher - overall: 1 failed spec(s)
[06:50:19] E/launcher - Process exited with error code 1
以下是我更新后的package.json更改。为了便于阅读,省略了键
"@angular/animations": "5.2.9",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/core": "5.2.9",
"@angular/forms": "5.2.9",
"@angular/http": "5.2.9",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/router": "5.2.9",
"rxjs": "^5.5.10",
"zone.js": "^0.8.26",
"@angular/cli": "1.7.4",
"@angular/compiler-cli": "5.2.9",
"@angular/language-service": "5.2.9",
"typescript": "2.6.2"
答案 0 :(得分:0)
我更新到角度6并且不再抛出量角器错误
Chrome:版本66.0.3359.139 量角器:5.3.0 角度:6.0