嘿,在像travis这样的C / I上测试Angular应用的方法是什么?
我用8.3.20版创建了一个新的Angular项目,而我尝试的第一件事是如何使用C / I。因此,我阅读了有关如何使用chrome的travis文档-> https://docs.travis-ci.com/user/chrome
这主要完成了工作,只有e2e测试失败并显示错误消息。E/launcher - session not created: This version of ChromeDriver only supports Chrome version 78
travis的镶边版本为HeadlessChrome 76.0.3809
,我无法更改版本。
我愿意不是要将测试降级为chrome版本76,这听起来不适合我。
是否有Docker方法可使用显式版本的chrome测试角度应用?另外,我应该只使用chrome进行测试还是用firefox或其他浏览器进行测试也有意义吗?
我的最后一个问题是如何标记应用程序的代码覆盖率。对于我使用https://coveralls.io的python,还有打字稿方式吗?
我的.travis.yml文件:
dist: bionic
language: node_js
node_js:
- "12"
os:
- linux
services:
- xvfb
- chrome: stable
sudo: required
before_install:
- # start your web application and listen on `localhost`
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
install:
- yarn
script:
- yarn run lint
- yarn run test -- --watch=false
- yarn run e2e
cache: yarn
感谢您的回答🙂
编辑
有关angular.io的指南,如何设置Travis&Circle CI
-> https://angular.io/guide/testing#set-up-continuous-integration
基于Angular travis ci示例,您还需要一个插件dpkg,以帮助travis ci服务器安装稳定铬的deb文件,该文件在。travis.yml中表示。]
addons:
apt:
packages:
- dpkg
chrome: stable