Skip to content

Commit 24cb7a1

Browse files
committed
Update the documentation
1 parent 944cc17 commit 24cb7a1

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<p align="center">
2323
<a href="#python_installation">🚀 Start</a> |
24-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
24+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🎯 Features</a> |
2525
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">✅ Examples</a> |
2626
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🎛️ Options</a> |
2727
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🔮 Scripts</a> |
@@ -47,7 +47,31 @@
4747

4848
--------
4949

50-
<p align="left">🌱 An example with the <b>BaseCase</b> class. Runs with <code>pytest</code> or <code>nosetests</code>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">Learn more</a>)</p>
50+
<details>
51+
<summary>▶️ (expand) How is SeleniumBase different from raw Selenium?</summary>
52+
<div>
53+
54+
✔️ SeleniumBase is a Python test framework for the Selenium/WebDriver browser automation library. This framework incorporates test-runners such as <code>pytest</code>, <code>nosetests</code>, and <code>behave</code> to provide organized structure, test discovery, test execution, test state (<i>eg. passed, failed, or skipped</i>), and command-line options for changing default settings (<i>such as which browser to use</i>). With raw Selenium, you would need to set up your own options-parser for configuring tests from the command-line.
55+
56+
✔️ With raw Selenium, you have to manually download drivers (<i>eg. chromedriver</i>) before running tests. With SeleniumBase's driver manager, that's done automatically for you if the required driver isn't already on your PATH. There are also console scripts available for more control (eg. <code>sbase install chromedriver latest</code> to download the latest version of chromedriver to a local SeleniumBase directory).
57+
58+
✔️ With raw Selenium, your commands that use selectors would also need to specify the type of selector (eg. <code>"css selector", "button#myButton"</code>). With SeleniumBase, there's auto-detection between CSS Selectors and XPath, so you don't need to specify the type of selector in your commands (<i>but optionally you could</i>).
59+
60+
✔️ SeleniumBase methods often perform multiple actions in a single method call. For example, <code>self.type(selector,text)</code> does the following:<br />1. Waits for the element to be visible.<br />2. Waits for the element to be interactive.<br />3. Clears the text field.<br />4. Types in the new text.<br />5. Presses Enter/Submit if the text ends in "\n".<br />With raw Selenium, those actions require multiple method calls.
61+
62+
✔️ SeleniumBase lets you change the explicit timeout values of methods:<br /><code>self.click("button",timeout=12)</code><br />With raw Selenium, that requires more code:<br /><code>WebDriverWait(driver,12).until(EC.element_to_be_clickable("css selector", "button")).click()</code><br />Given these examples, the SeleniumBase way is preferable for simplicity.
63+
64+
✔️ With SeleniumBase, there's a default timeout length if not set, which means that methods automatically wait for elements to appear (<i>up to the timeout length</i>) before failing. With raw Selenium, methods would fail instantly (<i>by default</i>) if an element needed more time to load.
65+
66+
✔️ SeleniumBase gives you the option to generate a dashboard and reports for tests. It also saves screenshots from failing tests to the <code>./latest_logs/</code> folder. Raw Selenium does not have these options out-of-the-box.
67+
68+
✔️ SeleniumBase includes desktop apps for running tests, such as the SeleniumBase Commander for pytest, and the SeleniumBase Behave GUI.
69+
70+
✔️ SeleniumBase has its own Recorder & Test Generator that can create tests from manual browser actions. SeleniumBase also has many other useful tools and console scripts for getting things done quickly. (<i>See the documentation for more details!</i>)
71+
</div>
72+
</details>
73+
74+
<p align="left">✍️ An example with the <b>BaseCase</b> class. Runs with <code>pytest</code> or <code>nosetests</code>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">Learn more</a>)</p>
5175

5276
```python
5377
from seleniumbase import BaseCase
@@ -64,7 +88,7 @@ class TestMFALogin(BaseCase):
6488
self.save_screenshot_to_logs()
6589
```
6690

67-
<p align="left">🌱 An example with the <b>sb</b> <code>pytest</code> fixture. Runs with <code>pytest</code>.</p>
91+
<p align="left">✍️ An example with the <b>sb</b> <code>pytest</code> fixture. Runs with <code>pytest</code>.</p>
6892

6993
```python
7094
def test_mfa_login(sb):
@@ -78,7 +102,7 @@ def test_mfa_login(sb):
78102
sb.save_screenshot_to_logs()
79103
```
80104

81-
<p align="left">🌱 An example with <b>behave-BDD</b> <a href="https://behave.readthedocs.io/en/stable/gherkin.html">Gherkin</a> structure. Runs with <code>behave</code>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn more</a>)</p>
105+
<p align="left">✍️ An example with <b>behave-BDD</b> <a href="https://behave.readthedocs.io/en/stable/gherkin.html">Gherkin</a> structure. Runs with <code>behave</code>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn more</a>)</p>
82106

83107
```gherkin
84108
Feature: SeleniumBase scenarios for the RealWorld App

help_docs/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p align="left">
44
<a href="https://seleniumbase.io/#python_installation">🚀 Start</a>
55
<br />
6-
<a href="https://seleniumbase.io/help_docs/features_list/">🏰 Features</a> |
6+
<a href="https://seleniumbase.io/help_docs/features_list/">🎯 Features</a> |
77
<a href="https://seleniumbase.io/help_docs/customizing_test_runs/">🎛️ Options</a>
88
<br />
99
<a href="https://seleniumbase.io/examples/ReadMe/">✅ Examples</a> |

help_docs/features_list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the tutorial on YouTube</a></b>)</p>
33

44
<a id="feature_list"></a>
5-
<h2><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Features: 🏰</h2>
5+
<h2><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Features: 🎯</h2>
66

77
* A complete test automation framework for web and mobile E2E UI testing.
88
* Has [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for generating scripts from recorded actions. (``--rec``)

0 commit comments

Comments
 (0)