简体   繁体   English

在bitbucket管道上运行e2e的麻烦

[英]trouble with running e2e on bitbucket pipeline

i trying to configure CI process for my app developed with angular-cli. 我试图为我用angular-cli开发的应用程序配置CI流程。

Currently i managed to make pipeline run the karma tests and my problems is with e2e ("ng e2e" command of angular-cli) 目前,我设法使管道运行业力测试,而我的问题出在e2e(angular-cli的“ ng e2e”命令)上

here is my bitbucket _pipelines.yml: 这是我的bitbucket _pipelines.yml:

image: node:7.6.0

pipelines:
 default:
   - step:
    script: # Modify the commands below to build your repository.
      - npm install -g @angular/cli
      - npm install
      - ng test --singleRun=true
      - ng e2e --env=prod

and here is output of pipeline: 这是管道的输出:

[11:59:09] I/file_manager - creating folder /opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium
[11:59:10] I/update - chromedriver: unzipping chromedriver_2.29.zip
[11:59:10] I/update - chromedriver: setting permissions to 0755 for /opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.29
[11:59:10] I/launcher - Running 1 instances of WebDriver
[11:59:10] I/direct - Using ChromeDriver directly...
[11:59:10] E/launcher - Server terminated early with status 127
[11:59:10] E/launcher - Error: Server terminated early with status 127
    at earlyTermination.catch.e (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/remote/index.js:252:52)
    at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
    at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/chrome.js:709:29)
    at Direct.getNewDriver (/opt/atlassian/pipelines/agent/build/node_modules/protractor/lib/driverProviders/direct.ts:90:25)
    at Runner.createBrowser (/opt/atlassian/pipelines/agent/build/node_modules/protractor/lib/runner.ts:225:39)
    at q.then.then (/opt/atlassian/pipelines/agent/build/node_modules/protractor/lib/runner.ts:391:27)
    at _fulfilled (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:796:13)
    at ./node_modules/protractor/node_modules/q/q.js:556:49
    at runSingle (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:137:13)
    at flush (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    [11:59:10] E/launcher - Process exited with error code 199

It seems like you are launching chrome via a driver but you don't have chrome installed. 似乎您是通过驱动程序启动chrome,但没有安装chrome。 chromedriver doesn't come with chrome itself. chromedriver本身不附带chrome。

I am not sure how would you resolve it but try installing chrome in debug environment and see it help you or not. 我不确定您将如何解决它,但是请尝试在调试环境中安装chrome,看看它对您有没有帮助。

Finally managed to get it run using following bitbucket-pipelines.yml: 最终设法使用以下bitbucket-pipelines.yml使它运行:

 image: versys650/angular-cli-for-e2e-tests

 pipelines:
   default:
    - step:
      script: # Modify the commands below to build your repository.
      - npm install    
      - ng test --singleRun=true
      - export DISPLAY=:1
      - Xvfb $DISPLAY -ac -screen 0 1280x1024x8 &
      - ng e2e --env=prod

Hope it will help somebody... 希望它能对某人有所帮助...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM