@@ -16,27 +16,19 @@ def test_proxy(self):
1616        self .open ("https://api.ipify.org/" )
1717        ip_address  =  self .get_text ("body" )
1818        self .open ("https://ipinfo.io/" )
19-         self .type ('input[name="search"]' , ip_address , timeout = 20 )
20-         self .click ("form button span" )
21-         self .sleep (2 )
22-         self .click_if_visible ("span.cursor-pointer" , timeout = 4 )
19+         self .type ('input[name="search"]\n ' , ip_address , timeout = 20 )
2320        print ("\n \n My IP Address = %s\n "  %  ip_address )
21+         self .wait_for_text ("IP Address" , "h1" , timeout = 20 )
22+         self .wait_for_element_present ('[href="/signup"]' )
23+         self .wait_for_text ("hostname" , timeout = 20 )
24+         self .highlight ("h1" )
25+         self .sleep (1.5 )
2426        print ("Displaying Host Info:" )
25-         text  =  self .get_text ("#block-summary " ).split ("Hosted domains " )[0 ]
27+         text  =  self .get_text ("#api-preview-widget " ).split ("is_anycast: " )[0 ]
2628        rows  =  text .split ("\n " )
2729        data  =  []
2830        for  row  in  rows :
2931            if  row .strip () !=  "" :
3032                data .append (row .strip ())
31-         print ("\n " .join (data ).replace ('\n "' , " " ))
32-         print ("\n Displaying Geolocation Info:" )
33-         text  =  self .get_text ("#block-geolocation" ).split ("Coordinates" )[0 ]
34-         rows  =  text .split ("\n " )
35-         data  =  []
36-         for  row  in  rows :
37-             if  row .strip () !=  "" :
38-                 data .append (row .strip ())
39-         print ("\n " .join (data ).replace ('\n "' , " " ))
40-         if  not  self .headless :
41-             print ("\n The browser will close automatically in 3 seconds..." )
42-             self .sleep (3 )
33+         print ("\n " .join (data ).replace ('\n "' , ' "' ))
34+         self .sleep (3 )
0 commit comments