From 353dc29444e3ca19543ab70f7977b6f5b27d1c7c Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Tue, 18 Jul 2023 15:18:35 -0400 Subject: [PATCH] Update examples --- examples/hack_the_planet.py | 4 ++-- examples/test_download_files.py | 1 + examples/test_error_page.py | 2 +- examples/test_geolocation.py | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/hack_the_planet.py b/examples/hack_the_planet.py index 0b7bc08d..60ed4a1c 100644 --- a/examples/hack_the_planet.py +++ b/examples/hack_the_planet.py @@ -196,7 +196,7 @@ class HackTests(BaseCase): self.set_text_content('a[prettyslug="your-profile"]', "BASE") self.set_text_content('a[prettyslug="connect-tools"]', "ARE") self.set_text_content('a[prettyslug="administration"]', "BELONG") - self.set_text_content('a[prettyslug="tutorials"]', "TO US") + self.set_text_content('a[prettyslug*="tutorials"]', "TO US") self.set_text_content("h1.article_title", aybabtu) self.highlight("h1", loops=4, scroll=False) self.highlight("div#global_menu", loops=2, scroll=False) @@ -205,7 +205,7 @@ class HackTests(BaseCase): self.highlight('a[prettyslug="your-profile"]', loops=2, scroll=False) self.highlight('a[prettyslug="connect-tools"]', loops=1, scroll=False) self.highlight('a[prettyslug="administration"]', loops=1, scroll=False) - self.highlight('a[prettyslug="tutorials"]', loops=2, scroll=False) + self.highlight('a[prettyslug*="tutorials"]', loops=2, scroll=False) self.highlight("h1.article_title", loops=5, scroll=False) self.open("https://kubernetes.io/") diff --git a/examples/test_download_files.py b/examples/test_download_files.py index e7d5ea99..537a1e5d 100644 --- a/examples/test_download_files.py +++ b/examples/test_download_files.py @@ -1,6 +1,7 @@ """Use SeleniumBase to download files and verify.""" import math from seleniumbase import BaseCase +BaseCase.main(__name__, __file__) class DownloadTests(BaseCase): diff --git a/examples/test_error_page.py b/examples/test_error_page.py index 8a3a3832..094b3067 100644 --- a/examples/test_error_page.py +++ b/examples/test_error_page.py @@ -14,4 +14,4 @@ class ErrorPageTests(BaseCase): self.highlight('img[alt*="404"]') self.highlight("img#octobi_wan_catnobi") self.highlight("img#speeder") - self.save_screenshot_after_test = True # Automatic if test fails + self.save_screenshot_after_test = True diff --git a/examples/test_geolocation.py b/examples/test_geolocation.py index c96047aa..df907b93 100644 --- a/examples/test_geolocation.py +++ b/examples/test_geolocation.py @@ -36,5 +36,6 @@ class TestGeolocation(BaseCase): self.open("https://www.openstreetmap.org/") self.click("span.geolocate") self.assert_url_contains("48.87645/2.26340") + self.save_screenshot_to_logs() if not (self.headless or self.headless2 or self.xvfb): self.sleep(2.5)