Update an example test

This commit is contained in:
Michael Mintz 2022-08-24 10:30:22 -04:00
parent f512989b99
commit 974cd3f532
1 changed files with 11 additions and 8 deletions

View File

@ -5,11 +5,14 @@ import pytest
class Test_UseFixtures:
def test_usefixtures_on_class(self):
sb = self.sb
sb.open("https://google.com/ncr")
sb.type('input[title="Search"]', "SeleniumBase GitHub\n")
sb.click('a[href*="github.com/seleniumbase/SeleniumBase"]')
sb.assert_text("SeleniumBase", 'strong[itemprop="name"]')
sb.assert_text("integrations")
sb.assert_element('a[title="help_docs"]')
sb.click('a[title="examples"]')
sb.assert_exact_text("examples", "strong.final-path")
sb.open("https://seleniumbase.io/realworld/login")
sb.type("#username", "demo_user")
sb.type("#password", "secret_pass")
sb.enter_mfa_code("#totpcode", "GAXG2MTEOR3DMMDG") # 6-digit
sb.assert_text("Welcome!", "h1")
sb.highlight("img#image1") # A fancier assert_element() call
sb.click('a:contains("This Page")')
sb.save_screenshot_to_logs() # In "./latest_logs/" folder.
sb.click_link("Sign out") # Must be "a" tag. Not "button".
sb.assert_element('a:contains("Sign in")')
sb.assert_exact_text("You have been signed out!", "#top_message")