Skip to content

Commit 233d70b

Browse files
authored
Merge pull request #1339 from seleniumbase/a-bunch-of-updates
Multiple updates
2 parents 7a5db59 + d8c5cdb commit 233d70b

File tree

16 files changed

+590
-343
lines changed

16 files changed

+590
-343
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
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_logo2.png" />
77

8-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_banner_3_wide.png" alt="SeleniumBase" title="SeleniumBase" width="500" /></a></p>
8+
<h3 align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/mac_sb_logo_5.png" alt="SeleniumBase" title="SeleniumBase" width="300" /></a></h3>
9+
910
<!-- View on GitHub -->
1011

11-
<p align="left"><div align="left">✅ Fast, easy, and reliable Web/UI automation & testing with Python.</div></p>
12+
<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>
1213

13-
<p align="left">
14+
<p align="center">
1415
<a href="https://github.com/seleniumbase/SeleniumBase/releases">
1516
<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">
1617
<img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=22AAEE" alt="Latest Release on PyPI" /></a> <a href="https://seleniumbase.io">
1718
<img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBDD.svg" alt="SeleniumBase.io Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions">
1819
<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>
1920
</p>
2021

21-
<p align="left">
22+
<p align="center">
2223
<a href="#python_installation">🚀 Start</a> |
2324
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🎯 Features</a> |
2425
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📝 Examples</a> |
@@ -46,6 +47,15 @@
4647

4748
--------
4849

50+
<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>
51+
52+
```bash
53+
cd examples/
54+
pytest test_demo_site.py
55+
```
56+
57+
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"><img src="https://seleniumbase.io/cdn/gif/demo_page_4.gif" width="400" alt="SeleniumBase Demo Mode" title="SeleniumBase Test" /></a></p>
58+
4959
<details>
5060
<summary> ▶️ <u>How is SeleniumBase different from raw Selenium?</u> (click to expand)</summary>
5161
<div>
@@ -117,15 +127,6 @@ Feature: SeleniumBase scenarios for the RealWorld App
117127
And Save screenshot to logs
118128
```
119129

120-
<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>
121-
122-
```bash
123-
cd examples/
124-
pytest test_demo_site.py
125-
```
126-
127-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"><img src="https://seleniumbase.io/cdn/gif/demo_page_4.gif" width="400" alt="SeleniumBase Demo Mode" title="SeleniumBase Test" /></a></p>
128-
129130
<a id="python_installation"></a>
130131
<h2><img src="https://seleniumbase.io/cdn/img/python_logo.png" title="SeleniumBase" width="42" /> Python Setup:</h2>
131132

examples/hack_the_planet.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,11 @@ def test_all_your_base_are_belong_to_us(self):
354354
self.set_text_content('a[href*="jira/enterprise"]', abtu)
355355
self.set_text_content('a[href="/software/jira/features"]', "")
356356
self.set_text_content('a[href="/software/jira/guides"]', "")
357-
self.set_text_content("h1", ayb)
358-
self.set_text_content('[class*="link-button"] a[href*="free"]', abtu)
357+
self.set_text_content("h1", aybabtu)
359358
self.highlight("ul.imkt-navbar__link-list", loops=2, scroll=False)
360359
self.highlight('a[href*="jira/pricing"]', loops=3, scroll=False)
361360
self.highlight('a[href*="jira/enterprise"]', loops=3, scroll=False)
362-
self.highlight("h1", loops=3, scroll=False)
363-
self.highlight('[class*="link-button"] a[href*="free"]', scroll=False)
361+
self.highlight("h1", loops=6, scroll=False)
364362

365363
self.open("https://status.iboss.com/ibcloud/app/cloudStatus.html")
366364
self.set_text_content('div[translate*="cloudStatus"]', ayb)
@@ -390,7 +388,7 @@ def test_all_your_base_are_belong_to_us(self):
390388
self.set_text_content("p.homepage-signup-form-banner", aybabtu)
391389
self.highlight("li.nav-item-free-trial", loops=6, scroll=False)
392390
self.highlight("h1", loops=6, scroll=False)
393-
self.highlight('p[class*="signup-form"]', loops=8, scroll=False)
391+
self.highlight('p[class*="signup-form"]', loops=6, scroll=False)
394392

395393
self.open("https://pragprog.com/")
396394
self.set_text_content("header p", aybabtu)

examples/my_first_test.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,14 @@ def test_swag_labs(self):
3333
#
3434
# **** NOTES / USEFUL INFO ****
3535
#
36-
# 1. By default, CSS Selectors are used to identify elements.
36+
# 1. By default, page elements are identified by "css selector".
3737
# CSS Guide: "https://www.w3schools.com/cssref/css_selectors.asp".
38-
# Other selectors include: "LINK_TEXT", "PARTIAL_LINK_TEXT", "NAME",
39-
# "CLASS_NAME", and "ID", but most of those can be expressed as CSS.
38+
# Other selectors include: "link text", "partial link text", "name",
39+
# "class name", and "id", but most of those can be expressed as CSS.
4040
#
4141
# Here's an example of changing the "by":
4242
# [
43-
# from selenium.webdriver.common.by import By
44-
# ...
45-
# self.click('Next', by=By.PARTIAL_LINK_TEXT)
43+
# self.click('Next', by="partial link text")
4644
# ]
4745
#
4846
# XPath is used by default if the arg starts with "/", "./", or "(":

examples/test_deferred_asserts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def test_deferred_asserts(self):
1616
self.deferred_assert_element('img[alt="Brand Identity"]')
1717
self.deferred_assert_element('img[alt="Rocket Ship"]') # Will Fail
1818
self.deferred_assert_element("#comicmap")
19-
self.deferred_assert_text("Fake Item", "#middleContainer") # Will Fail
20-
self.deferred_assert_text("Random", "#middleContainer")
19+
self.deferred_assert_text("Fake Item", "ul.comicNav") # Will Fail
20+
self.deferred_assert_text("Random", "ul.comicNav")
2121
self.deferred_assert_element('a[name="Super Fake !!!"]') # Will Fail
2222
self.deferred_assert_exact_text("Brand Identity", "#ctitle")
2323
self.deferred_assert_exact_text("Fake Food", "#comic") # Will Fail

examples/youtube_search_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ class YouTubeSearchTests(BaseCase):
55
def test_youtube_autocomplete_results(self):
66
"""Verify YouTube autocomplete search results."""
77
self.open("https://www.youtube.com/c/MichaelMintz")
8+
self.delete_all_cookies()
9+
self.clear_local_storage()
10+
self.clear_session_storage()
811
search_term = "seleniumbase"
912
search_selector = "input#search"
1013
result_selector = 'li[role="presentation"]'

0 commit comments

Comments
 (0)