Skip to content

Commit fd4637c

Browse files
committed
Update the ReadMe
1 parent bcf0b73 commit fd4637c

File tree

1 file changed

+43
-24
lines changed

1 file changed

+43
-24
lines changed

README.md

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<meta property="og:description" content="Fast, easy, and reliable Web/UI testing with Python." />
44
<meta property="og:keywords" content="Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, RPA, behave, BDD, nosetests, dashboard, recorder, reports, gui, screenshots">
55
<meta property="og:image" content="https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png" />
6-
<link rel="icon" href="https://seleniumbase.github.io/img/green_logo2.png" />
6+
<link rel="icon" href="https://seleniumbase.github.io/img/logo3b.png" />
77

8-
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_gs.png" alt="SeleniumBase" title="SeleniumBase" width="450" /></a></p>
8+
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_media_logo_t4.png" alt="SeleniumBase" title="SeleniumBase" width="408" /></a></p>
99

10-
<p align="center"><b>SeleniumBase</b> simplifies <a href="https://www.selenium.dev/documentation/webdriver/" target="_blank">WebDriver</a> automation with <a href="https://docs.pytest.org/en/latest/how-to/usage.html" target="_blank">pytest</a>.</p>
10+
<p align="center"><b>SeleniumBase</b> simplifies <a href="https://www.selenium.dev/documentation/webdriver/" target="_blank">WebDriver</a> automation with <b>Python</b>.</p>
1111

1212
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="SeleniumBase" /></a></p>
1313

@@ -123,7 +123,7 @@ pytest test_swag_labs.py --demo
123123

124124
<h4>Here are a few scripts to test that app with SeleniumBase:</h4>
125125

126-
<p align="left">📘📝 An 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>
126+
<p align="left">📘📝 An example test with the <b>BaseCase</b> class. Runs with <b><a href="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a></b> or <b>nosetests</b>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">Learn more</a>)</p>
127127

128128
```python
129129
from seleniumbase import BaseCase
@@ -140,7 +140,7 @@ class TestMFALogin(BaseCase):
140140
self.save_screenshot_to_logs()
141141
```
142142

143-
<p align="left">📗📝 An example test with the <b>sb</b> <code>pytest</code> fixture. Runs with <code>pytest</code>.</p>
143+
<p align="left">📗📝 An example test with the <b><code>sb</code></b> <code>pytest</code> fixture. Runs with <b><a href="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a></b>.</p>
144144

145145
```python
146146
def test_mfa_login(sb):
@@ -154,7 +154,25 @@ def test_mfa_login(sb):
154154
sb.save_screenshot_to_logs()
155155
```
156156

157-
<p align="left">📕📝 An example test with <b>behave-BDD</b> <a href="https://behave.readthedocs.io/en/stable/gherkin.html" target="_blank">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>
157+
<p align="left">📙📝 An example test with the <b><code>SB</code></b> Context Manager. Runs with pure <b><code>python</code></b>.</p>
158+
159+
```python
160+
from seleniumbase import SB
161+
162+
with SB() as sb: # By default, browser="chrome" if not set.
163+
sb.open("https://seleniumbase.github.io/realworld/login")
164+
sb.type("#username", "demo_user")
165+
sb.type("#password", "secret_pass")
166+
sb.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG") # 6-digit
167+
sb.assert_text("Welcome!", "h1")
168+
sb.highlight("img#image1") # A fancier assert_element() call
169+
sb.click('a:contains("This Page")') # Use :contains() on any tag
170+
sb.click_link("Sign out") # Link must be "a" tag. Not "button".
171+
sb.assert_element('a:contains("Sign in")')
172+
sb.assert_exact_text("You have been signed out!", "#top_message")
173+
```
174+
175+
<p align="left">📕📝 An example test with <b>behave-BDD</b> <a href="https://behave.readthedocs.io/en/stable/gherkin.html" target="_blank">Gherkin</a> structure. Runs with <b><code>behave</code></b>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn more</a>)</p>
158176

159177
```gherkin
160178
Feature: SeleniumBase scenarios for the RealWorld App
@@ -178,7 +196,7 @@ Feature: SeleniumBase scenarios for the RealWorld App
178196
🔵 Using a <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md">Python virtual env</a> is recommended.
179197

180198
<a id="install_seleniumbase"></a>
181-
<h2><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Install SeleniumBase:</h2>
199+
<h2><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Install SeleniumBase:</h2>
182200

183201
**You can install ``seleniumbase`` from [GitHub](https://github.com/seleniumbase/SeleniumBase) or [PyPI](https://pypi.org/project/seleniumbase/):**
184202

@@ -261,15 +279,15 @@ COMMANDS:
261279
```
262280
263281
264-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Downloading web drivers:</h3>
282+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Downloading web drivers:</h3>
265283
266284
✅ SeleniumBase automatically downloads web drivers as needed, such as ``chromedriver`` and ``geckodriver`` (Firefox).
267285
268286
✅ To manually download a webdriver, see [Console Scripts](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) OR [Webdriver Installation](https://seleniumbase.io/help_docs/webdriver_installation/).
269287
270288
271289
<a id="basic_example_and_usage"></a>
272-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Basic Example & Usage:</h3>
290+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Basic Example & Usage:</h3>
273291
274292
🔵 If you've cloned SeleniumBase, you can run tests from the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.
275293
@@ -320,7 +338,7 @@ class MyTestClass(BaseCase):
320338
321339
322340
<a id="common_methods"></a>
323-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Here are some common SeleniumBase methods that you might find in tests:</h3>
341+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Here are some common SeleniumBase methods that you might find in tests:</h3>
324342
325343
```python
326344
self.open(url) # Navigate the browser window to the URL.
@@ -361,7 +379,7 @@ self.assert_no_js_errors() # Verify there are no JS errors.
361379
362380
363381
<a id="fun_facts"></a>
364-
<h2><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Fun Facts / Learn More:</h2>
382+
<h2><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Fun Facts / Learn More:</h2>
365383
366384
<p>✅ SeleniumBase automatically handles common WebDriver actions such as launching web browsers before tests, saving screenshots during failures, and closing web browsers after tests.</p>
367385
@@ -418,7 +436,7 @@ nosetests [FILE_NAME.py]:[CLASS_NAME].[METHOD_NAME]
418436
419437
420438
<a id="detailed_instructions"></a>
421-
<h2><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Detailed Instructions:</h2>
439+
<h2><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Detailed Instructions:</h2>
422440
423441
<a id="seleniumbase_demo_mode"></a>
424442
🔵 <b>Demo Mode</b> helps you see what a test is doing. If a test is moving too fast for your eyes, run it in <b>Demo Mode</b>, which pauses the browser briefly between actions, highlights page elements being acted on, and displays assertions:
@@ -528,7 +546,8 @@ pytest my_first_test.py --pdb
528546
--enable-ws # (Enable Web Security on Chromium-based browsers.)
529547
--enable-sync # (Enable "Chrome Sync" on websites.)
530548
--use-auto-ext # (Use Chrome's automation extension.)
531-
--undetected | --uc # (Use undetected-chromedriver to evade bot-detection.)
549+
--uc | --undetected # (Use undetected-chromedriver to evade bot-detection.)
550+
--uc-sub | --uc-subprocess # (Use undetected-chromedriver as a subprocess.)
532551
--remote-debug # (Enable Chrome's Remote Debugger on http://localhost:9222)
533552
--final-debug # (Enter Debug Mode after each test ends. Don't use with CI!)
534553
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
@@ -570,7 +589,7 @@ Here's the command-line option to add to tests: (See [examples/custom_settings.p
570589
Inside your tests, you can use ``self.data`` to access that.
571590
572591
573-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Test Directory Configuration:</h3>
592+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Test Directory Configuration:</h3>
574593
575594
🔵 When running tests with **pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)** in your root folders. When running tests with **nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** in your root folders. These files specify default configuration details for tests. Folders should also include a blank ``__init__.py`` file, which allows your tests to import files from that folder.
576595
@@ -626,7 +645,7 @@ Of those files, the ``pytest.ini`` config file is the most important, followed b
626645
627646
--------
628647
629-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Log files from failed tests:</h3>
648+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Log files from failed tests:</h3>
630649
631650
Let's try an example of a test that fails:
632651
@@ -651,7 +670,7 @@ pytest test_fail.py
651670
652671
--------
653672
654-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> The SeleniumBase Dashboard:</h3>
673+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> The SeleniumBase Dashboard:</h3>
655674
656675
🔵 The ``--dashboard`` option for pytest generates a SeleniumBase Dashboard located at ``dashboard.html``, which updates automatically as tests run and produce results. Example:
657676
@@ -680,7 +699,7 @@ pytest test_suite.py --dashboard --rs --headless
680699
--------
681700
682701
<a id="creating_visual_reports"></a>
683-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Generating Test Reports:</h3>
702+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Generating Test Reports:</h3>
684703
685704
<h4><b>Pytest Reports:</b></h4>
686705
@@ -755,7 +774,7 @@ pytest test_suite.py --alluredir=allure_results
755774
```
756775
757776
758-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Using a Proxy Server:</h3>
777+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Using a Proxy Server:</h3>
759778
760779
If you wish to use a proxy server for your browser tests (Chromium or Firefox), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command line.
761780
@@ -784,7 +803,7 @@ pytest proxy_test.py --proxy=proxy1
784803
```
785804
786805
787-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Changing the User-Agent:</h3>
806+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Changing the User-Agent:</h3>
788807
789808
🔵 If you wish to change the User-Agent for your browser tests (Chromium and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
790809
@@ -793,12 +812,12 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
793812
```
794813
795814
796-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Handling Pop-Up / Pop Up Alerts:</h3>
815+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Handling Pop-Up / Pop Up Alerts:</h3>
797816
798817
🔵 <code>self.accept_alert()</code> automatically waits for and accepts alert pop-ups. <code>self.dismiss_alert()</code> automatically waits for and dismisses alert pop-ups. On occasion, some methods like <code>self.click(SELECTOR)</code> might dismiss a pop-up on its own because they call JavaScript to make sure that the <code>readyState</code> of the page is <code>complete</code> before advancing. If you're trying to accept a pop-up that got dismissed this way, use this workaround: Call <code>self.find_element(SELECTOR).click()</code> instead, (which will let the pop-up remain on the screen), and then use <code>self.accept_alert()</code> to accept the pop-up (<a href="https://github.com/seleniumbase/SeleniumBase/issues/600#issuecomment-647270426">more on that here</a>). If pop-ups are intermittent, wrap code in a try/except block.
799818
800819
801-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
820+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
802821
803822
🔵 Learn about <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">SeleniumBase Interactive Walkthroughs</a> (in the ``examples/tour_examples/`` folder). It's great for prototyping a website onboarding experience.
804823
@@ -808,7 +827,7 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
808827
--------
809828
810829
<div></div>
811-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Production Environments & Integrations:</h3>
830+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Production Environments & Integrations:</h3>
812831
813832
<div></div>
814833
<details>
@@ -834,7 +853,7 @@ pytest [YOUR_TEST_FILE.py] --with-db-reporting --with-s3-logging
834853
835854
836855
<a id="detailed_method_specifications"></a>
837-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Detailed Method Specifications and Examples:</h3>
856+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Detailed Method Specifications and Examples:</h3>
838857
839858
🔵 Navigating to a web page: (and related commands)
840859
@@ -1128,7 +1147,7 @@ pytest --reruns=1 --reruns-delay=1
11281147
<p>You can use the <code>@retry_on_exception()</code> decorator to retry failing methods. (First import: <code>from seleniumbase import decorators</code>). To learn more about SeleniumBase decorators, <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/common">click here</a>.</p>
11291148
11301149
1131-
<h3><img src="https://seleniumbase.github.io/img/green_logo2.png" title="SeleniumBase" width="32" /> Wrap-Up</h3>
1150+
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Wrap-Up</h3>
11321151
11331152
<b>Congratulations on getting started with SeleniumBase!</b>
11341153

0 commit comments

Comments
 (0)