From 30fb7e3ca4a26a7a1a96bb87dd2d25ca4d269c4a Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 14 Jul 2016 23:34:31 -0400 Subject: [PATCH] Add an example test that utilizes MasterQA --- examples/masterqa_test.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 examples/masterqa_test.py diff --git a/examples/masterqa_test.py b/examples/masterqa_test.py new file mode 100755 index 00000000..a4a6b942 --- /dev/null +++ b/examples/masterqa_test.py @@ -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'?")