From 24cb7a12f0bf5828e9d1c028f704b40d94d342f0 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 18 May 2022 23:01:31 -0400 Subject: [PATCH] Update the documentation --- README.md | 32 ++++++++++++++++++++++++++++---- help_docs/ReadMe.md | 2 +- help_docs/features_list.md | 2 +- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5bddd802..72950da1 100755 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@

🚀 Start | -🏰 Features | +🎯 Features | ✅ Examples | 🎛️ Options | 🔮 Scripts | @@ -47,7 +47,31 @@ -------- -

🌱 An example with the BaseCase class. Runs with pytest or nosetests. (Learn more)

+
+▶️ (expand) How is SeleniumBase different from raw Selenium? +
+ +✔️ SeleniumBase is a Python test framework for the Selenium/WebDriver browser automation library. This framework incorporates test-runners such as pytest, nosetests, and behave to provide organized structure, test discovery, test execution, test state (eg. passed, failed, or skipped), and command-line options for changing default settings (such as which browser to use). With raw Selenium, you would need to set up your own options-parser for configuring tests from the command-line. + +✔️ With raw Selenium, you have to manually download drivers (eg. chromedriver) 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. sbase install chromedriver latest to download the latest version of chromedriver to a local SeleniumBase directory). + +✔️ With raw Selenium, your commands that use selectors would also need to specify the type of selector (eg. "css selector", "button#myButton"). 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 (but optionally you could). + +✔️ SeleniumBase methods often perform multiple actions in a single method call. For example, self.type(selector,text) does the following:
1. Waits for the element to be visible.
2. Waits for the element to be interactive.
3. Clears the text field.
4. Types in the new text.
5. Presses Enter/Submit if the text ends in "\n".
With raw Selenium, those actions require multiple method calls. + +✔️ SeleniumBase lets you change the explicit timeout values of methods:
self.click("button",timeout=12)
With raw Selenium, that requires more code:
WebDriverWait(driver,12).until(EC.element_to_be_clickable("css selector", "button")).click()
Given these examples, the SeleniumBase way is preferable for simplicity. + +✔️ With SeleniumBase, there's a default timeout length if not set, which means that methods automatically wait for elements to appear (up to the timeout length) before failing. With raw Selenium, methods would fail instantly (by default) if an element needed more time to load. + +✔️ SeleniumBase gives you the option to generate a dashboard and reports for tests. It also saves screenshots from failing tests to the ./latest_logs/ folder. Raw Selenium does not have these options out-of-the-box. + +✔️ SeleniumBase includes desktop apps for running tests, such as the SeleniumBase Commander for pytest, and the SeleniumBase Behave GUI. + +✔️ 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. (See the documentation for more details!) +
+
+ +

✍️ An example with the BaseCase class. Runs with pytest or nosetests. (Learn more)

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

🌱 An example with the sb pytest fixture. Runs with pytest.

+

✍️ An example with the sb pytest fixture. Runs with pytest.

```python def test_mfa_login(sb): @@ -78,7 +102,7 @@ def test_mfa_login(sb): sb.save_screenshot_to_logs() ``` -

🌱 An example with behave-BDD Gherkin structure. Runs with behave. (Learn more)

+

✍️ An example with behave-BDD Gherkin structure. Runs with behave. (Learn more)

```gherkin Feature: SeleniumBase scenarios for the RealWorld App diff --git a/help_docs/ReadMe.md b/help_docs/ReadMe.md index 3b0d322f..d8cde00d 100755 --- a/help_docs/ReadMe.md +++ b/help_docs/ReadMe.md @@ -3,7 +3,7 @@

🚀 Start
-🏰 Features | +🎯 Features | 🎛️ Options
✅ Examples | diff --git a/help_docs/features_list.md b/help_docs/features_list.md index 6e3a2bff..ade20949 100755 --- a/help_docs/features_list.md +++ b/help_docs/features_list.md @@ -2,7 +2,7 @@

(Watch the tutorial on YouTube)

-

Features: 🏰

+

Features: 🎯

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