Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a40d4bb

Browse files
committed
Update the proxy test
1 parent 4190430 commit a40d4bb

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

‎examples/proxy_test.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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\nMy 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("\nDisplaying 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("\nThe 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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /