You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2align="center"class="hero__title">All-in-one Test Automation Framework</h2>
15
-
16
-
<h3align="center"><imgsrc="https://seleniumbase.github.io/cdn/img/python_logo.png"title="SeleniumBase"width="29" /> For Python enthusiasts and enterprise developers <imgsrc="https://seleniumbase.github.io/cdn/img/python_logo.png"title="SeleniumBase"width="29" /></h3>
<li><ahref="#creating_visual_reports"><strong>Generating Test Reports</strong></a></li>
74
-
</ul>
75
-
</blockquote>
76
-
77
-
--------
78
-
79
-
<aid="multiple_examples"></a>
58
+
📚 Learn from [**over 100 examples** in the **SeleniumBase/examples/**](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.
80
59
81
-
<palign="left"><b>Example:</b> <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"target="_blank">test_demo_site.py</a> from <ahref="https://github.com/seleniumbase/SeleniumBase/tree/master/examples"target="_blank">./examples/</a> (Uses <codetranslate="no">--chrome</code> by default)</p>
60
+
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>, which covers login, shopping, and checkout:</p>
> Easy to type, click, select, toggle, drag-and-drop, etc.
68
+
> ``pytest`` uses ``--chrome`` by default unless set differently.
91
69
92
70
--------
93
71
94
-
<palign="left"><b>Example:</b> <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py"target="_blank">test_coffee_cart.py</a> from <ahref="https://github.com/seleniumbase/SeleniumBase/tree/master/examples"target="_blank">./examples/</a></p>
72
+
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py"target="_blank">test_coffee_cart.py</a>, which verifies an e-commerce site:</p>
95
73
96
74
```bash
97
-
cd examples/
98
75
pytest test_coffee_cart.py --demo
99
76
```
100
77
101
-
<p>(<codetranslate="no">--demo</code> mode slows down tests and highlights actions)</p>
> SeleniumBase automation can easily order coffee!
80
+
> <p>(<codetranslate="no">--demo</code> mode slows down tests and highlights actions)</p>
106
81
107
-
<palign="left"><b>Here's the code for <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py">test_coffee_cart.py</a>:</b></p>
self.assert_text("Thanks for your purchase.", "#app .success")
86
+
<palign="left">📗 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"target="_blank">test_demo_site.py</a>, which covers several actions:</p>
<li><ahref="#creating_visual_reports"><strong>Generating Test Reports</strong></a></li>
114
+
</ul>
115
+
</blockquote>
116
+
117
+
--------
118
+
137
119
<details>
138
120
<summary> ▶️ How is <b>SeleniumBase</b> different from raw Selenium? (<b>click to expand</b>)</summary>
139
121
<div>
@@ -177,7 +159,7 @@ With raw Selenium, that requires more code:<br />
177
159
178
160
<p>📚 <b>Learn about different ways of writing tests:</b></p>
179
161
180
-
<palign="left">📘📝 An <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_simple_login.py">example test</a> using <codetranslate="no"><ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py">BaseCase</a></code> class inheritance. Runs with <b><ahref="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a></b> or <b><ahref="https://github.com/mdmintz/pynose">pynose</a></b>. (<ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">Learn more</a>). (Use <codetranslate="no">self.driver</code> to access Selenium's raw <codetranslate="no">driver</code>.)</p>
162
+
<palign="left">📘📝 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_simple_login.py">test_simple_login.py</a>, which uses <codetranslate="no"><ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py">BaseCase</a></code> class inheritance, and runs with <ahref="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a> or <ahref="https://github.com/mdmintz/pynose">pynose</a>. (Use <codetranslate="no">self.driver</code> to access Selenium's raw <codetranslate="no">driver</code>.)</p>
181
163
182
164
```python
183
165
from seleniumbase import BaseCase
@@ -196,7 +178,7 @@ class TestSimpleLogin(BaseCase):
196
178
self.assert_text("signed out", "#top_message")
197
179
```
198
180
199
-
<palign="left">📗📝 An <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/sb_fixture_tests.py">example test</a> using the <b><codetranslate="no">sb</code></b> <codetranslate="no">pytest</code> fixture. Runs with <b><ahref="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a></b>. (Use <codetranslate="no">sb.driver</code> to access Selenium's raw <codetranslate="no">driver</code>.)</p>
181
+
<palign="left">📗📝 Here's a test from <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/sb_fixture_tests.py">sb_fixture_tests.py</a>, which uses the <b><codetranslate="no">sb</code></b> <codetranslate="no">pytest</code> fixture. Runs with <ahref="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a>. (Use <codetranslate="no">sb.driver</code> to access Selenium's raw <codetranslate="no">driver</code>.)</p>
<palign="left">📙📝 An <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_sb.py">example test</a> using the <b><codetranslate="no">SB</code></b> Context Manager. Runs with pure <b><codetranslate="no">python</code></b>. (Use <codetranslate="no">sb.driver</code> to access Selenium's raw <codetranslate="no">driver</code>.)</p>
196
+
<palign="left">📙📝 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_sb.py">raw_login_sb.py</a>, which uses the <b><codetranslate="no">SB</code></b> Context Manager. Runs with pure <codetranslate="no">python</code>. (Use <codetranslate="no">sb.driver</code> to access Selenium's raw <codetranslate="no">driver</code>.)</p>
215
197
216
198
```python
217
199
from seleniumbase importSB
@@ -228,7 +210,7 @@ with SB() as sb:
228
210
sb.assert_text("signed out", "#top_message")
229
211
```
230
212
231
-
<palign="left">📔📝 An <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_context.py">example test</a> using the <b><codetranslate="no">DriverContext</code></b> Manager. Runs with pure <b><codetranslate="no">python</code></b>. (The <codetranslate="no">driver</code> is an improved version of Selenium's raw <codetranslate="no">driver</code>, with more methods.)</p>
213
+
<palign="left">📔📝 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_context.py">raw_login_context.py</a>, which uses the <b><codetranslate="no">DriverContext</code></b> Manager. Runs with pure <codetranslate="no">python</code>. (The <codetranslate="no">driver</code> is an improved version of Selenium's raw <codetranslate="no">driver</code>, with more methods.)</p>
232
214
233
215
```python
234
216
from seleniumbase import DriverContext
@@ -245,7 +227,7 @@ with DriverContext() as driver:
245
227
driver.assert_text("signed out", "#top_message")
246
228
```
247
229
248
-
<palign="left">📔📝 An <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_driver.py">example test</a> using the <b><codetranslate="no">Driver</code></b> Manager. Runs with pure <b><codetranslate="no">python</code></b>. (The <code>driver</code> is an improved version of Selenium's raw <codetranslate="no">driver</code>, with more methods.)</p>
230
+
<palign="left">📔📝 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_driver.py">raw_login_driver.py</a>, which uses the <b><codetranslate="no">Driver</code></b> Manager. Runs with pure <codetranslate="no">python</code>. (The <code>driver</code> is an improved version of Selenium's raw <codetranslate="no">driver</code>, with more methods.)</p>
249
231
250
232
```python
251
233
from seleniumbase import Driver
@@ -265,7 +247,7 @@ finally:
265
247
driver.quit()
266
248
```
267
249
268
-
<palign="left">📕📝 An <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/features/login_app.feature"> example test</a> using <btranslate="no">behave-BDD</b> <ahref="https://behave.readthedocs.io/en/stable/gherkin.html#features"target="_blank">Gherkin</a> syntax. Runs with <b><codetranslate="no">behave</code></b>. (<ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn more</a>)</p>
250
+
<palign="left">📕📝 Here's <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/features/login_app.feature">login_app.feature</a>, which uses <atranslate="no"href="https://behave.readthedocs.io/en/stable/gherkin.html#features"target="_blank">behave-BDD Gherkin</a> syntax. Runs with <codetranslate="no">behave</code>. (<ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn about the <b>SeleniumBase behave-BDD</b> integration</a>)</p>
269
251
270
252
```gherkin
271
253
Feature: SeleniumBase scenarios for the Simple App
<p align="left"><b>Here's the code for<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</b></p>
420
398
@@ -500,7 +478,7 @@ self.assert_no_js_errors() # Verify there are no JS errors.
500
478
501
479
<p>✅ SeleniumBase automatically handles common <a href="https://www.selenium.dev/documentation/webdriver/" target="_blank">WebDriver</a> actions such as launching web browsers before tests, saving screenshots during failures, and closing web browsers after tests.</p>
502
480
503
-
<p>✅ SeleniumBase lets you <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">customize test runs from the command-line</a>.</p>
481
+
<p>✅ SeleniumBase lets you customize tests via <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">command-line options</a>.</p>
504
482
505
483
<p>✅ SeleniumBase uses simple syntax for commands. Example:</p>
506
484
@@ -852,7 +830,7 @@ python -m http.server 1948
852
830
🔵 Here's a full example of what the SeleniumBase Dashboard may look like:
<palign="left">🔵 <btranslate="no">Demo Mode</b> helps you see what a test is doing.</p>
8
8
9
9
<palign="left">🏇💨 👀 If a test runs too fast for your eyes, use <btranslate="no">Demo Mode</b> to slow it down, highlight actions, and display assertions. Example usage:</p>
0 commit comments