我正在尝试在gitlab-ci上运行测试,但我不知道启动selenoid的命令是什么。在本地,这个命令看起来像./ Cm selenoid start,但是在从服务启动selenoid的情况下如何指定,我不知道。这是我的.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在test fixture中指定什么地址?本地主机:4444?谢谢你的帮助!
发布于 2021-04-18 11:32:46
要在Chrome中启动Selenoid,可以试试这个yml。使用webdriver.Remote(command_executor="http://selenoid__chrome:4444",和desired_capabilities=DesiredCapabilities.CHROME)连接options=chrome_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.xmlhttps://stackoverflow.com/questions/66890431
复制相似问题