You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/ReadMe.md
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
22
22
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py): (Default option: ``--chrome``)
23
23
24
-
```bash
24
+
```zsh
25
25
pytest my_first_test.py
26
26
```
27
27
@@ -31,15 +31,15 @@ pytest my_first_test.py
31
31
32
32
Here's one way of changing the browser to Firefox:
33
33
34
-
```bash
34
+
```zsh
35
35
pytest my_first_test.py --firefox
36
36
```
37
37
38
38
--------
39
39
40
40
Another [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py) for a web page that has lots of different HTML items:
41
41
42
-
```bash
42
+
```zsh
43
43
pytest test_demo_site.py
44
44
```
45
45
@@ -49,7 +49,7 @@ pytest test_demo_site.py
49
49
50
50
Run an example test in ``--demo`` mode: (highlight assertions)
51
51
52
-
```bash
52
+
```zsh
53
53
pytest test_swag_labs.py --demo
54
54
```
55
55
@@ -59,7 +59,7 @@ pytest test_swag_labs.py --demo
59
59
60
60
Run [test_coffee_cart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py) to test the [Coffee Cart](https://seleniumbase.io/coffee/) app:
Run a [Wordle-solver example](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/wordle_test.py):
71
71
72
-
```bash
72
+
```zsh
73
73
pytest wordle_test.py
74
74
```
75
75
@@ -79,15 +79,15 @@ pytest wordle_test.py
79
79
80
80
Run an example test in ``--headless`` mode: (invisible browser)
81
81
82
-
```bash
82
+
```zsh
83
83
pytest my_first_test.py --headless
84
84
```
85
85
86
86
--------
87
87
88
88
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py) using Chrome's mobile device emulator: (default settings)
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_xkcd.py) in ``--demo`` mode: (highlight assertions)
99
99
100
-
```bash
100
+
```zsh
101
101
pytest test_xkcd.py --demo
102
102
```
103
103
@@ -107,55 +107,55 @@ pytest test_xkcd.py --demo
107
107
108
108
Run a [test suite](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_suite.py) with verbose output: (see more details)
109
109
110
-
```bash
110
+
```zsh
111
111
pytest test_suite.py -v
112
112
```
113
113
114
114
--------
115
115
116
116
Run a test suite using multiple parallel processes (``-n=NUM``):
117
117
118
-
```bash
118
+
```zsh
119
119
pytest test_suite.py -n=8
120
120
```
121
121
122
122
--------
123
123
124
124
Run a [parameterized test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py): (Generates multiple tests from one)
125
125
126
-
```bash
126
+
```zsh
127
127
pytest parameterized_test.py -v
128
128
```
129
129
130
130
--------
131
131
132
132
Run a test suite and generate a SeleniumBase Dashboard:
133
133
134
-
```bash
134
+
```zsh
135
135
pytest test_suite.py --dashboard
136
136
```
137
137
138
138
--------
139
139
140
140
Run a test suite and generate a ``pytest`` report:
141
141
142
-
```bash
142
+
```zsh
143
143
pytest test_suite.py --html=report.html
144
144
```
145
145
146
146
--------
147
147
148
148
Run a [failing test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_fail.py): (See the ``latest_logs/`` folder for logs and screenshots)
149
149
150
-
```bash
150
+
```zsh
151
151
pytest test_fail.py
152
152
```
153
153
154
154
--------
155
155
156
156
Run a failing test that activates ``pdb`` debug mode on failure:
Run a test suite that demonstrates the use of ``pytest`` markers:
167
167
168
-
```bash
168
+
```zsh
169
169
pytest -m marker_test_suite -v
170
170
```
171
171
172
172
--------
173
173
174
174
Run a test suite that reuses the browser session between tests:
175
175
176
-
```bash
176
+
```zsh
177
177
pytest test_suite.py --rs
178
178
```
179
179
180
180
--------
181
181
182
182
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/rate_limiting_test.py) demonstrating the ``rate_limited`` Python decorator:
183
183
184
-
```bash
184
+
```zsh
185
185
pytest rate_limiting_test.py
186
186
```
187
187
188
188
--------
189
189
190
190
Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/upload_file_test.py) that demonstrates how to upload a file to a website:
191
191
192
-
```bash
192
+
```zsh
193
193
pytest upload_file_test.py
194
194
```
195
195
196
196
--------
197
197
198
198
🎖️ **SeleniumBase Commander** is a GUI for ``pytest``:
199
199
200
-
```bash
200
+
```zsh
201
201
sbase gui
202
202
```
203
203
@@ -207,23 +207,23 @@ sbase gui
207
207
208
208
<b>SeleniumBase tests can also be run with ``pynose``:</b>
209
209
210
-
```bash
210
+
```zsh
211
211
pynose my_first_test.py
212
212
```
213
213
214
214
--------
215
215
216
216
Run an example test suite and generate a ``pynose`` test report:
217
217
218
-
```bash
218
+
```zsh
219
219
pynose test_suite.py --report --show-report
220
220
```
221
221
222
222
--------
223
223
224
224
Run an example test using a ``pynose`` configuration file:
0 commit comments