Skip to content

Commit de2fec9

Browse files
committed
Update example tests
1 parent 645c071 commit de2fec9

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

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)