Using:
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Google is now recommending that people use Chrome for Testing for their test automation instead of commercial version of Chrome and I can't find a way to make it work. This is originally how we did it in our pipeline:
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
apt-get -y update
apt-get -y install google-chrome-stable
But now using the new api for Chrome for Testing this is what I'm using in our shell script:
LATEST_CHROME_JSON=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq '.channels.Stable')
LATEST_CHROME_URL=$(echo "$LATEST_CHROME_JSON" | jq -r '.downloads.chrome[] | select(.platform == "linux64") | .url')
wget -N "$LATEST_CHROME_URL" -P ~/
unzip ~/chrome-linux64.zip -d ~/
rm ~/chrome-linux64.zip
mkdir -p /opt/chrome
mv ~/chrome-linux64/* /opt/chrome/
rm -r ~/chrome-linux64
ln -s /opt/chrome/chrome /usr/local/bin/chrome
chmod +x /opt/chrome/chrome
chrome --version
Everytime I use chrome --version
the pipeline fails because some dependency or another is missing. How come I didn't need any of these dependencies before? And how do I have it print out all the required dependencies instead of erroring out one by one? Right now I keep adding a new dependency to install, commit and push, run my pipeline, only to see a brand new error and a brand new dependency is needed.
The dependencies I'm installing:
apt-get update
apt-get install -y unzip openjdk-8-jre-headless
apt-get install -y xvfb libxi6 libgconf-2-4 jq libjq1 libonig5 #xorg apt-get install -y jq libjq1 libonig5
apt-get install -y libnss3
apt-get install -y libatk1.0-0
apt-get install -y libatk-bridge2.0-0
I had to separate them because openjdk-8-jre-headless
kept failing because for some reason it's missing or something. I remember getting this from this tutorial on installing chrome:
https://gist.github.com/buttreygoodness/09e26d7f21eb5b95a4229658a7a9b321
As I post this, my pipeline just failed again this time with error
chrome: error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory
This is getting frustrating. There has to be a better way to install chrome from a zip file like this. I don't understand why they couldn't just make a .deb
file like they normally do