Update example tests
This commit is contained in:
parent
d5a037a647
commit
498854511d
|
@ -11,6 +11,6 @@ class MyTestClass(BaseCase):
|
|||
self.open("https://xkcd.com/353/")
|
||||
self.click('a[rel="license"]')
|
||||
self.open("https://xkcd.com/1481/")
|
||||
self.click("link=Blag")
|
||||
self.update_text("input#s", "Robots!\n")
|
||||
self.click("link=Store")
|
||||
self.update_text("input#top-search-input", "xkcd book\n")
|
||||
self.open("https://xkcd.com/1319/")
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
import time
|
||||
from seleniumbase import BaseCase
|
||||
|
||||
|
||||
class MyTestClass(BaseCase):
|
||||
|
||||
def test_get_ip_address_with_bing(self):
|
||||
self.open('https://www.bing.com/search?q=what+is+my+ip')
|
||||
ip_address = self.get_text("#b_results li.b_top")
|
||||
print("\n\n%s\n" % ip_address)
|
||||
print("\nThe browser will close automatically in 7 seconds...")
|
||||
time.sleep(7)
|
|
@ -6,7 +6,8 @@ class MasterQATests(MasterQA):
|
|||
def test_masterqa(self):
|
||||
self.open("https://xkcd.com/1700/")
|
||||
self.verify("Do you see a webcomic?")
|
||||
self.highlight_click('link=Blag')
|
||||
self.verify('Do you see a blog archive?')
|
||||
self.highlight_update_text("input#s", "Dragons\n")
|
||||
self.verify('Do you see "dragons" in the search results?')
|
||||
self.highlight_click("link=Store")
|
||||
self.highlight_click('[title="things for walls"]')
|
||||
self.verify('Do you see posters for sale?')
|
||||
self.highlight_update_text("input.search-input", "book\n")
|
||||
self.verify('Do you see books in the search results?')
|
||||
|
|
|
@ -16,9 +16,9 @@ class MasterQATests(MasterQA):
|
|||
self.verify("Can you find the moon?")
|
||||
self.click('a[rel="next"]')
|
||||
self.verify("Do the drones look safe?")
|
||||
self.click_link_text('Blag')
|
||||
self.update_text("input#s", "Robots!\n")
|
||||
self.verify("Does it say 'Hooray robots' on the page?")
|
||||
self.click_link_text('Store')
|
||||
self.update_text("input.search-input", "book\n")
|
||||
self.verify("Do you see books in the search results?")
|
||||
self.open("https://xkcd.com/213/")
|
||||
for i in range(5):
|
||||
self.click('a[rel="prev"]')
|
||||
|
|
|
@ -11,10 +11,10 @@ class MyTestClass(BaseCase):
|
|||
self.open("https://xkcd.com/1481/")
|
||||
title = self.get_attribute("#comic img", "title")
|
||||
self.assert_true("86,400 seconds per day" in title)
|
||||
self.click("link=Blag")
|
||||
self.assert_text("The blag of the webcomic", "h2")
|
||||
self.update_text("input#s", "Robots!\n")
|
||||
self.assert_text("Hooray robots!", "#content")
|
||||
self.click("link=Store")
|
||||
self.assert_element('[alt="The xkcd store"]')
|
||||
self.update_text("input.search-input", "xkcd book\n")
|
||||
self.assert_text("xkcd: volume 0", "h3")
|
||||
self.open("https://xkcd.com/1319/")
|
||||
self.assert_exact_text("Automation", "#ctitle")
|
||||
|
||||
|
|
|
@ -7,9 +7,8 @@ class MyTestClass(BaseCase):
|
|||
def test_proxy(self):
|
||||
self.open('https://ipinfo.io/')
|
||||
ip_address = self.get_text("div.home-ip-details span.value")[1:-1]
|
||||
self.open('https://ipinfo.io/%s' % ip_address)
|
||||
print("\n\nIP Address = %s\n" % ip_address)
|
||||
print("\n\nMy IP Address = %s\n" % ip_address)
|
||||
print("Displaying Host Info:")
|
||||
print(self.get_text('ul.address-list'))
|
||||
print(self.get_text('div.home-ip-details').split('asn: ')[0])
|
||||
print("\nThe browser will close automatically in 7 seconds...")
|
||||
time.sleep(7)
|
||||
|
|
|
@ -11,9 +11,9 @@ class MyTestClass(BaseCase):
|
|||
self.open("https://xkcd.com/1481/")
|
||||
title = self.get_attribute("#comic img", "title")
|
||||
self.assert_true("86,400 seconds per day" in title)
|
||||
self.click("link=Blag")
|
||||
self.assert_text("The blag of the webcomic", "h2")
|
||||
self.update_text("input#s", "Robots!\n")
|
||||
self.assert_text("Hooray robots!", "#content")
|
||||
self.click("link=Store")
|
||||
self.assert_element('[alt="The xkcd store"]')
|
||||
self.update_text("input.search-input", "xkcd book\n")
|
||||
self.assert_text("xkcd: volume 0", "h3")
|
||||
self.open("https://xkcd.com/1319/")
|
||||
self.assert_exact_text("Automation", "#ctitle")
|
||||
|
|
Loading…
Reference in New Issue