I’ve been helping a team to improve its Continuous Delivery pipeline and as part of this work, we’re introducing BDD-style test automation using Serenity.
While there are some great cloud-based cross-browser testing tools out there, this team is building an internal app locked away behind the corporate firewall and every one of our virtual machines (VMs) uses a proxy to access the big scary internet and we couldn’t get the company’s preferred cloud-based tool to access our test environment.
One advantage of building an internal app is that we can support a small number of browsers (in this case Chrome). So we decided to setup a stand-alone Docker image of Selenium Chrome that we could use to run our tests as part of our CD pipeline.
Setting up Docker on a Centos VM behind the corporate firewall and using a proxy to access the internet has proven to be trickier than we expected.
Last week I finally dug in (and read the docs) and I wanted to share how I ultimately got it working (mostly for when I have to do this again). If you’re reading this after May 2018, be sure to check the version numbers and do let me know if I need to update this or if you’ve spotted an improvement.
The code below is a gist on github. It’s not quite a bash script so please read it carefully and don’t just copy/paste every line into your terminal. 📺
DISCLAIMER: This code is provided in the hope that it will be useful but with no warranty expressed or implied. I can’t be held liable for any errors or omissions or any havoc it may wreak. 😂