File tree Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 33
44with SB (uc = True , test = True ) as sb :
55 url = "https://www.bing.com/turing/captcha/challenge"
6- sb .driver .uc_open_with_tab (url )
6+ sb .driver .uc_open_with_reconnect (url , 1.25 )
77 sb .add_css_style ("iframe{zoom: 2}" ) # Make it bigger
88 sb .switch_to_frame ("iframe" )
9+ if not sb .is_element_visible ("div#success" ):
10+ sb .driver .uc_open_with_reconnect (url , 4.05 )
11+ sb .add_css_style ("iframe{zoom: 2}" )
12+ sb .switch_to_frame ("iframe" )
13+ sb .highlight ("div#success" , loops = 2 )
14+ sb .assert_text ("Success!" , "span#success-text" )
915 sb .activate_demo_mode () # See asserts as they happen
1016 sb .assert_element ("svg#success-icon" )
11- sb .assert_text ("Success!" , "span#success-text" )
12- sb .highlight ("div#success" )
Original file line number Diff line number Diff line change 11from seleniumbase import SB
22
33with SB (uc = True , test = True ) as sb :
4- sb .driver .uc_open_with_reconnect ("nopecha.com/demo/turnstile" , 4.2 )
4+ sb .driver .uc_open_with_reconnect ("nopecha.com/demo/turnstile" , 4.5 )
55 sb .switch_to_frame ("#example-container5 iframe" )
6- sb .driver .uc_click ("span.mark" )
6+ sb .driver .uc_click ("span.mark" , reconnect_time = 3 )
77
88 if sb .is_element_visible ("#example-container0 iframe" ):
99 sb .switch_to_frame ("#example-container0 iframe" )
1010 if not sb .is_element_visible ("circle.success-circle" ):
11- sb .driver .uc_click ("span.mark" )
11+ sb .driver .uc_click ("span.mark" , reconnect_time = 3 )
1212 sb .switch_to_frame ("#example-container0 iframe" )
1313 sb .assert_element ("circle.success-circle" )
1414 sb .switch_to_parent_frame ()
1717 sb .assert_element ("svg#success-icon" , timeout = 3 )
1818 sb .switch_to_parent_frame ()
1919 sb .set_messenger_theme (location = "top_center" )
20- sb .post_message ("Selenium wasn't detected!" , duration = 3 )
20+ sb .post_message ("SeleniumBase wasn't detected!" , duration = 3 )
Original file line number Diff line number Diff line change 11from seleniumbase import SB
22
33with SB (uc = True , incognito = True , test = True ) as sb :
4- sb .driver .uc_open_with_reconnect ("https://pixelscan.net/" , 11 )
4+ sb .driver .uc_open_with_reconnect ("https://pixelscan.net/" , 10 )
55 sb .remove_elements ("jdiv" ) # Remove chat widgets
66 sb .assert_text ("No automation framework detected" , "pxlscn-bot-detection" )
77 sb .assert_text ("You are not masking your fingerprint" )
8- sb .highlight ("span.text-success" , loops = 10 )
8+ sb .highlight ("span.text-success" , loops = 8 )
99 sb .sleep (1 )
10- sb .highlight ("pxlscn-fingerprint-masking div" , loops = 10 , scroll = False )
10+ sb .highlight ("pxlscn-fingerprint-masking div" , loops = 9 , scroll = False )
1111 sb .sleep (1 )
1212 sb .highlight ("div.bot-detection-context" , loops = 10 , scroll = False )
13- sb .sleep (3 )
13+ sb .sleep (2 )
Original file line number Diff line number Diff line change @@ -16,5 +16,7 @@ def test_docs(self):
1616 self .assert_text ("Recorder Mode" , "h1" )
1717 self .js_click ('a[href$="/method_summary/"]' )
1818 self .assert_text ("API Reference" , "h1" )
19+ self .js_click ('a[href$="/uc_mode/"]' )
20+ self .assert_text ("UC Mode" , "h1" )
1921 self .click ('img[alt="logo"]' )
2022 self .assert_text ("SeleniumBase" , "h1" )
You can’t perform that action at this time.
0 commit comments