如何解决无法启动 WebDriver 会话 - Protractor/Angular/Bitbucket
我正在尝试通过 Bitbucket 管道使用无头 Chrome 运行 E2E 测试,但我不断收到有关我的 WebDriver 会话的以下错误。有没有其他人在他们的管道中遇到过这个问题?如果是这样,您是如何解决的?
我在这里查看了类似的问题,但不幸的是,没有一个能帮助我找到解决方案。
[17:11:51] I/launcher - Running 1 instances of WebDriver
[17:11:51] I/direct - Using ChromeDriver directly...
[17:11:51] E/runner - Unable to start a WebDriver session.
[17:11:51] E/launcher - Error: Error: Server terminated early with status 127
at earlyTermination.catch.e (/opt/atlassian/pipelines/agent/build/frontend/node_modules/protractor/node_modules/selenium-webdriver/remote/index.js:252:52)
at process._tickCallback (internal/process/next_tick.js:68:7)
[17:11:51] E/launcher - Process exited with error code 100
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp@0.0.0 e2e: `ng e2e`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp@0.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我的 protractor.conf.js 文件看起来很基本:
exports.config = {
allScriptsTimeout: 11000,specs: [
'./src/**/*.e2e-spec.ts'
],capabilities: {
browserName: 'chrome',chromeOptions: {
args: [ '--headless','--disable-gpu','--window-size=800,600','--no-sandbox' ]
}
},directConnect: true,SELENIUM_PROMISE_MANAGER: false,baseUrl: 'http://localhost:4200/',framework: 'jasmine',jasmineNodeOpts: {
showColors: true,defaultTimeoutInterval: 30000,print: function() {}
},onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname,'./tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};
我的pipeline.yml脚本如下:
- step:
name: Frontend
image: node:10
caches:
- angular-node
script:
- npm install
- npm run test
- npm run e2e
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。