How to setup Chrome Headless on GitLab CI with Puppeteer & Docker

Setup GitLab CI configuration with Docker & Node.js

# Using this convenient image which uses Node.js as a base
image: alekzonder/puppeteer:latest
# This folder is cached between builds for faster runs
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
# The pipeline which should run our unit tests on every commit
unit_tests:
script:
- npm install
- npm run ci-test

Setup Chrome Headless for automatically running tests on GitLab CI

npm install puppeteer --only=dev

Error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

Conclusion

Senior Software Engineer @LeanIX. Co-founder of Sedeo. Passion for software engineering and startups. Looking forward to build great things. 有難うございます。🚀

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store