Loading...
Testing

Running automated tests on chrome headless, CentOS!

Hey guys, recently I had the challenge of running our automation pack on centOS, thought i’d share the learnings here. There is really no difference in running them. The tough part is getting the dependencies installed really (we’ll I say tough!). So you’d do all the things we had done. Here is how you get chrome  headless on centOS.

$_ sudo touch /etc/yum.repos.d/google-chrome.repo
$_ sudo chmod 777 /etc/yum.repos.d/google-chrome.repo

Paste in the following in the google-chrome.repo file. Line spaces matter.

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Now install google chrome as usual.

$_ sudo yum install -y google-chrome-stable

You should have a google-chrome binary installed by now. All good, you can check like so.

$_ google-chrome --version

But in case of our automated tests, we found that chrome just didn’t do anything at this point. Turns out, its a broken install and its missing some dependencies (fonts). Run the following to install them as well.

$_ sudo yum install -y liberation-mono-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts

That is it, you’re now all set to execute your automated tests on centOS.

Handle failures like a pro >>

Leave a Reply