Created
September 12, 2012 23:37
-
-
Save jsmoxon/3710788 to your computer and use it in GitHub Desktop.
Test Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
self.driver.implicitly_wait(30) | |
def test_sauce(self): | |
self.driver.get('http://saucelabs.com/test/guinea-pig') | |
self.assertTrue("I am a page title - Sauce Labs" in self.driver.title); | |
self.driver.find_element_by_id('comments').send_keys('Hello! I am some example comments. I should appear in the page after you submit the form') | |
self.driver.find_element_by_id('submit').click() | |
comments = self.driver.find_element_by_id('your_comments') | |
self.assertTrue('Your comments: Hello! I am some example comments. I should appear in the page after you submit the form' in comments.text) | |
body = self.driver.find_element_by_xpath('//body') | |
self.assertFalse('I am some other page content' in body.text) | |
self.driver.find_elements_by_link_text('i am a link')[0].click() | |
body = self.driver.find_element_by_xpath('//body') | |
self.assertTrue('I am some other page content' in body.text) | |
def tearDown(self): | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment