Please, set "CHROME_BIN" env variable inside docker npm test
The docker run command accepts env file by the -env-file
flag.
So, you can add a new env file with the following
CHROME_BIN=/usr/bin/google-chrome
and pass this file to docker run command
docker run --env-file ./env.list -t -d ${BUILD_NAME}
refer here for the official docs
This way, we don't puppeteer just to set the env variable.
For test, use docker image with chromeheadless
for example, use docker image of angular/ngcontainer
instead of node. This has all configurations done for testing UI apps
Dockerfile
docker pull angular/ngcontainer
Jenkins CI
docker.image('angular/ngcontainer').inside { npm run test }