1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

replace casperjs with selenium

This commit is contained in:
Chilledheart
2014-08-27 11:08:39 +08:00
committed by lins05
parent 863d053e08
commit a882caec03
15 changed files with 214 additions and 84 deletions

View File

@@ -0,0 +1,22 @@
import integration as common
import unittest
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = common.getLoggedInstance()
self.assertIsNotNone(self.browser)
self.addCleanup(self.browser.quit)
def testLogin(self):
self.assertRegexpMatches(self.browser.current_url, common.HOME_URL)
def testLogout(self):
myinfo_bar = self.browser.find_element_by_css_selector('#my-info')
logout_input = self.browser.find_element_by_css_selector('a#logout')
myinfo_bar.click()
logout_input.click()
self.assertRegexpMatches(self.browser.current_url, common.LOGOUT_URL)
if __name__ == '__main__':
unittest.main(verbosity=2)