如何使用 puppeteer 和 chrome 78 使量角器运行? [英] How to make protractor run with puppeteer and chrome 78?

查看:62
本文介绍了如何使用 puppeteer 和 chrome 78 使量角器运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用量角器进行 Angular E2E 测试 + Puppeteer,以便在所有 CI 服务器中使用一致的 Chrome 版本.

I am using Protractor for Angular E2E Tests + Puppeteer for a consistent Chrome Version in all CI-Servers.

最近我收到 SessionNotCreatedError: session not created: 这个版本的 ChromeDriver 只支持 Chrome 版本 78 错误.

虽然已安装的 puppeteer 版本 (1.20.0 -> Chromium 78.0.3882.0) 和 webdriver-manager 匹配.

Although the installed versions of puppeteer (1.20.0 -> Chromium 78.0.3882.0) and webdriver-manager are matching.

关于如何解决这个问题的任何想法?有关构建的更多信息,您可以查看 CI 日志 这里 和项目这里

Any ideas on how to solve this? For more information from the build you can see the CI log here and the project here

推荐答案

我遇到了类似的问题,但我的问题是 Chrome 81.

I had a similar problem to this, however my issue was with Chrome 81.

E/launcher - session not created: 此版本的 ChromeDriver 仅支持 Chrome 81 版

我的解决方案是以下两个步骤:

My solution was the below two steps:

1) 不要让 Angular 在运行 ng e2e 时为你安装最新的可用网络驱动程序,方法是使用 --webdriverUpdate 标志并将其设置为 false.

1) Dont let Angular install the latest available webdriver for you when running ng e2e, by using the --webdriverUpdate flag and setting it to false.

2) 使用量角器中的 webdriver-manager 并手动指定要使用的 webdriver:

2) Use the webdriver-manager from protractor and manually specify which webdriver to use:

node_modules/protractor/bin/webdriver-manager update --versions.chrome=80.0.3987.106 --gecko false --standalone false

3) 将此添加到pree2e"步骤中,以便在 e2e 步骤之前自动执行:

3) add this to the "pree2e" step as to be automatically executed before the e2e step:

"pree2e": "node_modules/protractor/bin/webdriver-manager update --versions.chrome=80.0.3987.106 --gecko false --standalone false"

要查看安装了哪些 webdriver,请使用 node_modules/protractor/bin/webdriver-manager status.

To see which webdrivers are installed, use node_modules/protractor/bin/webdriver-manager status.

https://github.com/angular/webdriver-manager/blob/legacy/docs/versions.md#download-a-specific-version

https://angular.io/cli/e2e#options

使用的版本:

"protractor": "5.4.3"
"puppeteer": "2.1.1"

Angular CLI: 9.1.0
Node: 12.2.0
OS: linux x64

这篇关于如何使用 puppeteer 和 chrome 78 使量角器运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆