Created
June 30, 2010 17:46
-
-
Save epall/458989 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from selenium import selenium | |
| from seldev import sauce_selenium | |
| from time import sleep | |
| import unittest, time, re | |
| class likebutton(unittest.TestCase): | |
| def setUp(self): | |
| self.verificationErrors = [] | |
| # This just creates a selenium object with my credentials and | |
| # FF 3.6 on Windows | |
| self.selenium = sauce_selenium("http://developers.facebook.com/") | |
| self.selenium.start() | |
| def test_likebutton(self): | |
| sel = self.selenium | |
| sel.open("/docs/reference/plugins/like") | |
| while not sel.is_element_present("css=a.connect_widget_like_button"): | |
| time.sleep(0.1) | |
| sel.get_eval("window.scrollBy(0,400);") | |
| sel.click("css=a.connect_widget_like_button") | |
| sel.wait_for_pop_up("null", "30000") | |
| sel.select_window("title=Login | Facebook") | |
| sel.type("email", "[email protected]") | |
| sel.type("pass", "saucelabs") | |
| sel.click("login") | |
| time.sleep(5) | |
| def tearDown(self): | |
| self.selenium.stop() | |
| self.assertEqual([], self.verificationErrors) | |
| if __name__ == "__main__": | |
| unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment