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 4
4
sb = sb_cdp .Chrome (url , incognito = True )
5
5
sb .sleep (2.2 )
6
6
sb .gui_click_captcha ()
7
- sb .highlight ('h1:contains("GitLab.com ")' )
7
+ sb .highlight ('h1:contains("GitLab")' )
8
8
sb .highlight ('button:contains("Sign in")' )
9
9
sb .driver .stop ()
Original file line number Diff line number Diff line change 9
9
sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
10
10
sb .assert_element ('label[for="user_login"]' )
11
11
sb .highlight ('button:contains("Sign in")' )
12
- sb .highlight ('h1:contains("GitLab.com ")' )
12
+ sb .highlight ('h1:contains("GitLab")' )
13
13
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():
43
43
if row .strip () != "" :
44
44
data .append (row .strip ())
45
45
print ("\n " .join (data ).replace ('\n "' , ' "' ))
46
+ sb .click_if_visible (pop_up )
46
47
sb .sleep (3 )
47
48
sb .driver .stop ()
48
49
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ def test_presentation(self):
353
353
sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
354
354
sb .assert_element ('[for="user_login"]' )
355
355
sb .highlight ('button:contains("Sign in")' )
356
- sb .highlight ('h1:contains("GitLab.com ")' )
356
+ sb .highlight ('h1:contains("GitLab")' )
357
357
sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
358
358
359
359
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):
63
63
sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
64
64
sb .assert_element ('[for="user_login"]' )
65
65
sb .highlight ('button:contains("Sign in")' )
66
- sb .highlight ('h1:contains("GitLab.com ")' )
66
+ sb .highlight ('h1:contains("GitLab")' )
67
67
sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
68
68
69
69
self .create_presentation (theme = "serif" , transition = "none" )
@@ -91,7 +91,7 @@ def test_presentation_3(self):
91
91
'<mk-2> sb.assert_element(\' [for="user_login"]\' )</mk-2>\n '
92
92
'<mk-3> sb.highlight(\' button:contains("Sign in")\' )'
93
93
'</mk-3>\n '
94
- '<mk-4> sb.highlight(\' h1:contains("GitLab.com ")\' )'
94
+ '<mk-4> sb.highlight(\' h1:contains("GitLab")\' )'
95
95
'</mk-4>\n '
96
96
'<mk-5> sb.post_message("SeleniumBase wasn\' t detected",'
97
97
' duration=4)</mk-5>\n '
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ def test_presentation_4(self):
390
390
sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
391
391
sb .assert_element ('label[for="user_login"]' )
392
392
sb .highlight ('button:contains("Sign in")' )
393
- sb .highlight ('h1:contains("GitLab.com ")' )
393
+ sb .highlight ('h1:contains("GitLab")' )
394
394
sb .post_message ("SeleniumBase wasn't detected" , duration = 8 )
395
395
396
396
self .create_presentation (theme = "serif" , transition = "none" )
@@ -528,6 +528,12 @@ def test_presentation_4(self):
528
528
required_text = "Catan"
529
529
sb .cdp .press_keys ('input[aria-label="Search"]' , search + "\n " )
530
530
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 )
531
537
sb .cdp .remove_elements ('[data-testid="skyline-ad"]' )
532
538
print ('*** Walmart Search for "%s":' % search )
533
539
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):
45
45
if row .strip () != "" :
46
46
data .append (row .strip ())
47
47
print ("\n " .join (data ).replace ('\n "' , ' "' ))
48
+ self .click_if_visible (pop_up )
48
49
self .sleep (3 )
Original file line number Diff line number Diff line change 8
8
sb .assert_text ("Username" , '[for="user_login"]' , timeout = 3 )
9
9
sb .assert_element ('label[for="user_login"]' )
10
10
sb .highlight ('button:contains("Sign in")' )
11
- sb .highlight ('h1:contains("GitLab.com ")' )
11
+ sb .highlight ('h1:contains("GitLab")' )
12
12
sb .post_message ("SeleniumBase wasn't detected" , duration = 4 )
You can’t perform that action at this time.
0 commit comments