Docker Community Forums

Share and learn in the Docker community.

Spring boot app with selenium hub


(Philippe) #1

Hey all,

We have a Spring boot app which uses a polymer frontend and dependencies are managed using Maven and NPM. During the maven:test-phase, polymer unit tests are run using the web component tester. These are UI tests that needs at least one browser.

Now my problem is the following:
To start the spring boot app in a container, I need the spring boot jar-file. This file is generated in the maven:package phase which comes after the maven:test phase. So, at build time, the selenium hub needs to be up and running so that the polymer unit tests can be run.
Afterwards, when the spring boot app is started, our front-end tests need to be run.
So from what I see now, this would be the sequence:

  1. Start the selenium hub
  2. Build the spring boot jar-file
  3. Deploy the jar-file to a container
  4. Run the front-end (Selenium) tests

I think this can be made possible by using wait scripts etc but is there a more elegant way to accomplish this?

Thanks in advance.
Regards


#2

You might want to give Testcontainers a try. It allows you to boostrap containers within your frontend-tests.