0
votes

I would like to insert an automated test stage in a Bluemix continuous delivery toolchain pipeline. The test stage should run a UI test using Selenium Webdriver & script. What is a good approach for making such a stage?

I have looked at Bluemix Build and Deply tutorial at https://hub.jazz.net/docs/deploy/ but it doesn't go into how to build a test node with a job to call a Selenium script. Nor do I find such information in the newer Toolchain documentation.

I visited the Sauce-labs site to see if that is the best way to build automated test nodes in Bluemix, and it appears that might be a method but I am trying to see if I can build the stage right in BlueMix without using a separate service.

2

2 Answers

2
votes

Our test frameworks team recently spent some time on this topic.

Our issue with running UI tests from a pipeline is that we didn’t have any Selenium solution that works for all environments. Saucelabs works for public bluemix environments, but can't access internal (restrictions surrounding the use of Sauce Connect). We have a selenium grid set up, but it cannot be accessed by V1 pipeline.

Our POC uses Jenkins to build the Docker image and upload it to the Bluemix image repository.

The Docker image contains:

  • The base image selenium/standalone-chrome provides Selenium server and Chrome browser
  • Required tools: Ant, Git, Java
  • Source and built binaries from our test repositories.

The image is built to utilize a relatively basic script (ant for driving testng) for running our custom test solution from a pipeline.

(running docker image in Pipeline)

cf ic run --name ${CONTAINER_NAME}_${BUILD_NUMBER} ${IMAGE_NAME} (anything else you want to send to your test script)

Pros and cons

  • + all sources are included and built in the image => makes execution of the tests faster if you rely on cloning your test framework, building dependant jar files, etc.
  • + every image contain it's own Selenium server => no interference from other tests
  • - initialization time of IBM container support in pipeline
1
votes

I chatted with one of the pipeline developers about this, and they suggested running headless automated tests with Selenium from the pipeline. Each pipeline job spins up a new Ubuntu container for you to work in, so this guide might help you get started: https://fabianlee.org/2017/01/17/selenium-running-headless-automated-tests-on-ubuntu/

You should be able to run your tests right from a test stage.