Update example tests

This commit is contained in:
Michael Mintz 2022-05-25 22:06:36 -04:00
parent 645c071680
commit de2fec9ac2
4 changed files with 12 additions and 13 deletions

View File

@ -354,13 +354,11 @@ class HackTests(BaseCase):
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/guides"]', "")
self.set_text_content("h1", ayb)
self.set_text_content('[class*="link-button"] a[href*="free"]', abtu)
self.set_text_content("h1", aybabtu)
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/enterprise"]', loops=3, scroll=False)
self.highlight("h1", loops=3, scroll=False)
self.highlight('[class*="link-button"] a[href*="free"]', scroll=False)
self.highlight("h1", loops=6, scroll=False)
self.open("https://status.iboss.com/ibcloud/app/cloudStatus.html")
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.highlight("li.nav-item-free-trial", 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.set_text_content("header p", aybabtu)

View File

@ -33,16 +33,14 @@ class MyTestClass(BaseCase):
#
# **** 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".
# Other selectors include: "LINK_TEXT", "PARTIAL_LINK_TEXT", "NAME",
# "CLASS_NAME", and "ID", but most of those can be expressed as CSS.
# Other selectors include: "link text", "partial link text", "name",
# "class name", and "id", but most of those can be expressed as CSS.
#
# Here's an example of changing the "by":
# [
# from selenium.webdriver.common.by import By
# ...
# self.click('Next', by=By.PARTIAL_LINK_TEXT)
# self.click('Next', by="partial link text")
# ]
#
# XPath is used by default if the arg starts with "/", "./", or "(":

View File

@ -16,8 +16,8 @@ class DeferredAssertTests(BaseCase):
self.deferred_assert_element('img[alt="Brand Identity"]')
self.deferred_assert_element('img[alt="Rocket Ship"]') # Will Fail
self.deferred_assert_element("#comicmap")
self.deferred_assert_text("Fake Item", "#middleContainer") # Will Fail
self.deferred_assert_text("Random", "#middleContainer")
self.deferred_assert_text("Fake Item", "ul.comicNav") # Will Fail
self.deferred_assert_text("Random", "ul.comicNav")
self.deferred_assert_element('a[name="Super Fake !!!"]') # Will Fail
self.deferred_assert_exact_text("Brand Identity", "#ctitle")
self.deferred_assert_exact_text("Fake Food", "#comic") # Will Fail

View File

@ -5,6 +5,9 @@ class YouTubeSearchTests(BaseCase):
def test_youtube_autocomplete_results(self):
"""Verify YouTube autocomplete search results."""
self.open("https://www.youtube.com/c/MichaelMintz")
self.delete_all_cookies()
self.clear_local_storage()
self.clear_session_storage()
search_term = "seleniumbase"
search_selector = "input#search"
result_selector = 'li[role="presentation"]'