Skip to content

Commit 50227c6

Browse files
committed
Update the docs
1 parent b8aa7ab commit 50227c6

File tree

2 files changed

+48
-43
lines changed

2 files changed

+48
-43
lines changed

README.md

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@ Tests are run with "pytest". Browsers are controlled by WebDriver.
3434
<br />
3535
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📖 API</a> |
3636
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📋 Reports</a> |
37-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_ide/ReadMe.md">⏺️ Recorder</a> |
38-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a>
37+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a> |
38+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_ide/ReadMe.md">⏺️ Recorder</a>
3939
<br />
40+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI</a> |
4041
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/translations.md">🌎 Translate</a> |
4142
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🗺️ Tours</a> |
42-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI</a> |
4343
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md">🖼️ VisualTests</a>
4444
<br />
4545
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">📰 Presenter</a> |
4646
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">📊 Chart Maker</a> |
4747
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🛂 MasterQA</a>
48+
<br />
49+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">💻 Console Scripts</a> |
50+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a> |
51+
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🏃 NodeRunner</a>
4852
</p>
4953

5054
<p align="center"><img src="https://cdn2.hubspot.net/hubfs/100006/images/swag_labs_gif.gif" alt="SeleniumBase" title="SeleniumBase" /></p>
@@ -97,6 +101,7 @@ seleniumbase install chromedriver latest
97101
cd examples/
98102
pytest my_first_test.py
99103
```
104+
100105
* Chrome is the default browser if not specified with ``--browser=BROWSER``.
101106
* On Linux ``--headless`` is the default behavior (running with no GUI). You can also run in headless mode on any OS. If your Linux machine has a GUI and you want to see the web browser as tests run, add ``--headed`` or ``--gui``.
102107

@@ -185,8 +190,7 @@ As you can see, the old WebDriver way is very bad!
185190
Use SeleniumBase to make testing much easier!
186191
(You can still use ``self.driver`` in your code.)
187192

188-
* Run tests with ``pytest`` or ``nosetests`` in any browser:
189-
(**pytest** is recommended. **Chrome** is the default browser.)
193+
You can interchange ``pytest`` with ``nosetests`` for most tests, but using ``pytest`` is recommended. (``chrome`` is the default browser if not specified.)
190194

191195
```bash
192196
pytest my_first_test.py --browser=chrome
@@ -229,7 +233,7 @@ seleniumbase install iedriver
229233
seleniumbase install operadriver
230234
```
231235

232-
Next, choose between **pytest** and **nosetests** test runners. (<i>Mostly interchangeable.</i>)
236+
Next, choose between ``pytest`` and ``nosetests`` test runners. (<i>Mostly interchangeable.</i>)
233237

234238
```bash
235239
cd examples/
@@ -242,15 +246,15 @@ nosetests my_first_test.py --browser=firefox
242246
(<i>If no browser is specified, Chrome is used by default.</i>)
243247
With Pytest, a green dot means a test passed. An "F" means a test failed.
244248

245-
<a id="seleniumbase_demo_mode"></a> **Use Demo Mode to help you see what tests are asserting.**
249+
<a id="seleniumbase_demo_mode"></a> <b>Use Demo Mode to help you see what tests are asserting.</b>
246250

247251
If the example test is moving too fast for your eyes, you can run it in **Demo Mode** by adding ``--demo`` on the command-line, which pauses the browser briefly between actions, highlights page elements being acted on, and lets you know what test assertions are happening in real time:
248252

249253
```bash
250254
pytest my_first_test.py --demo
251255
```
252256

253-
**Pytest** includes test discovery. If you don't specify a specific file or folder to run from, ``pytest`` will search all subdirectories automatically for tests to run based on the following matching criteria:
257+
``Pytest`` includes test discovery. If you don't specify a specific file or folder to run from, ``pytest`` will search all subdirectories automatically for tests to run based on the following matching criteria:
254258
Python filenames that start with ``test_`` or end with ``_test.py``.
255259
Python methods that start with ``test_``.
256260
The Python class name can be anything since SeleniumBase's ``BaseCase`` class inherits from the ``unittest.TestCase`` class.
@@ -260,27 +264,27 @@ You can see which tests are getting discovered by ``pytest`` by using:
260264
pytest --collect-only -q
261265
```
262266

263-
You can use the following in your scripts to help you debug issues:
264-
(<i>If using ipdb, make sure you add "-s" to command-line options unless already in pytest.ini</i>)
267+
You can use the following calls in your scripts to help you debug issues:
268+
265269
```python
266270
import time; time.sleep(5) # Makes the test wait and do nothing for 5 seconds.
267271
import ipdb; ipdb.set_trace() # Enter debugging mode. n = next, c = continue, s = step.
268272
import pytest; pytest.set_trace() # Enter debugging mode. n = next, c = continue, s = step.
269273
```
270274

271-
<b>To pause an active test that throws an exception or error, add ``--pdb -s``:</b>
275+
To pause an active test that throws an exception or error, add ``--pdb``:
272276

273277
```bash
274-
pytest my_first_test.py --pdb -s
278+
pytest my_first_test.py --pdb
275279
```
276280

277281
The code above will leave your browser window open in case there's a failure. (ipdb commands: 'n', 'c', 's' => next, continue, step).
278282

279-
Here are some useful command-line options that come with Pytest:
283+
Here are some useful command-line options that come with ``pytest``:
280284

281285
```bash
282-
-v # Prints the full test name for each test.
283-
-q # Prints fewer details in the console output when running tests.
286+
-v # Verbose mode. Print the full name of each test run.
287+
-q # Quiet mode. Print fewer details in the console output when running tests.
284288
-x # Stop running the tests after the first failure is reached.
285289
--html=report.html # Creates a detailed pytest-html report after tests finish.
286290
--collect-only # Show what tests would get run without actually running them.
@@ -291,52 +295,52 @@ Here are some useful command-line options that come with Pytest:
291295
-m=MARKER # Only run tests that are marked with the specified pytest marker.
292296
```
293297

294-
SeleniumBase provides additional Pytest command-line options for tests:
298+
SeleniumBase provides additional ``pytest`` command-line options for tests:
295299

296300
```bash
297-
--browser=BROWSER # (The web browser to use.)
301+
--browser=BROWSER # (The web browser to use. Default: "chrome")
298302
--cap-file=FILE # (The web browser's desired capabilities to use.)
299303
--cap-string=STRING # (The web browser's desired capabilities to use.)
300-
--settings-file=FILE # (Overrides SeleniumBase settings.py values.)
304+
--settings-file=FILE # (Override default SeleniumBase settings.)
301305
--env=ENV # (Set a test environment. Use "self.env" to use this in tests.)
302-
--data=DATA # (Extra data to pass to tests. Use "self.data" in tests.)
303-
--var1=DATA # (Extra data to pass to tests. Use "self.var1" in tests.)
304-
--var2=DATA # (Extra data to pass to tests. Use "self.var2" in tests.)
305-
--var3=DATA # (Extra data to pass to tests. Use "self.var3" in tests.)
306+
--data=DATA # (Extra test data. Access with "self.data" in tests.)
307+
--var1=DATA # (Extra test data. Access with "self.var1" in tests.)
308+
--var2=DATA # (Extra test data. Access with "self.var2" in tests.)
309+
--var3=DATA # (Extra test data. Access with "self.var3" in tests.)
306310
--user-data-dir=DIR # (Set the Chrome user data directory to use.)
307311
--server=SERVER # (The server / IP address used by the tests.)
308312
--port=PORT # (The port that's used by the test server.)
309313
--proxy=SERVER:PORT # (This is the proxy server:port combo used by tests.)
310-
--agent=STRING # (This designates the web browser's User Agent to use.)
311-
--mobile # (The option to use the mobile emulator while running tests.)
312-
--metrics=STRING # ("CSSWidth,Height,PixelRatio" for mobile emulator tests.)
314+
--agent=STRING # (Modify the web browser's User-Agent string.)
315+
--mobile # (Use the mobile device emulator while running tests.)
316+
--metrics=STRING # (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
313317
--extension-zip=ZIP # (Load a Chrome Extension .zip file, comma-separated.)
314318
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
315-
--headless # (The option to run tests headlessly. The default on Linux OS.)
316-
--headed # (The option to run tests with a GUI on Linux OS.)
319+
--headless # (Run tests headlessly. Default mode on Linux OS.)
320+
--headed # (Run tests with a GUI on Linux OS.)
317321
--start-page=URL # (The starting URL for the web browser when tests begin.)
318322
--archive-logs # (Archive old log files instead of deleting them.)
319323
--time-limit=SECONDS # (Safely fail any test that exceeds the limit limit.)
320-
--slow # (The option to slow down the automation.)
321-
--demo # (The option to visually see test actions as they occur.)
322-
--demo-sleep=SECONDS # (The option to wait longer after Demo Mode actions.)
324+
--slow # (Slow down the automation. Faster than using Demo Mode.)
325+
--demo # (Slow down and visually see test actions as they occur.)
326+
--demo-sleep=SECONDS # (Set the wait time after Demo Mode actions.)
323327
--highlights=NUM # (Number of highlight animations for Demo Mode actions.)
324328
--message-duration=SECONDS # (The time length for Messenger alerts.)
325-
--check-js # (The option to check for JavaScript errors after page loads.)
326-
--ad-block # (The option to block some display ads after page loads.)
327-
--block-images # (The option to block images from loading during tests.)
329+
--check-js # (Check for JavaScript errors after page loads.)
330+
--ad-block # (Block some types of display ads after page loads.)
331+
--block-images # (Block images from loading during tests.)
328332
--verify-delay=SECONDS # (The delay before MasterQA verification checks.)
329333
--disable-csp # (This disables the Content Security Policy of websites.)
330-
--enable-sync # (The option to enable "Chrome Sync".)
331-
--use-auto-ext # (The option to use Chrome's automation extension.)
332-
--swiftshader # (The option to use Chrome's "--use-gl=swiftshader" feature.)
333-
--incognito # (The option to enable Chrome's Incognito mode.)
334-
--guest # (The option to enable Chrome's Guest mode.)
335-
--devtools # (The option to open Chrome's DevTools when the browser opens.)
336-
--reuse-session # (The option to reuse the browser session between tests.)
337-
--crumbs # (Option to delete all cookies between tests reusing a session.)
338-
--maximize-window # (The option to start with the web browser maximized.)
339-
--save-screenshot # (The option to save a screenshot after each test.)
334+
--enable-sync # (Enable "Chrome Sync".)
335+
--use-auto-ext # (Use Chrome's automation extension.)
336+
--swiftshader # (Use Chrome's "--use-gl=swiftshader" feature.)
337+
--incognito # (Enable Chrome's Incognito mode.)
338+
--guest # (Enable Chrome's Guest mode.)
339+
--devtools # (Open Chrome's DevTools when the browser opens.)
340+
--reuse-session # (Reuse the browser session between tests.)
341+
--crumbs # (Delete all cookies between tests reusing a session.)
342+
--maximize-window # (Start tests with the web browser window maximized.)
343+
--save-screenshot # (Save a screenshot at the end of each test.)
340344
--visual-baseline # (Set the visual baseline for Visual/Layout tests.)
341345
--timeout-multiplier=MULTIPLIER # (Multiplies the default timeout values.)
342346
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ nav:
8686
- Jenkins on Azure: integrations/azure/jenkins/ReadMe.md
8787
- Jenkins on Google Cloud: integrations/google_cloud/ReadMe.md
8888
- Recorder and Exporting: seleniumbase/utilities/selenium_ide/ReadMe.md
89+
- NodeJS Test Runner: https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js
8990
- HighCharts: examples/chart_maker/ReadMe.md
9091
- Docker Help: integrations/docker/ReadMe.md
9192
- Help Docs ToC:

0 commit comments

Comments
 (0)