Update example tests
This commit is contained in:
parent
645c071680
commit
de2fec9ac2
|
@ -354,13 +354,11 @@ class HackTests(BaseCase):
|
||||||
self.set_text_content('a[href*="jira/enterprise"]', abtu)
|
self.set_text_content('a[href*="jira/enterprise"]', abtu)
|
||||||
self.set_text_content('a[href="/software/jira/features"]', "")
|
self.set_text_content('a[href="/software/jira/features"]', "")
|
||||||
self.set_text_content('a[href="/software/jira/guides"]', "")
|
self.set_text_content('a[href="/software/jira/guides"]', "")
|
||||||
self.set_text_content("h1", ayb)
|
self.set_text_content("h1", aybabtu)
|
||||||
self.set_text_content('[class*="link-button"] a[href*="free"]', abtu)
|
|
||||||
self.highlight("ul.imkt-navbar__link-list", loops=2, scroll=False)
|
self.highlight("ul.imkt-navbar__link-list", loops=2, scroll=False)
|
||||||
self.highlight('a[href*="jira/pricing"]', loops=3, scroll=False)
|
self.highlight('a[href*="jira/pricing"]', loops=3, scroll=False)
|
||||||
self.highlight('a[href*="jira/enterprise"]', loops=3, scroll=False)
|
self.highlight('a[href*="jira/enterprise"]', loops=3, scroll=False)
|
||||||
self.highlight("h1", loops=3, scroll=False)
|
self.highlight("h1", loops=6, scroll=False)
|
||||||
self.highlight('[class*="link-button"] a[href*="free"]', scroll=False)
|
|
||||||
|
|
||||||
self.open("https://status.iboss.com/ibcloud/app/cloudStatus.html")
|
self.open("https://status.iboss.com/ibcloud/app/cloudStatus.html")
|
||||||
self.set_text_content('div[translate*="cloudStatus"]', ayb)
|
self.set_text_content('div[translate*="cloudStatus"]', ayb)
|
||||||
|
@ -390,7 +388,7 @@ class HackTests(BaseCase):
|
||||||
self.set_text_content("p.homepage-signup-form-banner", aybabtu)
|
self.set_text_content("p.homepage-signup-form-banner", aybabtu)
|
||||||
self.highlight("li.nav-item-free-trial", loops=6, scroll=False)
|
self.highlight("li.nav-item-free-trial", loops=6, scroll=False)
|
||||||
self.highlight("h1", loops=6, scroll=False)
|
self.highlight("h1", loops=6, scroll=False)
|
||||||
self.highlight('p[class*="signup-form"]', loops=8, scroll=False)
|
self.highlight('p[class*="signup-form"]', loops=6, scroll=False)
|
||||||
|
|
||||||
self.open("https://pragprog.com/")
|
self.open("https://pragprog.com/")
|
||||||
self.set_text_content("header p", aybabtu)
|
self.set_text_content("header p", aybabtu)
|
||||||
|
|
|
@ -33,16 +33,14 @@ class MyTestClass(BaseCase):
|
||||||
#
|
#
|
||||||
# **** NOTES / USEFUL INFO ****
|
# **** NOTES / USEFUL INFO ****
|
||||||
#
|
#
|
||||||
# 1. By default, CSS Selectors are used to identify elements.
|
# 1. By default, page elements are identified by "css selector".
|
||||||
# CSS Guide: "https://www.w3schools.com/cssref/css_selectors.asp".
|
# CSS Guide: "https://www.w3schools.com/cssref/css_selectors.asp".
|
||||||
# Other selectors include: "LINK_TEXT", "PARTIAL_LINK_TEXT", "NAME",
|
# Other selectors include: "link text", "partial link text", "name",
|
||||||
# "CLASS_NAME", and "ID", but most of those can be expressed as CSS.
|
# "class name", and "id", but most of those can be expressed as CSS.
|
||||||
#
|
#
|
||||||
# Here's an example of changing the "by":
|
# Here's an example of changing the "by":
|
||||||
# [
|
# [
|
||||||
# from selenium.webdriver.common.by import By
|
# self.click('Next', by="partial link text")
|
||||||
# ...
|
|
||||||
# self.click('Next', by=By.PARTIAL_LINK_TEXT)
|
|
||||||
# ]
|
# ]
|
||||||
#
|
#
|
||||||
# XPath is used by default if the arg starts with "/", "./", or "(":
|
# XPath is used by default if the arg starts with "/", "./", or "(":
|
||||||
|
|
|
@ -16,8 +16,8 @@ class DeferredAssertTests(BaseCase):
|
||||||
self.deferred_assert_element('img[alt="Brand Identity"]')
|
self.deferred_assert_element('img[alt="Brand Identity"]')
|
||||||
self.deferred_assert_element('img[alt="Rocket Ship"]') # Will Fail
|
self.deferred_assert_element('img[alt="Rocket Ship"]') # Will Fail
|
||||||
self.deferred_assert_element("#comicmap")
|
self.deferred_assert_element("#comicmap")
|
||||||
self.deferred_assert_text("Fake Item", "#middleContainer") # Will Fail
|
self.deferred_assert_text("Fake Item", "ul.comicNav") # Will Fail
|
||||||
self.deferred_assert_text("Random", "#middleContainer")
|
self.deferred_assert_text("Random", "ul.comicNav")
|
||||||
self.deferred_assert_element('a[name="Super Fake !!!"]') # Will Fail
|
self.deferred_assert_element('a[name="Super Fake !!!"]') # Will Fail
|
||||||
self.deferred_assert_exact_text("Brand Identity", "#ctitle")
|
self.deferred_assert_exact_text("Brand Identity", "#ctitle")
|
||||||
self.deferred_assert_exact_text("Fake Food", "#comic") # Will Fail
|
self.deferred_assert_exact_text("Fake Food", "#comic") # Will Fail
|
||||||
|
|
|
@ -5,6 +5,9 @@ class YouTubeSearchTests(BaseCase):
|
||||||
def test_youtube_autocomplete_results(self):
|
def test_youtube_autocomplete_results(self):
|
||||||
"""Verify YouTube autocomplete search results."""
|
"""Verify YouTube autocomplete search results."""
|
||||||
self.open("https://www.youtube.com/c/MichaelMintz")
|
self.open("https://www.youtube.com/c/MichaelMintz")
|
||||||
|
self.delete_all_cookies()
|
||||||
|
self.clear_local_storage()
|
||||||
|
self.clear_session_storage()
|
||||||
search_term = "seleniumbase"
|
search_term = "seleniumbase"
|
||||||
search_selector = "input#search"
|
search_selector = "input#search"
|
||||||
result_selector = 'li[role="presentation"]'
|
result_selector = 'li[role="presentation"]'
|
||||||
|
|
Loading…
Reference in New Issue