0

I'm trying to run tests on gitlab-ci, but I don't know which command to start selenoid. Locally, this command looks like ./ Cm selenoid start But how to specify in the case of starting selenoid from the service, I do not know. This is my .gitlab-ci.yml:

stages:
  - testing

ya_test:
  stage: testing
  tags:
    - docker
  services:
    - selenoid/chrome
  image: python:3.9-alpine
  before_script:
    - pip3 install -r requirements.txt
    - selenoid/chrome start         #???????
  script:
    - pytest -s
  allow_failure: true

And what address to specify in the test fixture? localhost:4444? Thanks for the help!

PesyCorm
  • 1
  • 1

1 Answers1

0

For launching Selenoid with Chrome try this yml. Use webdriver.Remote(command_executor="http://selenoid__chrome:4444", options=chrome_options, desired_capabilities=DesiredCapabilities.CHROME) to connect Chrome and add no-sandbox to options.

image: python:3.8

stages:
  - test

test:
  stage: test

  services:
    - name: aerokube/selenoid
    - name: selenoid/chrome:89.0

  before_script:
    - echo "Install environment"
    - apt-get update -q -y
    - pip3 install -r requirements.txt

  script:
    - echo "Run all tests"
    - py.test -s -v  --junitxml=report.xml test.py

  # if you want detailed report at GitLab add artifacts 
  artifacts:
    when: always
    reports:
      junit: report.xml