1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-26 10:41:13 +00:00
seahub/tests/integration/login.py
2014-09-05 13:51:44 +08:00

23 lines
674 B
Python

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)