首页 > 解决方案 > Puppeteer Travis-CI chrome-headless 不工作

问题描述

我正在尝试为我的学生自动化测试。作为一个非常基本的示例:编写一些 HTML。所以我创建了一个测试用例来检查无序列表。无论如何:它在本地工作,但似乎我无法让它在 travis 上工作。我可能会错过一件小事,但不知道出了什么问题:

https://travis-ci.com/maciossek/hft-asgmt-html-01/jobs/127338669/config https://github.com/maciossek/hft-asgmt-html-01

任何帮助都非常感谢!

标签: travis-cipuppeteergoogle-chrome-headless

解决方案


这是我最终得到的 travis.yml(工作)

language: node_js
node_js:
  - "9"
dist: trusty
sudo: false  
addons:
  chrome: stable
before_install:
  - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
cache:
  yarn: true
  directories:
    - node_modules
install:
  - yarn install
script:
  - yarn test

推荐阅读