https://github.com/ricardobranco777/hawk_test
Docker image to run a set of Selenium tests for testing Hawk
https://github.com/ricardobranco777/hawk_test
docker-image hawk selenium-python
Last synced: 9 months ago
JSON representation
Docker image to run a set of Selenium tests for testing Hawk
- Host: GitHub
- URL: https://github.com/ricardobranco777/hawk_test
- Owner: ricardobranco777
- License: gpl-2.0
- Archived: true
- Created: 2019-09-17T09:27:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-11T18:28:08.000Z (almost 4 years ago)
- Last Synced: 2025-03-20T14:23:53.827Z (about 1 year ago)
- Topics: docker-image, hawk, selenium-python
- Language: Python
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hawk_test
This Docker image runs a set of Selenium tests for testing [Hawk](https://github.com/ClusterLabs/hawk/)
[](https://travis-ci.org/ricardobranco777/hawk_test)
## Usage
```
usage: hawk_test.py [-h] [-b {firefox,chrome,chromium}] [-H HOST] [-S SLAVE]
[-I VIRTUAL_IP] [-P PORT]
[-s SECRET] [-r RESULTS] [--xvfb]
```
## Dependencies
- OS packages:
- Xvfb (optional)
- Docker (optional)
- Firefox
- [Geckodriver](https://github.com/mozilla/geckodriver/releases)
- Chromium (optional)
- [Chromedriver](https://chromedriver.chromium.org/downloads) (optional)
- Python 3.6+
- Python packages:
- paramiko
- selenium
- PyVirtualDisplay
## Usage with Docker
Build image with:
`docker build -t hawk_test -f Dockerfile.alpine`
Run:
```docker run --rm --ipc=host hawk_test --xvfb [OPTIONS]```
If you don't want to use the Xvfb headless mode:
```
xhost +
docker run --rm --ipc=host -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix hawk_test [OPTIONS]
```
Notes:
- You may want to add `--net=host` if you have problems with DNS resolution.
## Options
```
-h, --help show this help message and exit
-b {firefox,chrome,chromium}, --browser {firefox,chrome,chromium}
Browser to use in the test
-H HOST, --host HOST Host or IP address where HAWK is running
-S SLAVE, --slave SLAVE
Host or IP address of the slave
-I VIRTUAL_IP, --virtual-ip VIRTUAL_IP
Virtual IP address in CIDR notation
-P PORT, --port PORT TCP port where HAWK is running
-s SECRET, --secret SECRET
root SSH Password of the HAWK node
-r RESULTS, --results RESULTS
Generate hawk_test.results file for use with openQA.
--xvfb Use Xvfb. Headless mode
```
## FAQ
- Why Xvfb?
- The `-headless` in both browsers still have bugs, specially with modal dialogs.
- Having Xvfb prevents it from connecting to our X system.
- Why docker?
- The Docker image packs the necessary dependencies in such a way that fits the compatibility matrix between Python, Selenium, Firefox (and Geckodriver) & Chromium (and Chromedriver).