Python 3.9.5 + Pytest project with healenium usage example
cd infra
Create /db/sql folder on the same level in your project.
Add init.sql file into ./db/sql/init.sql folder in your project via command:
$ curl https://raw.githubusercontent.com/healenium/healenium/master/db/sql/init.sql -o init.sql
Example project structure:
your_project_name (root)
|__infra
|__db
|__sql
|__init.sql
To work with Healenium and Selenoid plus Selenoid Ui, use:
To download docker-compose.yaml file into your project use this command:
$ curl https://raw.githubusercontent.com/healenium/healenium-example-python/master/infra/docker-compose.yaml -o docker-compose.yaml
Additionally downlod browsers.json file into you project use this command:
curl https://raw.githubusercontent.com/healenium/healenium-example-python/master/infra/browsers.json -o browsers.json
Manually pull docker images with specific versions from browsers.json:
docker pull selenoid/vnc:chrome_102.0
docker pull selenoid/vnc:chrome_101.0
docker pull selenoid/vnc:firefox_101.0
docker pull selenoid/vnc:firefox_100.0
Example project structure:
your_project_name (root)
|__infra
|__db
|__sql
|__init.sql
|__browsers.json
|__docker-compose.yaml
Command to run docker-compose.yaml
docker-compose up -d
ATTENTION
Verify the next images are Up and Running
* postgres:14.2-bullseye
* healenium/hlm-backend:3.2.3
* healenium/hlm-selector-imitator:1.1
* healenium/hlm-proxy:1.0.0
* healenium/hlm-selenoid:0.1.0
* aerokube/selenoid-ui:1.10.5
To work with Healenium and standard Selenium hub with nodes, use:
To download docker-compose-selenium-v3.yaml file into your project use this command:
$ curl https://raw.githubusercontent.com/healenium/healenium-example-python/master/infra/docker-compose-selenium-v3.yaml -o docker-compose-selenium-v3.yaml
Example project structure:
your_project_name (root)
|__infra
|__db
|__sql
|__init.sql
|__docker-compose-selenium-v3.yaml
Command to run docker-compose-selenium-v3.yaml
docker-compose -f docker-compose-selenium-v3.yaml up -d
ATTENTION
Verify the next images are Up and Running
* postgres:14.2-bullseye
* healenium/hlm-backend:3.2.3
* healenium/hlm-selector-imitator:1.1
* healenium/hlm-proxy:1.0.0
* selenium/hub:4.3.0
* selenium/node-chrome:103.0
* selenium/node-edge:103.0
* selenium/node-firefox:101.0
To run tests in terminal with pytest you need to go to execute next commands:
python3 -m venv env
source ./env/bin/activate
python -m pip install -U pytest
python -m pip install -U selenium
python -m pytest ./tests/
If you want to execute tests from specified file, please use the command:
python -m pytest ./tests/test_css.pyIn case you want to run all tests in project use
python -m pytest ./tests/command
You can monitor tests running if you using Healenium with Selenoid plus Selenoid Ui, use:
go to http://localhost:8080