Skip to content

Commit acee575

Browse files
committed
Update the documentation
1 parent 3efca4f commit acee575

File tree

5 files changed

+60
-21
lines changed

5 files changed

+60
-21
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ nosetests [FILE_NAME.py]:[CLASS_NAME].[METHOD_NAME]
367367
```
368368
369369
✅ No More Flaky Tests:
370-
<p>SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>). This means you <b>no longer need</b> random <span><b>time.sleep()</b></span> statements in your scripts.</p>
371-
<img src="https://img.shields.io/badge/Flaky Tests%3F-%20NO%21-11BBDD.svg" alt="NO MORE FLAKY TESTS!" />
370+
<p>SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>). This means <b>you no longer need random <span><code>time.sleep()</code></span> statements</b> in your scripts.</p>
371+
<img src="https://img.shields.io/badge/Flaky%20Tests%3F-%20NO%21-11BBDD.svg" alt="NO MORE FLAKY TESTS!" />
372372
373373
✅ Automated/Manual Hybrid Mode:
374374
<p>SeleniumBase includes a solution called <b><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">MasterQA</a></b>, which speeds up manual testing by having automation perform all the browser actions while the manual tester handles validation.</p>
@@ -466,14 +466,16 @@ The code above will leave your browser window open in case there's a failure. (i
466466
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
467467
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
468468
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
469+
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
469470
--headless # (Run tests in headless mode. The default arg on Linux OS.)
470471
--headed # (Run tests in headed/GUI mode on Linux OS.)
471472
--xvfb # (Run tests using the Xvfb virtual display server on Linux OS.)
472473
--locale=LOCALE_CODE # (Set the Language Locale Code for the web browser.)
473474
--interval=SECONDS # (The autoplay interval for presentations & tour steps)
474475
--start-page=URL # (The starting URL for the web browser when tests begin.)
475-
--archive-logs # (Archive existing log files instead of deleting them.)
476-
--archive-downloads # (Archive old downloads instead of deleting them.)
476+
--archive-logs # (Archive existing log files instead of deleting them.)
477+
--archive-downloads # (Archive old downloads instead of deleting them.)
478+
--skip-js-waits # (Skip waiting for readyState to be complete or Angular.)
477479
--time-limit=SECONDS # (Safely fail any test that exceeds the time limit.)
478480
--slow # (Slow down the automation. Faster than using Demo Mode.)
479481
--demo # (Slow down and visually see test actions as they occur.)
@@ -499,7 +501,7 @@ The code above will leave your browser window open in case there's a failure. (i
499501
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
500502
--dash-title=STRING # (Set the title shown for the generated dashboard.)
501503
--swiftshader # (Use Chrome's "--use-gl=swiftshader" feature.)
502-
--incognito # (Enable Chrome's Incognito mode.)
504+
--incognito # (Enable Chrome's Incognito mode.)
503505
--guest # (Enable Chrome's Guest mode.)
504506
--devtools # (Open Chrome's DevTools when the browser opens.)
505507
--reuse-session | --rs # (Reuse the browser session between tests.)

help_docs/ReadMe.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<a href="https://seleniumbase.io/examples/ReadMe/">✅ Examples</a> |
1111
<a href="https://seleniumbase.io/help_docs/mobile_testing/">📱 Mobile</a>
1212
<br />
13-
<a href="https://seleniumbase.io/help_docs/syntax_formats/">📝 Formats</a> |
13+
<a href="https://seleniumbase.io/help_docs/syntax_formats/">📝 Syntax Formats</a> |
1414
<a href="https://seleniumbase.io/integrations/github/workflows/ReadMe/">🤖 CI/CD</a>
1515
<br />
1616
<a href="https://seleniumbase.io/help_docs/method_summary/">📙 APIs</a> |
@@ -21,16 +21,16 @@
2121
<a href="https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/">🌐 Grid</a>
2222
<br />
2323
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplates</a> |
24-
<a href="https://seleniumbase.io/help_docs/locale_codes/">🗾 Locales</a>
24+
<a href="https://seleniumbase.io/help_docs/locale_codes/">🗾 Locale Codes</a>
2525
<br />
26-
<a href="https://seleniumbase.io/help_docs/js_package_manager/">🕹️ JSManager</a> |
27-
<a href="https://seleniumbase.io/examples/visual_testing/ReadMe/">🖼️ VisualTest</a>
28-
<br />
29-
<a href="https://seleniumbase.io/help_docs/translations/">🈺 Translate</a> |
30-
<a href="https://seleniumbase.io/examples/dialog_boxes/ReadMe/">🛂 DialogBoxes</a>
26+
<a href="https://seleniumbase.io/help_docs/js_package_manager/">🕹️ JS Manager</a> |
27+
<a href="https://seleniumbase.io/examples/visual_testing/ReadMe/">🖼️ Visual Testing</a>
3128
<br />
3229
<a href="https://seleniumbase.io/help_docs/recorder_mode/">🔴 Recorder</a> |
33-
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🏃 NodeRunner</a>
30+
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🚉 Node GUI</a>
31+
<br />
32+
<a href="https://seleniumbase.io/help_docs/translations/">🈺 Translator</a> |
33+
<a href="https://seleniumbase.io/examples/dialog_boxes/ReadMe/">🛂 Dialog Boxes</a>
3434
<br />
3535
<a href="https://seleniumbase.io/examples/presenter/ReadMe/">🎞️ Slides</a> |
3636
<a href="https://seleniumbase.io/examples/chart_maker/ReadMe/">📊 Charts</a>
@@ -53,9 +53,13 @@
5353
<div><a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/"><b>Console Scripts Tutorial</b></a></div>
5454
<div><a href="https://seleniumbase.io/examples/example_logs/ReadMe/"><b>The Dashboard</b></a></div>
5555
<div><a href="https://seleniumbase.io/help_docs/recorder_mode/"><b>Recorder Mode</b></a></div>
56+
<div><a href="https://seleniumbase.io/help_docs/commander/"><b>pytest Commander</b></a></div>
5657
<div><a href="https://seleniumbase.io/help_docs/syntax_formats/"><b>Syntax Formats</b></a></div>
58+
<div><a href="https://seleniumbase.io/examples/behave_bdd/ReadMe/"><b>Behave BDD</b></a></div>
59+
<div><a href="https://seleniumbase.io/help_docs/behave_gui/"><b>Behave Commander</b></a></div>
5760
<div><a href="https://seleniumbase.io/help_docs/mobile_testing/"><b>Mobile Device Testing</b></a></div>
5861
<div><a href="https://seleniumbase.io/help_docs/method_summary/"><b>Method Summary (API Ref)</b></a></div>
62+
<div><a href="https://seleniumbase.io/help_docs/case_plans/"><b>Case Plans</b></a></div>
5963
<div><a href="https://seleniumbase.io/help_docs/translations/"><b>Language Translations</b></a></div>
6064
<div><a href="https://seleniumbase.io/help_docs/locale_codes/"><b>Language Locale Codes</b></a></div>
6165
<div><a href="https://seleniumbase.io/help_docs/js_package_manager/"><b>JS Package Manager</b></a></div>
@@ -115,9 +119,13 @@
115119
<div><a href="https://seleniumbase.dev/seleniumbase/console_scripts/"><b>Console Scripts Tutorial</b></a></div>
116120
<div><a href="https://seleniumbase.dev/examples/example_logs/"><b>The Dashboard</b></a></div>
117121
<div><a href="https://seleniumbase.dev/help_docs/recorder_mode"><b>Recorder Mode</b></a></div>
122+
<div><a href="https://seleniumbase.dev/help_docs/commander"><b>pytest Commander</b></a></div>
118123
<div><a href="https://seleniumbase.dev/help_docs/syntax_formats"><b>Syntax Formats</b></a></div>
124+
<div><a href="https://seleniumbase.dev/examples/behave_bdd/"><b>Behave BDD</b></a></div>
125+
<div><a href="https://seleniumbase.dev/help_docs/behave_gui"><b>Behave Commander</b></a></div>
119126
<div><a href="https://seleniumbase.dev/help_docs/mobile_testing"><b>Mobile Device Testing</b></a></div>
120127
<div><a href="https://seleniumbase.dev/help_docs/method_summary"><b>Method Summary (API Ref)</b></a></div>
128+
<div><a href="https://seleniumbase.dev/help_docs/case_plans"><b>Case Plans</b></a></div>
121129
<div><a href="https://seleniumbase.dev/help_docs/translations"><b>Language Translations</b></a></div>
122130
<div><a href="https://seleniumbase.dev/help_docs/locale_codes"><b>Language Locale Codes</b></a></div>
123131
<div><a href="https://seleniumbase.dev/help_docs/js_package_manager"><b>JS Package Manager</b></a></div>

help_docs/customizing_test_runs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,16 @@ pytest my_first_test.py --settings-file=custom_settings.py
132132
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
133133
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
134134
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
135+
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
135136
--headless # (Run tests in headless mode. The default arg on Linux OS.)
136137
--headed # (Run tests in headed/GUI mode on Linux OS.)
137138
--xvfb # (Run tests using the Xvfb virtual display server on Linux OS.)
138139
--locale=LOCALE_CODE # (Set the Language Locale Code for the web browser.)
139140
--interval=SECONDS # (The autoplay interval for presentations & tour steps)
140141
--start-page=URL # (The starting URL for the web browser when tests begin.)
141-
--archive-logs # (Archive existing log files instead of deleting them.)
142-
--archive-downloads # (Archive old downloads instead of deleting them.)
142+
--archive-logs # (Archive existing log files instead of deleting them.)
143+
--archive-downloads # (Archive old downloads instead of deleting them.)
144+
--skip-js-waits # (Skip waiting for readyState to be complete or Angular.)
143145
--time-limit=SECONDS # (Safely fail any test that exceeds the time limit.)
144146
--slow # (Slow down the automation. Faster than using Demo Mode.)
145147
--demo # (Slow down and visually see test actions as they occur.)
@@ -165,7 +167,7 @@ pytest my_first_test.py --settings-file=custom_settings.py
165167
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
166168
--dash-title=STRING # (Set the title shown for the generated dashboard.)
167169
--swiftshader # (Use Chrome's "--use-gl=swiftshader" feature.)
168-
--incognito # (Enable Chrome's Incognito mode.)
170+
--incognito # (Enable Chrome's Incognito mode.)
169171
--guest # (Enable Chrome's Guest mode.)
170172
--devtools # (Open Chrome's DevTools when the browser opens.)
171173
--reuse-session | --rs # (Reuse the browser session between tests.)

help_docs/how_it_works.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) How SeleniumBase Works:
1+
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) How SeleniumBase Works 👁️
22

33
<a id="how_seleniumbase_works"></a>
44

55
At the core, SeleniumBase works by extending [pytest](https://docs.pytest.org/en/latest/) as a direct plugin. SeleniumBase automatically spins up web browsers for tests (using Selenium WebDriver), and then gives those tests access to the SeleniumBase libraries through the [BaseCase class](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py). Tests are also given access to [SeleniumBase command-line arguments](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) and [SeleniumBase methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md), which provide additional functionality.
66

7-
(NOTE: pytest uses a feature called test discovery to automatically find and run Python methods that start with "``test_``" from the file that you specified on the command line.)
7+
(NOTE: pytest uses a feature called test discovery to automatically find and run Python methods that start with ``test_`` from the file that you specified on the command line.)
88

99
The most common way of using SeleniumBase is by inheriting BaseCase:
1010

@@ -50,6 +50,33 @@ pytest offline_examples/
5050
pytest -k agent
5151
```
5252

53+
(See <a href="https://seleniumbase.io/help_docs/syntax_formats/">SyntaxFormats</a> for more ways of using SeleniumBase.)
54+
55+
--------
56+
57+
### ✅ No More Flaky Tests!
58+
59+
<p>SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (<i>up to a timeout limit</i>). This means <b>you no longer need random <span><code>time.sleep()</code></span> statements</b> in your scripts.</p>
60+
<img src="https://img.shields.io/badge/Flaky%20Tests%3F-%20NO%21-11BBDD.svg" alt="NO MORE FLAKY TESTS!" />
61+
62+
**There are three layers of protection that provide reliability for tests using SeleniumBase:**
63+
64+
* **(1)**: Selenium's default ``pageLoadStrategy`` is ``normal``: This strategy causes Selenium to wait for the full page to load, with HTML content and sub-resources downloaded and parsed.
65+
66+
* **(2)**: SeleniumBase includes methods such as ``wait_for_ready_state_complete()`` and ``wait_for_angularjs()``, which run inside other SeleniumBase methods to ensure that it's safe to proceed with the next command.
67+
68+
* **(3)**: SeleniumBase methods automatically wait for elements to be visible and interactable before interacting with those elements.
69+
70+
**If you want to speed up your tests and you think the third level of protection is enough on it's own, you can use command-line options to remove the first, the second, or both of those first two levels of protection:**
71+
72+
* ``--pls=none`` --> Set ``pageLoadStrategy`` to ``"none"``: This strategy causes Selenium to return immediately after the initial HTML content is fully received by the browser.
73+
74+
* ``--sjw`` --> Skip JS Waits, which include ``wait_for_ready_state_complete()`` and ``wait_for_angularjs()``.
75+
76+
(NOTE: Those command-line options were added in SeleniumBase ``4.2.0``. Using both could lead to a 15% increase in test speed, but it could also lead to flaky tests, so use with caution.)
77+
5378
--------
5479

55-
For more ways of using SeleniumBase, see: <a href="https://seleniumbase.io/help_docs/syntax_formats/">SyntaxFormats</a>.
80+
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" title="SeleniumBase" width="200" /></a></p>
81+
<p><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://badge.fury.io/py/seleniumbase.svg" alt="PyPI version" /></a></p>
82+
<p><a href="https://www.python.org/downloads/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python" title="Supported Python Versions" /></a></p>

help_docs/recorder_mode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Recorder Mode 🔴
2+
13
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=eKN5nq7YbdM"><img src="http://img.youtube.com/vi/eKN5nq7YbdM/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>
24
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=eKN5nq7YbdM">Watch the tutorial on YouTube</a></b>)</p>
35

4-
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Recorder Mode
5-
66
🔴 <b>SeleniumBase Recorder Mode</b> lets you record & export browser actions into test automation scripts.<br>
77

88
<img src="https://seleniumbase.io/cdn/img/sb_recorder_notification.png" title="SeleniumBase" width="380">

0 commit comments

Comments
 (0)