File tree 4 files changed +59
-1
lines changed
4 files changed +59
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ Tutorials and sample web automation tests project using Selenium and Python
21
21
pytest .\tests\test_selenium_web_form.py
22
22
pytest -m selenium
23
23
pytest -m selenium_pom --html=results.html
24
+ pytest -m selenium_parallel -n auto --html=report.html
24
25
```
25
26
26
27
## Tech
Original file line number Diff line number Diff line change @@ -24,5 +24,6 @@ log_cli = true
24
24
log_cli_level = " INFO"
25
25
markers = [
26
26
" selenium" ,
27
- " selenium_pom"
27
+ " selenium_pom" ,
28
+ " selenium_parallel"
28
29
]
Original file line number Diff line number Diff line change
1
+ """Sample tests to run in parallel"""
2
+
3
+ import logging
4
+ import pytest
5
+
6
+ from data .text_data import RECEIVED_EXPECTED_MESSAGE
7
+ from data .text_data import UUID
8
+ from pom .web_form_page import WebFormPage
9
+
10
+ LOGGER = logging .getLogger (__name__ )
11
+
12
+
13
+ @pytest .mark .selenium_parallel
14
+ def test_write_to_text_area_and_submit_parallel1 (browser ):
15
+
16
+ LOGGER .info ('write text to textarea and submit form' )
17
+
18
+ web_form = WebFormPage (browser )
19
+ message = web_form \
20
+ .set_textarea (UUID )\
21
+ .submit_form ()\
22
+ .get_message ()
23
+
24
+ LOGGER .info (f'check that actual message:[{ message } ] == [{ RECEIVED_EXPECTED_MESSAGE } ]' )
25
+ assert message == RECEIVED_EXPECTED_MESSAGE
26
+
27
+ @pytest .mark .selenium_parallel
28
+ def test_write_to_text_area_and_submit_parallel2 (browser ):
29
+
30
+ LOGGER .info ('write text to textarea and submit form' )
31
+
32
+ web_form = WebFormPage (browser )
33
+ message = web_form \
34
+ .set_textarea (UUID )\
35
+ .submit_form ()\
36
+ .get_message ()
37
+
38
+ LOGGER .info (f'check that actual message:[{ message } ] == [{ RECEIVED_EXPECTED_MESSAGE } ]' )
39
+ assert message == RECEIVED_EXPECTED_MESSAGE
40
+
41
+ @pytest .mark .selenium_parallel
42
+ def test_write_to_text_area_and_submit_parallel3 (browser ):
43
+
44
+ LOGGER .info ('write text to textarea and submit form' )
45
+
46
+ web_form = WebFormPage (browser )
47
+ message = web_form \
48
+ .set_textarea (UUID )\
49
+ .submit_form ()\
50
+ .get_message ()
51
+
52
+ LOGGER .info (f'check that actual message:[{ message } ] == [{ RECEIVED_EXPECTED_MESSAGE } ]' )
53
+ assert message == RECEIVED_EXPECTED_MESSAGE
54
+
55
+ if __name__ == "__main__" :
56
+ pytest .main ()
You can’t perform that action at this time.
0 commit comments