Protractor 在gitlab CI上运行角度e2e测试时出错
在运行e2e测试时,我的gitlab CI服务器上出现了一个意义不大的错误Protractor 在gitlab CI上运行角度e2e测试时出错,protractor,continuous-integration,gitlab-ci,e2e-testing,angularjs-e2e,Protractor,Continuous Integration,Gitlab Ci,E2e Testing,Angularjs E2e,在运行e2e测试时,我的gitlab CI服务器上出现了一个意义不大的错误 [22:40:18] I/launcher - Running 1 instances of WebDriver [22:40:18] I/local - Starting selenium standalone server... [22:40:18] E/launcher - Error: Error: Server terminated early with status 1 at earlyTermina
[22:40:18] I/launcher - Running 1 instances of WebDriver
[22:40:18] I/local - Starting selenium standalone server...
[22:40:18] E/launcher - Error: Error: Server terminated early with status 1
at earlyTermination.catch.e (/selenium-webdriver/remote/index.js:252:52)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[22:40:18] E/launcher - Process exited with error code 100
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! guide-scanner-web@0.0.0 e2e-ci: `ng e2e --conf protractor-ci.conf.js`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the guide-scanner-web@0.0.0 e2e-ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-11-28T22_40_19_015Z-debug.log
ERROR: Job failed: exit code 1
我的gitlab-ci.yml中的工作描述
before_script:
- npm install
e2e:
stage: testing
script:
- apt-get update -y
- apt-get install default-jre -y
- npm install -g webdriver-manager
- webdriver-manager update --out_dir /selenium-grid
- npm run e2e
这是我的package.json:
- @angular/语言服务“^5.0.0”
- “@types/jasmine”:“~2.5.53”
- @types/jasminewd2:“~2.0.2”
- @types/node:“~6.0.60”
- “codelyzer”:“~3.2.2”
- “茉莉花芯”:“~2.6.2”
- “jasmine spec reporter”:“~4.1.0”
- “因果报应”:“~1.7.0”
- “卡玛铬发射器”:“~2.1.1”
- “karma cli”:“~1.0.1”
- “因果报应报道伊斯坦布尔记者”:“^1.2.1”
- “因果报应茉莉”:“~1.1.0”
- “karma jasmine html reporter”:“^0.2.2”
- “量角器”:“~5.1.2”
- “ts节点”:“~3.2.0”
- “tslint”:“~5.7.0”
- “类型脚本”:“~2.4.2”
我一直在努力设置CI,现在有一段时间了,所以任何建议都将非常感谢^^^'只需使用预安装了无头chrome的图像即可。以下是我的Gitlab管道脚本:
cache:
paths:
- node_modules/
before_script:
- npm cache clean --force
- npm install && npm rebuild
stages:
- test
- build
build:
image: node:alpine
stage: build
script:
- ./node_modules/@angular/cli/bin/ng build --prod
test:
image: gnomeontherun/docker-node-chrome-headless:latest
stage: test
script:
- ./node_modules/@angular/cli/bin/ng test --watch=false --single-run=true
cache:
paths:
- node_modules/
before_script:
- npm cache clean --force
- npm install && npm rebuild
stages:
- test
- build
build:
image: node:alpine
stage: build
script:
- ./node_modules/@angular/cli/bin/ng build --prod
test:
image: gnomeontherun/docker-node-chrome-headless:latest
stage: test
script:
- ./node_modules/@angular/cli/bin/ng test --watch=false --single-run=true