Skip to content

Commit 132f8cb

Browse files
committed
Update the documentation
1 parent 49e60f9 commit 132f8cb

File tree

8 files changed

+256
-41
lines changed

8 files changed

+256
-41
lines changed

README.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<meta property="og:site_name" content="SeleniumBase">
22
<meta property="og:title" content="SeleniumBase: Python Web Automation and E2E Testing" />
33
<meta property="og:description" content="Fast, easy, and reliable Web/UI testing with Python." />
4-
<meta property="og:keywords" content="Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, RPA, dashboard, recorder, reports">
4+
<meta property="og:keywords" content="Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, RPA, behave, nosetests, dashboard, recorder, reports, gui">
55
<meta property="og:image" content="https://seleniumbase.io/cdn/img/mac_sb_logo_5.png" />
66
<link rel="icon" href="https://seleniumbase.io/img/green_logo.png" />
77

8-
<h3 align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/mac_sb_logo_8.png" alt="SeleniumBase" title="SeleniumBase" width="310" /></a></h3>
8+
<h3 align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/mac_sb_logo_9.png" alt="SeleniumBase" title="SeleniumBase" width="340" /></a></h3>
99
<!-- View on GitHub -->
10-
<h4 align="center">Better Web Testing with <a href="https://www.selenium.dev/documentation/" target="_blank">Selenium</a> and <a href="https://docs.pytest.org/en/stable/" target="_blank">pytest</a>.</h4>
10+
11+
<div align="center">A <b>Python</b> ecosystem for <a href="https://www.selenium.dev/documentation/" target="_blank">Selenium</a>. Supports <a href="https://docs.pytest.org/en/stable/" target="_blank">pytest</a> and <a href="https://behave.readthedocs.io/en/stable/index.html" target="_blank">behave-BDD</a>.</div>
12+
1113
<p align="center">
1214
<a href="https://github.com/seleniumbase/SeleniumBase/releases">
1315
<img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=2277EE" alt="Latest Release on GitHub" /></a> <a href="https://pypi.python.org/pypi/seleniumbase" target="_blank">
@@ -37,15 +39,15 @@
3739
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI</a> |
3840
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Templates</a> |
3941
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/translations.md">🌏 Translator</a> |
40-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">🎞️ Presenter</a> |
42+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">🎞️ Slides</a> |
4143
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a> |
4244
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a> |
43-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/dialog_boxes/ReadMe.md">🛂 Dialog</a>
45+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/dialog_boxes/ReadMe.md">🛂 DialogBox</a>
4446
</p>
4547

4648
--------
4749

48-
<p align="left">↘️ An example test using the <code>BaseCase</code> class:</p>
50+
<p align="left">↘️ Example test 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>
4951

5052
```python
5153
from seleniumbase import BaseCase
@@ -55,28 +57,44 @@ class TestMFALogin(BaseCase):
5557
self.open("https://seleniumbase.io/realworld/login")
5658
self.type("#username", "demo_user")
5759
self.type("#password", "secret_pass")
58-
self.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG")
60+
self.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG") # 6-digit
5961
self.assert_element("img#image1")
6062
self.assert_text("Welcome!", "h1")
6163
self.click('a:contains("This Page")')
6264
self.save_screenshot_to_logs()
6365
```
6466

65-
<p align="left">↘️ An example test using the <code>sb</code> pytest fixture:</p>
67+
<p align="left">↘️ Example test with the <b>sb</b> pytest fixture. Runs with <code>pytest</code>.</p>
6668

6769
```python
6870
def test_mfa_login(sb):
6971
sb.open("https://seleniumbase.io/realworld/login")
7072
sb.type("#username", "demo_user")
7173
sb.type("#password", "secret_pass")
72-
sb.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG")
74+
sb.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG") # 6-digit
7375
sb.assert_element("img#image1")
7476
sb.assert_text("Welcome!", "h1")
7577
sb.click('a:contains("This Page")')
7678
sb.save_screenshot_to_logs()
7779
```
7880

79-
<p align="left">↘️ An example of running a test: <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py">test_demo_site.py</a></p>
81+
<p align="left">↘️ Example test 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>
82+
83+
```bash
84+
Feature: SeleniumBase scenarios for the RealWorld App
85+
86+
Scenario: Verify RealWorld App (log in / sign out)
87+
Given Open "seleniumbase.io/realworld/login"
88+
When Type "demo_user" into "#username"
89+
And Type "secret_pass" into "#password"
90+
And Do MFA "GAXG2MTEOR3DMMDG" into "#totpcode"
91+
Then Assert exact text "Welcome!" in "h1"
92+
And Highlight "img#image1"
93+
And Click 'a:contains("This Page")'
94+
And Save screenshot to logs
95+
```
96+
97+
<p align="left">✅ An example of running a test: <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py">test_demo_site.py</a></p>
8098

8199
```bash
82100
cd examples/
@@ -145,14 +163,17 @@ pip install -U seleniumbase
145163
* OR: "sbase [COMMAND] [PARAMETERS]"
146164
147165
COMMANDS:
148-
install [DRIVER] [OPTIONS]
166+
get / install [DRIVER] [OPTIONS]
149167
methods (List common Python methods)
150168
options (List common pytest options)
151-
commander / gui [OPTIONAL PATH or TEST FILE]
169+
behave-options (List common Behave options)
170+
gui / commander [OPTIONAL PATH or TEST FILE]
171+
behave-gui (SBase Commander for Behave)
152172
mkdir [DIRECTORY] [OPTIONS]
153173
mkfile [FILE.py] [OPTIONS]
154174
mkrec / codegen [FILE.py] [OPTIONS]
155-
recorder (Open Recorder Desktop App)
175+
recorder (Open Recorder Desktop App.)
176+
record (If args: mkrec. Else: App.)
156177
mkpres [FILE.py] [LANG]
157178
mkchart [FILE.py] [LANG]
158179
print [FILE] [OPTIONS]
@@ -167,7 +188,7 @@ COMMANDS:
167188
download server (Get Selenium Grid JAR file)
168189
grid-hub [start|stop] [OPTIONS]
169190
grid-node [start|stop] --hub=[HOST/IP]
170-
* (EXAMPLE: "sbase install chromedriver latest") *
191+
* (EXAMPLE: "sbase get chromedriver latest") *
171192
172193
Type "sbase help [COMMAND]" for specific command info.
173194
For info on all commands, type: "seleniumbase --help".
@@ -226,7 +247,7 @@ class MyTestClass(BaseCase):
226247
227248
* By default, **[CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp)** are used for finding page elements.
228249
* If you're new to CSS Selectors, games like [CSS Diner](http://flukeout.github.io/) can help you learn.
229-
* Here are some common ``SeleniumBase`` methods that you might find in tests:
250+
* Here are some common SeleniumBase methods that you might find in tests:
230251
231252
```python
232253
self.open(url) # Navigate the browser window to the URL.
@@ -375,6 +396,7 @@ The code above will leave your browser window open in case there's a failure. (i
375396
--var1=STRING # (Extra test data. Access with "self.var1" in tests.)
376397
--var2=STRING # (Extra test data. Access with "self.var2" in tests.)
377398
--var3=STRING # (Extra test data. Access with "self.var3" in tests.)
399+
--variables=DICT # (Extra test data. Access with "self.variables".)
378400
--user-data-dir=DIR # (Set the Chrome user data directory to use.)
379401
--protocol=PROTOCOL # (The Selenium Grid protocol: http|https.)
380402
--server=SERVER # (The Selenium Grid server/IP used for tests.)

examples/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* <b>SeleniumBase</b> tests are run with <b>pytest</b>.
66
* Chrome is the default browser if not specified.
7-
* Tests are structured using [17 unique syntax formats](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md).
7+
* Tests are structured using [20 unique syntax formats](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md).
88
* Logs from test failures are saved to ``./latest_logs/``.
99
* Tests can be run with [multiple command-line options](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).
1010
* Example tests are found in: **[SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples)**.

examples/example_logs/ReadMe.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,22 @@ nosetests test_suite.py --report
102102

103103
--------
104104

105+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> 🔵🐝⚪ Behave Dashboard & Reports:</h3>
106+
107+
(The [behave_bdd/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/behave_bdd) folder can be found in the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.)
108+
109+
```bash
110+
behave behave_bdd/features/ -D dashboard -D headless
111+
```
112+
113+
<img src="https://seleniumbase.io/cdn/img/sb_behave_dashboard.png" title="SeleniumBase" width="600">
114+
115+
You can also use ``--junit`` to get ``.xml`` reports for each Behave feature. Jenkins can use these files to display better reporting for your tests.
116+
117+
```bash
118+
behave behave_bdd/features/ --junit -D rs -D headless
119+
```
120+
121+
--------
122+
105123
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.io/img/sb_logo_10.png" alt="SeleniumBase" width="240" /></a></div>

help_docs/commander.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase Commander</h2>
1+
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase Commander 🎖️</h2>
22

33
🎖️ <b>SeleniumBase Commander</b> lets you run <code>pytest</code> scripts from a Desktop GUI.<br>
44

5-
🎖️ To launch it, use ``sbase commander`` or ``sbase gui``:
5+
🎖️ To launch it, call ``sbase commander`` or ``sbase gui``:
66

77
```bash
88
sbase gui
99
* Starting the SeleniumBase Commander Desktop App...
1010
```
1111

12-
<img src="https://seleniumbase.io/cdn/img/sbase_commander_wide.png" title="SeleniumBase" width="600">
12+
<img src="https://seleniumbase.io/cdn/img/sbase_commander_wide.png" title="SeleniumBase Commander" width="600">
1313

1414
🎖️ <b>SeleniumBase Commander</b> loads the same tests that are found by:
1515

@@ -38,6 +38,14 @@ sbase gui offline_examples/
3838

3939
--------
4040

41+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Other SeleniumBase Commanders:</h3>
42+
43+
* 🐝🎖️ [SeleniumBase Behave GUI / Commander](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/behave_gui.md)
44+
45+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/behave_gui.md"><img src="https://seleniumbase.io/cdn/img/sbase_behave_gui_wide_5.png" title="SeleniumBase Behave GUI" width="400"></a>
46+
47+
--------
48+
4149
<div>To learn more about SeleniumBase, check out the Docs Site:</div>
4250
<a href="https://seleniumbase.io">
4351
<img src="https://img.shields.io/badge/docs-%20%20SeleniumBase.io-11BBDD.svg" alt="SeleniumBase.io Docs" /></a>

help_docs/customizing_test_runs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ pytest my_first_test.py --settings-file=custom_settings.py
113113
--var1=STRING # (Extra test data. Access with "self.var1" in tests.)
114114
--var2=STRING # (Extra test data. Access with "self.var2" in tests.)
115115
--var3=STRING # (Extra test data. Access with "self.var3" in tests.)
116+
--variables=DICT # (Extra test data. Access with "self.variables".)
116117
--user-data-dir=DIR # (Set the Chrome user data directory to use.)
117118
--protocol=PROTOCOL # (The Selenium Grid protocol: http|https.)
118119
--server=SERVER # (The Selenium Grid server/IP used for tests.)

help_docs/html_inspector.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> The HTML Inspector</h2>
1+
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> The HTML Inspector 🔎</h2>
22

3-
🔵 <b>HTML Inspector</b> provides useful info about a web page.
3+
🔎 <b>HTML Inspector</b> provides useful info about a web page.
44

5-
🔵 (<i>Based on: [github.com/philipwalton/html-inspector](https://github.com/philipwalton/html-inspector)</i>)
5+
🔎 (<i>Based on: [github.com/philipwalton/html-inspector](https://github.com/philipwalton/html-inspector)</i>)
66

7-
🔵 Example: [examples/test_inspect_html.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_inspect_html.py) (Chromium-only)
7+
🔎 Example: [examples/test_inspect_html.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_inspect_html.py) (Chromium-only)
88

99
```python
1010
from seleniumbase import BaseCase

0 commit comments

Comments
 (0)