22
33Automated tests using Python flavor of the Selenium framework.
44
5+ - [ Get started: Selenium + pytest] ( #get-started-selenium--pytest )
6+ - [ How to install] ( #how-to-install )
7+ - [ Initial setup] ( #initial-setup )
8+ - [ Configure dependecies] ( #configure-dependecies )
9+ - [ How to execute tests] ( #how-to-execute-tests )
10+ - [ Expected output of test run] ( #expected-output-of-test-run )
11+ - [ Selecting a specific browser] ( #selecting-a-specific-browser )
12+ - [ Set a default browser to run a specific test] ( #set-a-default-browser-to-run-a-specific-test )
13+
14+
515# How to install
616
717## Initial setup
@@ -42,8 +52,16 @@ Once configured, to execute the tests, go to the project directory then type:
4252
4353``` bash
4454pytest
55+
56+ # You can use pytest -vv for a more verbose test output
4557```
4658
59+ ## Expected output of test run
60+
61+ An output like this is expected after the tests are all run:
62+
63+ ![ ] ( evidencies/EXECUTION-OUTPUT_2023-12-04_22.22.34.png )
64+
4765## Selecting a specific browser
4866
4967You may want to use a specific browser to run the tests, therefore use the following argument to achieve this:
@@ -57,4 +75,16 @@ The supported browser options list is [described here](https://github.com/thiago
5775Custom options:
5876 --use-browser=USE_BROWSER
5977 Define the browser to be executed. Current supported versions: chrome, firefox, safari, headless-chrome, headless-firefox, headless-safari
60- ```
78+ ```
79+
80+ ## Set a default browser to run a specific test
81+
82+ You can also set a default browser to run the tests by using a custom Pytest's Mark, as the exemple below:
83+
84+ ``` python
85+ @pytest.mark.FORCE_BROWSER (" firefox" )
86+ def test_successfully_run_with_firefox (...):
87+ ...
88+ ```
89+
90+ The test above will be run using the Firefox browser and this mark takes precedence over the CLI argument ` --use-browser ` , if it is passed.
0 commit comments