Add an example test that utilizes MasterQA

This commit is contained in:
Michael Mintz 2016-07-14 23:34:31 -04:00
parent 0942410795
commit 30fb7e3ca4
1 changed files with 25 additions and 0 deletions

25
examples/masterqa_test.py Executable file
View File

@ -0,0 +1,25 @@
from seleniumbase import MasterQA
class MasterQATests(MasterQA):
def test_xkcd(self):
self.open("http://xkcd.com/1512/")
for i in xrange(4):
self.click('a[rel="next"]')
for i in xrange(3):
self.click('a[rel="prev"]')
self.verify()
self.open("http://xkcd.com/1520/")
for i in xrange(2):
self.click('a[rel="next"]')
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.open("http://xkcd.com/213/")
for i in xrange(5):
self.click('a[rel="prev"]')
self.verify("Does the page say 'Abnormal Expressions'?")