Skip to content

Commit 3bfa7ed

Browse files
committed
Update the docs
1 parent ac06aa8 commit 3bfa7ed

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ Using ``--html=report.html`` gives you a fancy report of the name specified afte
502502
pytest test_suite.py --html=report.html
503503
```
504504
505-
<img src="https://cdn2.hubspot.net/hubfs/100006/images/pytest_report_3c.png" alt="Example Pytest Report" title="Example Pytest Report" width="520" />
505+
<img src="https://seleniumbase.io/cdn/img/html_report.png" alt="Example Pytest Report" title="Example Pytest Report" width="520" />
506506
507507
You can also use ``--junit-xml=report.xml`` to get an xml report instead. Jenkins can use this file to display better reporting for your tests.
508508

examples/ReadMe.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<p align="center"><a align="center" href="https://github.com/seleniumbase/SeleniumBase/blob/master/README.md"><img align="center" src="https://seleniumbase.io/cdn/img/sb_demo_page.png" alt="SeleniumBase" width="288" /></a></p>
1+
<img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" title="SeleniumBase" width="300" />
22

33
<h2><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Running Example Tests:</h2>
44

5-
SeleniumBase tests are run with <b>pytest</b>. Chrome is the default browser if not specifed. During test failures, logs and screenshots from the latest run are saved to the ``latest_logs/`` folder.
5+
<p align="left"><a align="center" href="https://github.com/seleniumbase/SeleniumBase/blob/master/README.md"><img align="center" src="https://seleniumbase.io/cdn/img/sb_demo_page.png" alt="SeleniumBase" width="300" /></a></p>
6+
7+
<b>SeleniumBase</b> tests are run with <b>pytest</b>. Chrome is the default browser if not specifed. During test failures, logs and screenshots from the latest run are saved to the ``latest_logs/`` folder.
68

79
* Example tests are located in <b>[SeleniumBase/examples](https://github.com/seleniumbase/SeleniumBase/tree/master/examples)</b>.
810

@@ -11,90 +13,111 @@ SeleniumBase tests are run with <b>pytest</b>. Chrome is the default browser if
1113
**Here are some example run commands to help get you started:**
1214

1315
Run an example test in Chrome: (Default: ``--browser=chrome``)
16+
1417
```bash
1518
pytest my_first_test.py
1619
```
1720

1821
Run an example test in Firefox:
22+
1923
```bash
2024
pytest my_first_test.py --browser=firefox
2125
```
2226

2327
Run an example test in Demo Mode: (highlight assertions)
28+
2429
```bash
2530
pytest my_first_test.py --demo
2631
```
32+
2733
<img src="https://cdn2.hubspot.net/hubfs/100006/images/my_first_test_gif.gif" title="SeleniumBase Demo Mode" /><br />
2834

2935
Run a different example in Demo Mode:
36+
3037
```bash
3138
pytest test_swag_labs.py --demo
3239
```
40+
3341
<img src="https://cdn2.hubspot.net/hubfs/100006/images/swag_labs_gif.gif" /><br />
3442

3543
Run an example test in Headless Mode: (invisible browser)
44+
3645
```bash
3746
pytest my_first_test.py --headless
3847
```
3948

4049
Run an example test using Chrome's mobile device emulator: (default settings)
50+
4151
```bash
4252
pytest test_swag_labs.py --mobile
4353
```
54+
4455
<img src="https://cdn2.hubspot.net/hubfs/100006/images/swag_mobile.gif" title="SeleniumBase Mobile Mode" /><br />
4556

4657
Run tests with verbose output: (includes more details)
58+
4759
```bash
4860
pytest test_suite.py -v
4961
```
5062

5163
Run a test on the Demo Site to try many SeleniumBase methods:
64+
5265
```bash
5366
pytest test_demo_site.py
5467
```
68+
5569
<img src="https://cdn2.hubspot.net/hubfs/100006/images/demo_page.gif" title="SeleniumBase Mobile Mode" /><br />
5670

5771
Run tests multi-threaded using [n] threads:
72+
5873
```bash
5974
pytest test_suite.py -v -n=4
6075
```
6176

6277
Run a parameterized test: (Generates multiple tests from one)
78+
6379
```bash
6480
pytest parameterized_test.py -v
6581
```
6682

6783
Run a test suite and generate a pytest report: (pytest-only)
84+
6885
```bash
6986
pytest test_suite.py -v --html=report.html
7087
```
7188

7289
Run a failing test: (See the ``latest_logs/`` folder for logs and screenshots)
90+
7391
```bash
7492
pytest test_fail.py
7593
```
7694

7795
Run a failing test with Debug-mode enabled: (``pdb`` activates on failures)
96+
7897
```bash
7998
pytest test_fail.py --pdb -s
8099
```
81100

82101
Run an example test suite that demonstrates the use of pytest markers:
102+
83103
```bash
84104
pytest -m marker_test_suite -v
85105
```
86106

87107
Run an example test suite that reuses the browser session between tests:
108+
88109
```bash
89110
pytest test_suite.py --reuse-session -v
90111
```
91112

92113
Run an example test demonstrating the ``rate_limited`` Python decorator:
114+
93115
```bash
94116
pytest rate_limiting_test.py
95117
```
96118

97119
Run an example test that demonstrates how to upload a file to a website:
120+
98121
```bash
99122
pytest upload_file_test.py
100123
```
@@ -104,16 +127,19 @@ pytest upload_file_test.py
104127
<b>SeleniumBase tests can also be run with ``nosetests``:</b>
105128

106129
Run an example test with nosetests:
130+
107131
```bash
108132
nosetests my_first_test.py
109133
```
110134

111135
Run an example test suite and generate a nosetest report: (nosetests-only)
136+
112137
```bash
113138
nosetests test_suite.py --report --show-report
114139
```
115140

116141
Run an example test using a nosetest configuration file: (nosetests-only)
142+
117143
```bash
118144
nosetests my_first_test.py --config=example_config.cfg
119145
```
@@ -127,6 +153,7 @@ To make things easier, here's a simple GUI program that allows you to run a few
127153
```bash
128154
python gui_test_runner.py
129155
```
156+
130157
<img src="https://cdn2.hubspot.net/hubfs/100006/images/gui_test_runner_py.png" title="GUI Test Runner" width="320" />
131158

132159
--------

help_docs/customizing_test_runs.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,31 @@ SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](
170170
(For setting browser desired capabilities while running Selenium remotely, see the ReadMe located here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities)
171171

172172
Here's how to connect to a BrowserStack Selenium Grid server for running tests:
173+
173174
```bash
174175
pytest my_first_test.py --server=USERNAME:[email protected] --port=80
175176
```
176177

177178
Here's how to connect to a Sauce Labs Selenium Grid server for running tests:
179+
178180
```bash
179181
pytest my_first_test.py --server=USERNAME:[email protected] --port=80
180182
```
181183

182184
Here's how to connect to a TestingBot Selenium Grid server for running tests:
185+
183186
```bash
184187
pytest my_first_test.py --server=USERNAME:[email protected] --port=80
185188
```
186189

187190
Here's how to connect to a CrossBrowserTesting Selenium Grid server for running tests:
191+
188192
```bash
189193
pytest my_first_test.py --server=USERNAME:[email protected] --port=80
190194
```
191195

192196
Here's how to connect to a LambdaTest Selenium Grid server for running tests:
197+
193198
```bash
194199
pytest my_first_test.py --server=USERNAME:[email protected] --port=80
195200
```
@@ -229,6 +234,7 @@ To run Pytest multithreaded on multiple CPUs at the same time, add ``-n=NUM`` or
229234
### <img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="28" /> Retrying failing tests automatically:
230235

231236
You can use ``--reruns=NUM`` to retry failing tests that many times. Use ``--reruns-delay=SECONDS`` to wait that many seconds between retries. Example:
237+
232238
```
233239
pytest --reruns=2 --reruns-delay=1
234240
```
@@ -258,7 +264,8 @@ Using ``--html=report.html`` gives you a fancy report of the name specified afte
258264
```bash
259265
pytest test_suite.py --html=report.html
260266
```
261-
<img src="https://cdn2.hubspot.net/hubfs/100006/images/pytest_report_3c.png" alt="Example Pytest Report" title="Example Pytest Report" width="520" />
267+
268+
<img src="https://seleniumbase.io/cdn/img/html_report.png" alt="Example Pytest Report" title="Example Pytest Report" width="520" />
262269

263270
### <img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="28" /> Nosetest Reports:
264271

@@ -267,6 +274,7 @@ The ``--report`` option gives you a fancy report after your test suite completes
267274
```bash
268275
nosetests test_suite.py --report
269276
```
277+
270278
<img src="https://cdn2.hubspot.net/hubfs/100006/images/Test_Report_2.png" alt="Example Nosetest Report" title="Example Nosetest Report" width="320" />
271279

272280
(NOTE: You can add ``--show_report`` to immediately display Nosetest reports after the test suite completes. Only use ``--show_report`` when running tests locally because it pauses the test run.)
@@ -313,4 +321,5 @@ pytest test_swag_labs.py --mobile --metrics="411,731,3"
313321
# Run mobile tests specifying the user agent
314322
pytest test_swag_labs.py --mobile --agent="Mozilla/5.0 (Linux; Android 9; Pixel 3 XL)"
315323
```
324+
316325
[<img src="https://seleniumbase.io/cdn/img/fancy_logo_14.png" title="SeleniumBase" width="290">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)

0 commit comments

Comments
 (0)