@@ -10,87 +10,88 @@ During test failures, logs and screenshots from the most recent test run will ge
10
10
11
11
** Here are some example run commands to help get you started:**
12
12
13
- Run an example test in Chrome: (`` --browser=chrome `` is the default )
13
+ * Run an example test in Chrome: (Default: `` --browser=chrome `` )
14
14
``` bash
15
15
pytest my_first_test.py
16
16
```
17
17
18
- Run an example test in Firefox:
18
+ * Run an example test in Firefox:
19
19
``` bash
20
20
pytest my_first_test.py --browser=firefox
21
21
```
22
22
23
- Run an example test in Demo Mode: (highlights assertions)
23
+ * Run an example test in Demo Mode: (highlight assertions)
24
24
``` bash
25
25
pytest my_first_test.py --demo
26
26
```
27
+ <img src =" https://cdn2.hubspot.net/hubfs/100006/images/my_first_test_gif.gif " title =" SeleniumBase " ><br />
27
28
28
- Run an example test in Headless Mode: (invisible web browser)
29
+ * Run an example test in Headless Mode: (invisible browser)
29
30
``` bash
30
31
pytest my_first_test.py --headless
31
32
```
32
33
33
- Run tests with verbose output: (includes more details)
34
+ * Run tests with verbose output: (includes more details)
34
35
``` bash
35
36
pytest test_suite.py -v
36
37
```
37
38
38
- Run tests multi-threaded using [ n] threads:
39
+ * Run tests multi-threaded using [ n] threads:
39
40
``` bash
40
41
pytest test_suite.py -v -n=4
41
42
```
42
43
43
- Run a parameterized test, which generates multiple tests out of one:
44
+ * Run a parameterized test: (Generates multiple tests from one)
44
45
``` bash
45
46
pytest parameterized_test.py -v
46
47
```
47
48
48
- Run an example test suite and generate a pytest report: (pytest-only)
49
+ * Run a test suite and generate a pytest report: (pytest-only)
49
50
``` bash
50
51
pytest test_suite.py -v --html=report.html
51
52
```
52
53
53
- Run a failing test: (See the `` latest_logs/ `` folder for logs and screenshots)
54
+ * Run a failing test: (See the `` latest_logs/ `` folder for logs and screenshots)
54
55
``` bash
55
56
pytest test_fail.py
56
57
```
57
58
58
- Run an example test using Chrome's mobile device emulator: (default settings)
59
+ * Run an example test using Chrome's mobile device emulator: (default settings)
59
60
``` bash
60
61
pytest test_swag_labs.py --mobile
61
62
```
62
63
63
- Run a failing test with Debug-mode enabled: (`` pdb `` activates on failures)
64
+ * Run a failing test with Debug-mode enabled: (`` pdb `` activates on failures)
64
65
``` bash
65
66
pytest test_fail.py --pdb -s
66
67
```
67
68
68
- Run an example test suite that demonstrates the use of pytest markers:
69
+ * Run an example test suite that demonstrates the use of pytest markers:
69
70
``` bash
70
71
pytest -m marker_test_suite -v
71
72
```
72
73
73
- Run an example test suite that reuses the browser session between tests:
74
+ * Run an example test suite that reuses the browser session between tests:
74
75
``` bash
75
76
pytest test_suite.py --reuse-session -v
76
77
```
77
78
78
- Run an example test demonstrating the `` rate_limited `` Python decorator:
79
+ * Run an example test demonstrating the `` rate_limited `` Python decorator:
79
80
``` bash
80
81
pytest rate_limiting_test.py
81
82
```
82
83
83
- Run an example test that demonstrates how to upload a file to a website:
84
+ * Run an example test that demonstrates how to upload a file to a website:
84
85
``` bash
85
86
pytest upload_file_test.py
86
87
```
87
88
88
- Run an example test suite and generate a nosetest report: (nosetests-only)
89
+ * Run an example test suite and generate a nosetest report: (nosetests-only)
89
90
``` bash
90
91
nosetests test_suite.py --report --show-report
91
92
```
92
93
93
- Run an example test using a nosetest configuration file: (nosetests-only)
94
+ * Run an example test using a nosetest configuration file: (nosetests-only)
94
95
``` bash
95
96
nosetests my_first_test.py --config=example_config.cfg
96
97
```
0 commit comments