Skip to content

Commit 9aba60f

Browse files
committed
Update the ReadMe
1 parent e3782ab commit 9aba60f

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ nosetests test_suite.py --browser=firefox
212212
```
213213
214214
✅ Automatic Test Discovery:
215-
<p>All Python methods that start with <code>test_</code> will automatically be run when using <code>pytest</code> or <code>nosetests</code> on a Python file, (<i>or on folders containing Python files</i>). You can also be more specific on what to run within a file by using the following: (<i>Note that the syntax is different for pytest vs nosetests.</i>)</p>
215+
<p>All Python methods that start with <code>test_</code> will be run automatically when running <code>pytest</code> or <code>nosetests</code> on Python files. You can also be more specific on what to run within a file by using the following: (<i>Note that the syntax is different for pytest vs nosetests.</i>)</p>
216216
217217
```bash
218218
pytest [FILE_NAME.py]::[CLASS_NAME]::[METHOD_NAME]
@@ -232,13 +232,10 @@ nosetests [FILE_NAME.py]:[CLASS_NAME].[METHOD_NAME]
232232
233233
234234
<a id="detailed_instructions"></a>
235-
<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="300">
236-
237235
<h2><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Detailed Instructions:</h2>
238236
239-
<a id="seleniumbase_demo_mode"></a> <b>Use Demo Mode to help you see what tests are asserting.</b>
240-
241-
🔵 If the example test is moving too fast for your eyes, you can run it in **Demo Mode** by adding ``--demo`` on the command-line, which pauses the browser briefly between actions, highlights page elements being acted on, and lets you know what test assertions are happening in real time:
237+
<a id="seleniumbase_demo_mode"></a>
238+
🔵 You can use **Demo Mode** to help you see what a test is doing: If a test is moving too fast for your eyes, run it in **Demo Mode** by adding ``--demo`` on the command-line, which pauses the browser briefly between actions, highlights page elements being acted on, and displays assertions:
242239
243240
```bash
244241
pytest my_first_test.py --demo
@@ -764,6 +761,8 @@ def get_mirror_universe_captain_picard_superbowl_ad(superbowl_year):
764761
selector = "div.superbowl_%s div.commercials div.transcript div.picard" % superbowl_year
765762
if self.is_text_visible("Yes, it was I who summoned you all here.", selector):
766763
return "Picard Paramount+ Superbowl Ad 2020"
764+
elif self.is_text_visible("Commander, signal the following: Our Network is Secure!"):
765+
return "Picard Mirror Universe iboss Superbowl Ad 2018"
767766
elif self.is_text_visible("For the Love of Marketing and Earl Grey Tea!", selector):
768767
return "Picard Mirror Universe HubSpot Superbowl Ad 2015"
769768
elif self.is_text_visible("Delivery Drones... Engage", selector):
@@ -774,19 +773,19 @@ def get_mirror_universe_captain_picard_superbowl_ad(superbowl_year):
774773
return "Picard Mirror Universe Google Superbowl Ad 2015"
775774
elif self.is_text_visible("Number One, I've Never Seen Anything Like It.", selector):
776775
return "Picard Mirror Universe Tesla Superbowl Ad 2015"
776+
elif self.is_text_visible("Let us make sure history never forgets the name ... Facebook", selector):
777+
return "Picard Mirror Universe Facebook Superbowl Ad 2015"
777778
elif self.is_text_visible("""With the first link, the chain is forged.
778779
The first speech censored, the first thought forbidden,
779780
the first freedom denied, chains us all irrevocably.""", selector):
780781
return "Picard Mirror Universe Wikimedia Superbowl Ad 2015"
781-
elif self.is_text_visible("Let us make sure history never forgets the name ... Facebook", selector):
782-
return "Picard Mirror Universe Facebook Superbowl Ad 2015"
783782
else:
784783
raise Exception("Reports of my assimilation are greatly exaggerated.")
785784
```
786785
787786
🔵 Switching Tabs:
788787
789-
<p>What if your test opens up a new tab/window and now you have more than one page? No problem. You need to specify which one you currently want Selenium to use. Switching between tabs/windows is easy:</p>
788+
<p>If your test opens up a new tab/window, you can switch to it. (SeleniumBase automatically switches to new tabs that don't open to ``about:blank`` URLs.)</p>
790789
791790
```python
792791
self.switch_to_window(1) # This switches to the new tab (0 is the first one)
@@ -841,6 +840,8 @@ self.execute_script("return jQuery('div#amazing')[0].text") # Returns the css "
841840
self.execute_script("return jQuery('textarea')[2].value") # Returns the css "value" of the 3rd textarea element on the page
842841
```
843842
843+
(Most of the above commands can be done directly with built-in SeleniumBase methods.)
844+
844845
🔵 In the next example, JavaScript creates a referral button on a page, which is then clicked:
845846
846847
```python
@@ -916,13 +917,15 @@ pytest --reruns=1 --reruns-delay=1
916917
</p>
917918
<p><div><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></div></p>
918919
919-
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/fancy_logo_14.png" title="SeleniumBase" width="290" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" title="SeleniumBase" alt="Join the chat!" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a></div> <div><a href="https://seleniumbase.io">
920+
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/fancy_logo_14.png" title="SeleniumBase" width="200" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" title="SeleniumBase" alt="Join the chat!" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a></div> <div><a href="https://seleniumbase.io">
920921
<img src="https://img.shields.io/badge/docs-%20%20SeleniumBase.io-11BBDD.svg" alt="SeleniumBase.io Docs" /></a></div> <div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <a href="https://twitter.com/SeleniumBase" target="_blank"><img src="https://img.shields.io/twitter/follow/seleniumbase.svg?style=flat-rounded&logo=twitter&label=followers" alt="SeleniumBase Twitter followers" /></a></div>
921922
922923
<p><div>
923924
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="38" /></a></span>
924925
<span><a href="https://www.facebook.com/SeleniumBase" target="_blank"><img src="https://seleniumbase.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="36" /></a></span>
925-
<span><a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://seleniumbase.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="29" /></a></span>
926+
<span><a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://seleniumbase.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="30" /></a></span>
926927
<span><a href="https://instagram.com/seleniumbase" target="_blank"><img src="https://seleniumbase.io/img/social/share_instagram.svg" title="SeleniumBase on Instagram" alt="SeleniumBase on Instagram" width="32" /></a></span>
927928
<span><a href="https://twitter.com/seleniumbase" target="_blank"><img src="https://seleniumbase.io/img/social/share_twitter.svg" title="SeleniumBase on Twitter" alt="SeleniumBase on Twitter" width="39" /></a></span>
928929
</div></p>
930+
931+
<a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" title="SeleniumBase" width="200" /></a>

0 commit comments

Comments
 (0)