在构建管道中使用Browser.wait()时失败,但在本地计算机上可以正常工作

时间:2019-04-05 10:12:17

标签: typescript azure jasmine protractor azure-devops

我正在使用Azure DevOps在构建机器中运行我的Protractor测试用例。以前,所有代码都可以正常工作,但是突然在构建计算机上开始失败,根本没有任何提示。在E2E测试用例中调用browser.wait时,该测试用例失败。

我还验证了本地计算机浏览器和构建代理浏览器版本是否相同。该代码在我的本地计算机上执行,没有任何错误。

登录页面代码

login.po.ts:

login() {
browser.wait(ExpectedConditions.visibilityOf(element(by.id('xxx'))), 9000);
element(by.id('xxx')).sendKeys("test");
}

Run.spec.ts:

it block for Protractor where login code is called
    it("Should display title ", () => {
        loginpage.login();
});

我正在使用ng E2E运行代码。
本地和构建代理的纱线版本为1.15.2。
本地版本以及构建代理的节点版本为10.14.1。
Chrome版本73.0.3683.86

关于构建代理的错误消息:

none 
at D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\promise.js:668:7
[06:08:00] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Error: The process 'D:\BA0\_tool\yarn\1.15.2\x64\yarn-v1.15.2\bin\yarn.cmd' failed with exit code 1
```
[06:03:19] E/launcher - timeout: Timed out receiving message from renderer: 10.000
  (Session info: chrome=73.0.3683.103)
  (Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.14393 x86_64)
[06:03:19] E/launcher - TimeoutError: timeout: Timed out receiving message from renderer: 10.000
  (Session info: chrome=73.0.3683.103)
  (Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.14393 x86_64)
    at Object.checkLegacyResponse (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\error.js:546:15)
    at parseHttpResponse (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\http.js:509:13)
    at doSend.then.response (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\http.js:441:30)
    at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.takeScreenshot()
    at Driver.schedule (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
    at Driver.takeScreenshot (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\webdriver.js:1085:17)
    at run (D:\BA0\10\s\src\client\node_modules\protractor\built\browser.js:59:33)
    at ProtractorBrowser.to.(anonymous function) [as takeScreenshot] (D:\BA0\10\s\src\client\node_modules\protractor\built\browser.js:67:16)
    at D:\BA0\10\s\src\client\e2e\protractor.conf.js:96:33
    at ManagedPromise.invokeCallback_ (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\promise.js:1376:14)
    at TaskQueue.execute_ (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\promise.js:3084:14)
    at TaskQueue.executeNext_ (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\promise.js:3067:27)
    at asyncRun (D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\promise.js:2927:27)
    at D:\BA0\10\s\src\client\node_modules\selenium-webdriver\lib\promise.js:668:7
[06:03:19] E/launcher - Process exited with error code 199

在构建代理程序上预期:已成功执行

0 个答案:

没有答案