How to run selenium tests in docker container - against app running in another docker container?

Here is the setup I would like:

  1. VM registered as a runner
  2. Docker container that I install all needed testing tools
  • this includes cloning a project repo
  1. Docker container running my web application
  • this includes wget’ing some files from a NAS, and running a Dockerfile

I’ve been reading the documentation on services, and it seems like what I want to do.

What I don’t know is

  • How to set up the .gitlab-ci.yml file to do this
  • How to set up a services that runs a Dockerfile (not an image pushed to Docker Hub)
  • Run the “tester” container with knowledge of the application container (resolve the url of the webserver)
2 Likes

Did you ever find a solution. I’m currently in the same boat

Any solution found ? I’m searching one for same case, want to test from gitlab ci my app running inside another docker container, but I don’t know how to do it …

Hallo,

you could use multiple stages, you build the image in one stage, push it using the CI_PIPELINE_ID as tag and reference this in a later stage.

1 Like

I ended up using Codeception instead of Selenium. I used a Docker container with Composer