File tree Expand file tree Collapse file tree 8 files changed +46
-16
lines changed Expand file tree Collapse file tree 8 files changed +46
-16
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ def test_demo_page(self):
3434 try :
3535 self .hover_and_click ("#myDropdown" , "#dropOption2" , timeout = 1 )
3636 except Exception :
37- # Someone moved the mouse while the test ran
38- self .js_click ( "#dropOption2" )
37+ # Someone probably moved the mouse while the test ran
38+ self .hover_and_js_click ( "#myDropdown" , "#dropOption2" )
3939 self .assert_text ("Link Two Selected" , "h3" )
4040
4141 # Click a button and then verify the expected results
Original file line number Diff line number Diff line change 33
44def open_the_form_turnstile_page (sb ):
55 sb .driver .uc_open_with_reconnect (
6- "https://seleniumbase.io/apps/form_turnstile" , reconnect_time = 2.5 ,
6+ "https://seleniumbase.io/apps/form_turnstile" , reconnect_time = 2.7 ,
77 )
88
99
1010def click_turnstile_and_verify (sb ):
11+ sb .scroll_to_bottom ()
1112 sb .driver .uc_switch_to_frame ("iframe" )
1213 sb .driver .uc_click ("span.mark" )
1314 sb .highlight ("img#captcha-success" , timeout = 3.33 )
Original file line number Diff line number Diff line change 1+ from seleniumbase import SB
2+
3+ with SB (uc = True , test = True ) as sb :
4+ sb .driver .uc_open_with_reconnect ("https://nopecha.com/demo/turnstile" , 5 )
5+ sb .driver .uc_switch_to_frame ("#example-container5 iframe" )
6+ sb .driver .uc_click ("span.mark" )
7+
8+ if sb .is_element_visible ("#example-container0 iframe" ):
9+ sb .switch_to_frame ("#example-container0 iframe" )
10+ if not sb .is_element_visible ("circle.success-circle" ):
11+ sb .driver .uc_click ("span.mark" )
12+ sb .switch_to_frame ("#example-container0 iframe" )
13+ sb .assert_element ("circle.success-circle" )
14+ sb .switch_to_parent_frame ()
15+ sb .switch_to_frame ("#example-container5 iframe" )
16+ sb .assert_element ("svg#success-icon" , timeout = 3 )
17+ sb .switch_to_parent_frame ()
18+ sb .set_messenger_theme (location = "top_center" )
19+ sb .post_message ("Selenium wasn't detected!" , duration = 3 )
Original file line number Diff line number Diff line change 1+ from seleniumbase import SB
2+
3+ with SB (uc = True , incognito = True , test = True ) as sb :
4+ sb .driver .uc_open_with_reconnect ("https://pixelscan.net/" , 11 )
5+ sb .remove_elements ("jdiv" ) # Remove chat widgets
6+ sb .assert_text ("No automation framework detected" , "pxlscn-bot-detection" )
7+ sb .assert_text ("You are not masking your fingerprint" )
8+ sb .highlight ("span.text-success" , loops = 10 )
9+ sb .sleep (1 )
10+ sb .highlight ("pxlscn-fingerprint-masking div" , loops = 10 , scroll = False )
11+ sb .sleep (1 )
12+ sb .highlight ("div.bot-detection-context" , loops = 10 , scroll = False )
13+ sb .sleep (3 )
Original file line number Diff line number Diff line change 33
44def open_the_turnstile_page (sb ):
55 sb .driver .uc_open_with_reconnect (
6- "https://seleniumbase.io/apps/turnstile" , reconnect_time = 2.5 ,
6+ "https://seleniumbase.io/apps/turnstile" , reconnect_time = 2.7 ,
77 )
88
99
Original file line number Diff line number Diff line change 22from seleniumbase import SB
33
44with SB (uc = True , test = True ) as sb :
5- sb .driver .uc_open_with_reconnect ("https://top.gg/" , 4 )
5+ sb .driver .uc_open_with_reconnect ("https://top.gg/" , 5 )
66 if not sb .is_text_visible ("Discord Bots" , "h1" ):
7- sb .get_new_driver (undetectable = True )
87 sb .driver .uc_open_with_reconnect ("https://top.gg/" , 5 )
9- sb .activate_demo_mode () # Highlight + show assertions
108 sb .assert_text ("Discord Bots" , "h1" , timeout = 3 )
9+ sb .highlight ("h1" , loops = 3 )
10+ sb .set_messenger_theme (location = "top_center" )
11+ sb .post_message ("Selenium wasn't detected!" , duration = 3 )
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ def test_demo_site(self):
2929 try :
3030 self .hover_and_click ("#myDropdown" , "#dropOption2" , timeout = 1 )
3131 except Exception :
32- # Someone moved the mouse while the test ran
33- self .js_click ( "#dropOption2" )
32+ # Someone probably moved the mouse while the test ran
33+ self .hover_and_js_click ( "#myDropdown" , "#dropOption2" )
3434 self .assert_text ("Link Two Selected" , "h3" )
3535
3636 # Click a button and then verify the expected results
Original file line number Diff line number Diff line change @@ -9,15 +9,11 @@ class UndetectedTest(BaseCase):
99 def test_browser_is_undetected (self ):
1010 if not self .undetectable :
1111 self .get_new_driver (undetectable = True )
12- self .driver .uc_open_with_reconnect (
13- "https://top.gg/" , reconnect_time = 4
14- )
12+ self .driver .uc_open_with_reconnect ("https://top.gg/" , 5 )
1513 if not self .is_text_visible ("Discord Bots" , "h1" ):
1614 self .get_new_driver (undetectable = True )
17- self .driver .uc_open_with_reconnect (
18- "https://top.gg/" , reconnect_time = 5
19- )
15+ self .driver .uc_open_with_reconnect ("https://top.gg/" , 5 )
2016 self .assert_text ("Discord Bots" , "h1" , timeout = 3 )
21- self .set_messenger_theme (theme = "air" , location = "top_center" )
17+ self .set_messenger_theme (location = "top_center" )
2218 self .post_message ("Selenium wasn't detected!" , duration = 2.8 )
2319 self ._print ("\n Success! Website did not detect Selenium! " )
You can’t perform that action at this time.
0 commit comments