image: python:3.7.9-alpine
stages:
- test
e2e:chrome:
services:
- selenium/standalone-chrome # it's need to be configured with Remote webdriver in your tests to look at http://selenium__standalone-chrome:4444/wd/hub
before_script:
- pip3 install -r requirements.txt # you can optimize this step by building your own image with pre-installled requirements and using it instead of current python:3.7.9-alpine image
script:
- pytest /path/to/your/tests
有几种方式/类型的
gitlab-runner executors
:docker
,docker-compose
,shell
可以实现这一点带有
docker
gitlab runner executor的示例:.gitlab-ci.yml
这是一个可以使用
gitlab-ci
执行python上的selenium测试的可行示例标签1.0.0https://github.com/aleksandr-kotlyar/python-gitlabci-selenium/releases/tag/1.0.0给出了完整的简单示例
标签2.0.0https://github.com/aleksandr-kotlyar/python-gitlabci-selenium/releases/tag/2.0.0提供了更复杂的多浏览器示例
标记2.1.0提供的本地docker示例 https://github.com/aleksandr-kotlyar/python-gitlabci-selenium/releases/tag/2.1.0
免责声明:我为新手开发了PythonGitlab ci和另一个PythonCI模板,因此我将非常感谢我的项目https://github.com/aleksandr-kotlyar/python-gitlabci-selenium/中的反馈和请求
相关问题 更多 >
编程相关推荐