File tree Expand file tree Collapse file tree 9 files changed +27
-7
lines changed Expand file tree Collapse file tree 9 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 44sb = sb_cdp .Chrome (url , incognito = True )
55sb .sleep (2.2 )
66sb .gui_click_captcha ()
7- sb .highlight ('h1:contains("GitLab.com ")' )
7+ sb .highlight ('h1:contains("GitLab")' )
88sb .highlight ('button:contains("Sign in")' )
99sb .driver .stop ()
Original file line number Diff line number Diff line change 99 sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
1010 sb .assert_element ('label[for="user_login"]' )
1111 sb .highlight ('button:contains("Sign in")' )
12- sb .highlight ('h1:contains("GitLab.com ")' )
12+ sb .highlight ('h1:contains("GitLab")' )
1313 sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
Original file line number Diff line number Diff line change 1+ from seleniumbase import sb_cdp
2+
3+ url = "https://seleniumbase.io/realworld/login"
4+ sb = sb_cdp .Chrome (url )
5+ sb .type ("#username" , "demo_user" )
6+ sb .type ("#password" , "secret_pass" )
7+ sb .enter_mfa_code ("#totpcode" , "GAXG2MTEOR3DMMDG" )
8+ sb .assert_text ("Welcome!" , "h1" )
9+ sb .click ('a:contains("This Page")' )
10+ sb .highlight ("h1" )
11+ sb .highlight ("img#image1" )
12+ sb .driver .stop ()
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ def main():
4343 if row .strip () != "" :
4444 data .append (row .strip ())
4545 print ("\n " .join (data ).replace ('\n "' , ' "' ))
46+ sb .click_if_visible (pop_up )
4647 sb .sleep (3 )
4748 sb .driver .stop ()
4849
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ def test_presentation(self):
353353 sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
354354 sb .assert_element ('[for="user_login"]' )
355355 sb .highlight ('button:contains("Sign in")' )
356- sb .highlight ('h1:contains("GitLab.com ")' )
356+ sb .highlight ('h1:contains("GitLab")' )
357357 sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
358358
359359 self .create_presentation (theme = "serif" , transition = "fade" )
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def test_presentation_3(self):
6363 sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
6464 sb .assert_element ('[for="user_login"]' )
6565 sb .highlight ('button:contains("Sign in")' )
66- sb .highlight ('h1:contains("GitLab.com ")' )
66+ sb .highlight ('h1:contains("GitLab")' )
6767 sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
6868
6969 self .create_presentation (theme = "serif" , transition = "none" )
@@ -91,7 +91,7 @@ def test_presentation_3(self):
9191 '<mk-2> sb.assert_element(\' [for="user_login"]\' )</mk-2>\n '
9292 '<mk-3> sb.highlight(\' button:contains("Sign in")\' )'
9393 '</mk-3>\n '
94- '<mk-4> sb.highlight(\' h1:contains("GitLab.com ")\' )'
94+ '<mk-4> sb.highlight(\' h1:contains("GitLab")\' )'
9595 '</mk-4>\n '
9696 '<mk-5> sb.post_message("SeleniumBase wasn\' t detected",'
9797 ' duration=4)</mk-5>\n '
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ def test_presentation_4(self):
390390 sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
391391 sb .assert_element ('label[for="user_login"]' )
392392 sb .highlight ('button:contains("Sign in")' )
393- sb .highlight ('h1:contains("GitLab.com ")' )
393+ sb .highlight ('h1:contains("GitLab")' )
394394 sb .post_message ("SeleniumBase wasn't detected" , duration = 8 )
395395
396396 self .create_presentation (theme = "serif" , transition = "none" )
@@ -528,6 +528,12 @@ def test_presentation_4(self):
528528 required_text = "Catan"
529529 sb .cdp .press_keys ('input[aria-label="Search"]' , search + "\n " )
530530 sb .sleep (3.8 )
531+ if sb .is_element_visible ("#px-captcha" ):
532+ sb .cdp .gui_click_and_hold ("#px-captcha" , 12 )
533+ sb .sleep (3.2 )
534+ if sb .is_element_visible ("#px-captcha" ):
535+ sb .cdp .gui_click_and_hold ("#px-captcha" , 12 )
536+ sb .sleep (3.2 )
531537 sb .cdp .remove_elements ('[data-testid="skyline-ad"]' )
532538 print ('*** Walmart Search for "%s":' % search )
533539 print (' (Results must contain "%s".)' % required_text )
Original file line number Diff line number Diff line change @@ -45,4 +45,5 @@ def test_proxy(self):
4545 if row .strip () != "" :
4646 data .append (row .strip ())
4747 print ("\n " .join (data ).replace ('\n "' , ' "' ))
48+ self .click_if_visible (pop_up )
4849 self .sleep (3 )
Original file line number Diff line number Diff line change 88 sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
99 sb .assert_element ('label[for="user_login"]' )
1010 sb .highlight ('button:contains("Sign in")' )
11- sb .highlight ('h1:contains("GitLab.com ")' )
11+ sb .highlight ('h1:contains("GitLab")' )
1212 sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
You can’t perform that action at this time.
0 commit comments