Run pytest on a selenium grid

Hello,

I’m trying to set up a gitlab-ci.yml file to run pytest_bdd script in a selenium hub. That’s what I got :

stages:

  • Test

Selenium Test:

stage: Test

image: python

script:

- pip install pytest

- pip install pytest_bdd

- pip install selenium

- docker-compose up -d

- python -m pytest tests/step_defs/test_new_account.py --html=report.html

It works on my machine but i don’t know why I have an error on the docker compose command.

Tx
Hadrien

It is difficult to assist without further data. If docker-compose up -d is failing on the runner, can you share the specific error it produces?

If you’re using the docker executor, see https://docs.gitlab.com/ce/ci/docker/using_docker_build.html#use-docker-in-docker-workflow-with-docker-executor for instructions on how to use docker-compose through docker-in-docker configuration.