wct在运行
时无法在redhat linux中检测Google Chrome浏览器 polymer test --skip-selenium-install
,并且在错误以下投掷:
cli runtime exception: Error: {"value":{"stacktrace":"org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashedn (Driver info: chromedriveru003d2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platformu003dLinux 3.10.0-693.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)nCommand duration or timeout: 60.11 secondsnBuild info: version: u00273.8.1u0027, revision: u00276e95a6684bu0027, time: u00272017-12-01T19:05:32.194Zu0027nSystem info: host: u0027user-dockeru0027, ip: u0027172.18.0.2u0027, os.name: u0027Linuxu0027, os.arch: u0027amd64u0027, os.version: u00273.10.0-693.21.1.el7.x86_64u0027, java.version: u00271.8.0_162u0027nDriver info: driver.version: unknownntat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)ntat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at next (native)
at fulfilled (/home/user/IdeaProjects/project/node_modules/web-component-tester/runner/steps.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
我们在Docker容器中工作
我在下面尝试过,但它们都没有工作
聚合物测试 - 本地铬
sudo ln -s/usr/bin/google-chrome-stable/usr/bin/google-chrome
导出lunaghtpad_chrome =/usr/bin/google-chrome-stable
版本信息:
redhat 7.3
聚合物:v2.0.0
WebComponents:V1.0.0
聚合物-CLI:1.5.6
我已经打开了github问题
我试图进一步调试,发现我们无法在docker容器中启动Google-Chrome,该容器正在抛出错误Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
Trace/breakpoint trap (core dumped)
。
因此,在调查问题时,我发现Chrome中存在一个问题,可以防止Chrome在Docker环境中启动。在Docker中运行Google Chrome无头。
现在,我设法解决了所有这些选项。
我正在使用wct的配置文件并传递config文件中的 --no-sandbox
选项。
所以现在WCT启动google-chrome
我的wct.conf.json
文件是
{
"plugins": {
"local": {
"browsers": [
"chrome"
],
"browserOptions": {
"chrome": [
"--no-sandbox"
]
}
}
}
}