@@ -16,27 +16,19 @@ def test_proxy(self):
16
16
self .open ("https://api.ipify.org/" )
17
17
ip_address = self .get_text ("body" )
18
18
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 )
23
20
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 )
24
26
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 ]
26
28
rows = text .split ("\n " )
27
29
data = []
28
30
for row in rows :
29
31
if row .strip () != "" :
30
32
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