Skip to content

Commit 4988545

Browse files
committed
Update example tests
1 parent d5a037a commit 4988545

File tree

7 files changed

+20
-32
lines changed

7 files changed

+20
-32
lines changed

examples/basic_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def test_basic(self):
1111
self.open("https://xkcd.com/353/")
1212
self.click('a[rel="license"]')
1313
self.open("https://xkcd.com/1481/")
14-
self.click("link=Blag")
15-
self.update_text("input#s", "Robots!\n")
14+
self.click("link=Store")
15+
self.update_text("input#top-search-input", "xkcd book\n")
1616
self.open("https://xkcd.com/1319/")

examples/get_ip_with_bing.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/master_qa/basic_masterqa_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class MasterQATests(MasterQA):
66
def test_masterqa(self):
77
self.open("https://xkcd.com/1700/")
88
self.verify("Do you see a webcomic?")
9-
self.highlight_click('link=Blag')
10-
self.verify('Do you see a blog archive?')
11-
self.highlight_update_text("input#s", "Dragons\n")
12-
self.verify('Do you see "dragons" in the search results?')
9+
self.highlight_click("link=Store")
10+
self.highlight_click('[title="things for walls"]')
11+
self.verify('Do you see posters for sale?')
12+
self.highlight_update_text("input.search-input", "book\n")
13+
self.verify('Do you see books in the search results?')

examples/master_qa/masterqa_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def test_xkcd(self):
1616
self.verify("Can you find the moon?")
1717
self.click('a[rel="next"]')
1818
self.verify("Do the drones look safe?")
19-
self.click_link_text('Blag')
20-
self.update_text("input#s", "Robots!\n")
21-
self.verify("Does it say 'Hooray robots' on the page?")
19+
self.click_link_text('Store')
20+
self.update_text("input.search-input", "book\n")
21+
self.verify("Do you see books in the search results?")
2222
self.open("https://xkcd.com/213/")
2323
for i in range(5):
2424
self.click('a[rel="prev"]')

examples/my_first_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ def test_basic(self):
1111
self.open("https://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title")
1313
self.assert_true("86,400 seconds per day" in title)
14-
self.click("link=Blag")
15-
self.assert_text("The blag of the webcomic", "h2")
16-
self.update_text("input#s", "Robots!\n")
17-
self.assert_text("Hooray robots!", "#content")
14+
self.click("link=Store")
15+
self.assert_element('[alt="The xkcd store"]')
16+
self.update_text("input.search-input", "xkcd book\n")
17+
self.assert_text("xkcd: volume 0", "h3")
1818
self.open("https://xkcd.com/1319/")
1919
self.assert_exact_text("Automation", "#ctitle")
2020

examples/proxy_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ class MyTestClass(BaseCase):
77
def test_proxy(self):
88
self.open('https://ipinfo.io/')
99
ip_address = self.get_text("div.home-ip-details span.value")[1:-1]
10-
self.open('https://ipinfo.io/%s' % ip_address)
11-
print("\n\nIP Address = %s\n" % ip_address)
10+
print("\n\nMy IP Address = %s\n" % ip_address)
1211
print("Displaying Host Info:")
13-
print(self.get_text('ul.address-list'))
12+
print(self.get_text('div.home-ip-details').split('asn: ')[0])
1413
print("\nThe browser will close automatically in 7 seconds...")
1514
time.sleep(7)

integrations/node_js/my_first_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def test_basic(self):
1111
self.open("https://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title")
1313
self.assert_true("86,400 seconds per day" in title)
14-
self.click("link=Blag")
15-
self.assert_text("The blag of the webcomic", "h2")
16-
self.update_text("input#s", "Robots!\n")
17-
self.assert_text("Hooray robots!", "#content")
14+
self.click("link=Store")
15+
self.assert_element('[alt="The xkcd store"]')
16+
self.update_text("input.search-input", "xkcd book\n")
17+
self.assert_text("xkcd: volume 0", "h3")
1818
self.open("https://xkcd.com/1319/")
1919
self.assert_exact_text("Automation", "#ctitle")

0 commit comments

Comments
 (0)