使Angular CLI测试在AppVeyor的Ubuntu映像上运行

时间:2019-07-17 09:29:35

标签: angular google-chrome protractor karma-runner appveyor

我创建了一个裸ng new应用程序,该应用程序具有基于Karma的组件测试以及基于Protractor的e2e测试。当我像这样在AppVeyor中配置该存储库时:

version: 1.0.{build}
image: ubuntu
stack: node 10

cache:
  - node_modules -> package.json

install:
  - npm ci
  - node --version
  - npm --version

build: off

test_script:
  - npm run lint
  - npm test -- --progress=false
  - npm run e2e

我会得到these errors

17 07 2019 08:44:57.074:WARN [karma]: No captured browser, open http://localhost:9876/
17 07 2019 08:44:57.082:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
17 07 2019 08:44:57.083:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
17 07 2019 08:44:57.089:INFO [launcher]: Starting browser Chrome
17 07 2019 08:44:58.006:ERROR [launcher]: Cannot start Chrome

17 07 2019 08:44:58.007:ERROR [launcher]: Chrome stdout: 
17 07 2019 08:44:58.007:ERROR [launcher]: Chrome stderr: 
17 07 2019 08:44:58.123:INFO [launcher]: Trying to start Chrome again (1/2).
17 07 2019 08:44:59.031:ERROR [launcher]: Cannot start Chrome

17 07 2019 08:44:59.032:ERROR [launcher]: Chrome stdout: 
17 07 2019 08:44:59.032:ERROR [launcher]: Chrome stderr: 
17 07 2019 08:44:59.411:INFO [launcher]: Trying to start Chrome again (2/2).
17 07 2019 08:44:59.824:ERROR [launcher]: Cannot start Chrome

17 07 2019 08:44:59.824:ERROR [launcher]: Chrome stdout: 
17 07 2019 08:44:59.824:ERROR [launcher]: Chrome stderr: 
17 07 2019 08:45:00.191:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
17 07 2019 08:45:01.776:WARN [karma]: No captured browser, open http://localhost:9876/

The image contains Google Chrome(当前为74版)。我尝试添加

- sh: export CHROME_BIN=/usr/bin/google-chrome

到我的AppVeyor文件,但没有帮助。

我该怎么做才能在AppVeyor的Ubuntu映像上运行Angular组件和e2e测试?

0 个答案:

没有答案