0byt3m1n1
Path:
/
data
/
applications
/
aps.bak
/
webcalendar
/
1.2.0-4
/
standard
/
tests
/
[
Home
]
File: webcalendar.py
#!/usr/bin/python """ ATTENTION! Run this test on Selenium RC server with -proxyInjectionMode option! """ import selenium import unittest class WebCalendarTest(unittest.TestCase): siteAppURL = "http://windev.sa.plesk.ru/webcalendar/" siteAppAdminURL = siteAppURL + "login.php" types = {"user": "admin", "password": "123qweRR"} click = "//input[@type='submit' and @value='Login']" def setUp(self): self.browser = selenium.selenium("localhost", \ 4444, "*firefox", self.siteAppURL) self.browser.start() def test_webcalendar_auth(self): browser = self.browser browser.open(self.siteAppAdminURL) for k, v in self.types.iteritems(): browser.type(k, v) browser.click(self.click) browser.wait_for_page_to_load(5000) self.failUnless(browser.get_body_text().find("Error: Invalid login: incorrect password") == -1, "Authentication Error") def tearDown(self): self.browser.stop() if __name__ == "__main__": unittest.main()