@@ -16,15 +16,29 @@ 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"]\n ' , ip_address , timeout = 20 )
19
+ self .type ('input[name="search"]' , ip_address , timeout = 20 )
20
+ self .sleep (0.5 )
21
+ self .click ('button span:contains("Search")' )
20
22
print ("\n \n My IP Address = %s\n " % ip_address )
21
- self .wait_for_text ("IP Address" , "h1" , timeout = 20 )
23
+ self .wait_for_text (ip_address , "h1" , timeout = 20 )
22
24
self .wait_for_element_present ('[href="/signup"]' )
23
- self .wait_for_text ("country " , timeout = 20 )
25
+ self .wait_for_text ("Hosted domains " , timeout = 20 )
24
26
self .highlight ("h1" )
25
- self .sleep (1.5 )
27
+ self .highlight ("#block-summary" )
28
+ self .highlight ("#block-geolocation" )
29
+ self .sleep (2 )
30
+ self .click_if_visible ("span.ipinfo-modal__close" )
26
31
print ("Displaying Host Info:" )
27
- text = self .get_text ("#api-preview-widget" ).split ("is_anycast:" )[0 ]
32
+ text = self .get_text ("#block-summary" ).split ("Hosted domains" )[0 ]
33
+ rows = text .split ("\n " )
34
+ data = []
35
+ for row in rows :
36
+ if row .strip () != "" :
37
+ data .append (row .strip ())
38
+ print ("\n " .join (data ).replace ('\n "' , ' "' ))
39
+ print ("\n Displaying GeoLocation Info:" )
40
+ text = self .get_text ("#block-geolocation" )
41
+ text = text .split ("IP Geolocation data" )[0 ]
28
42
rows = text .split ("\n " )
29
43
data = []
30
44
for row in rows :
0 commit comments