Skip to content

Commit b44eb6a

Browse files
committed
Update the proxy test
1 parent b1b1dee commit b44eb6a

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

examples/proxy_test.py

+19-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,29 @@ 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"]\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")')
2022
print("\n\nMy 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)
2224
self.wait_for_element_present('[href="/signup"]')
23-
self.wait_for_text("country", timeout=20)
25+
self.wait_for_text("Hosted domains", timeout=20)
2426
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")
2631
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("\nDisplaying GeoLocation Info:")
40+
text = self.get_text("#block-geolocation")
41+
text = text.split("IP Geolocation data")[0]
2842
rows = text.split("\n")
2943
data = []
3044
for row in rows:

0 commit comments

Comments
 (0)