Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleksandr-kotlyar/python-gitlabci-selenium
Python project template for multi-browser Selenium tests execution at GitLabCI and locally using Docker.
https://github.com/aleksandr-kotlyar/python-gitlabci-selenium
docker gitlab-ci python selenium
Last synced: 26 days ago
JSON representation
Python project template for multi-browser Selenium tests execution at GitLabCI and locally using Docker.
- Host: GitHub
- URL: https://github.com/aleksandr-kotlyar/python-gitlabci-selenium
- Owner: aleksandr-kotlyar
- License: mit
- Created: 2020-03-29T17:48:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-08T00:51:59.000Z (over 3 years ago)
- Last Synced: 2023-07-13T19:47:16.210Z (over 1 year ago)
- Topics: docker, gitlab-ci, python, selenium
- Language: Python
- Homepage: https://gitlab.com/aleksandr-kotlyar/python-gitlabci-selenium
- Size: 365 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Selenium with Docker and GitLab
![GitHub statistics](https://raw.githubusercontent.com/aleksandr-kotlyar/python-gitlabci-selenium/traffic-2021/traffic-python-gitlabci-selenium/in_2021.svg)
![GitHub views](https://raw.githubusercontent.com/aleksandr-kotlyar/python-gitlabci-selenium/traffic-2021/traffic-python-gitlabci-selenium/views.svg)
![GitHub views per week](https://raw.githubusercontent.com/aleksandr-kotlyar/python-gitlabci-selenium/traffic-2021/traffic-python-gitlabci-selenium/views_per_week.svg)
![GitHub clones](https://raw.githubusercontent.com/aleksandr-kotlyar/python-gitlabci-selenium/traffic-2021/traffic-python-gitlabci-selenium/clones.svg)
![GitHub clones per week](https://raw.githubusercontent.com/aleksandr-kotlyar/python-gitlabci-selenium/traffic-2021/traffic-python-gitlabci-selenium/clones_per_week.svg)## About
Python project template for those who want to quickly start running their Selenium tests in GitLabCI. The template will be helpful enough for the first time if you just starting new test automation project and need a simple CI or even if you are new to GitLab, Docker, Selenium but need to run Selenium tests in CI.
#### Browsers support
- Chrome (default)
- Firefox
## GitLab Usage
- To run job with Chrome just run pipeline with one of the Triggers
- To run job with Firefox set GitLab variable BROWSER=firefox and run pipeline with one of the Triggers
#### CI Triggers
- **Manual** "Run pipeline" from WebUI
- **Schedule** to start pipeline by cron
- **Push** commit to gitlab and pipeline will start automatically
- **Trigger** API endpoint to start pipeline
## Local Usage
Prepare
```shell script
docker run -d -p 4444:4444 --net grid --name selenium-hub selenium/hub:3.141.59
docker run -d --net grid -e HUB_HOST=selenium-hub --name chrome -v /dev/shm:/dev/shm selenium/node-chrome
docker run -d --net grid -e HUB_HOST=selenium-hub --name firefox -v /dev/shm:/dev/shm selenium/node-firefox
```
Run tests
```shell script
# tests on Chrome
pytest
# or
pytest --browser=chrome
# tests on Firefox
pytest --browser=firefox
```
End of work
```shell script
docker stop selenium-hub chrome firefox
```