def tearDown(inst): # Log out any users that were logged in and close all the browsers if (inst.user.loggedin == True): um_utils.logout(inst.user) inst.user.loggedin = False time.sleep(1) um_utils.closeBrowser(inst.user)
def tearDown(inst): # Log out any users that were logged in and close all the browsers for user in inst.users: if (user.loggedin == True): um_utils.logout(user) user.loggedin = False time.sleep(1) um_utils.closeBrowser(user) # Log out emergency admin if (inst.ea.loggedin == True): um_utils.logout(inst.ea) inst.ea.loggedin = False um_utils.closeBrowser(inst.ea)
def test_logout(self): # log user in um_utils.loginPage(self.user) result = um_utils.login(self.user) if (result == 0): self.user.loggedin = True # Check that user is logged in self.assertTrue(db_utils.isUserLoggedIn(self.connection, self.cur, self.user), 'Test not valid. User is not logged in') print 'Sleeping for 2 secs.................' time.sleep( 2 ) # Try and log user out. um_utils.logout(self.user) self.user.loggedin = db_utils.isUserLoggedIn(self.connection, self.cur, self.user) # Check user is no longer logged in self.assertFalse((db_utils.isUserLoggedIn(self.connection, self.cur, self.user)), 'User is still logged in' )
def tearDown(inst): # Log out user at the end of each test if (inst.user.loggedin == True): um_utils.logout(inst.user) inst.user.loggedin = False time.sleep( 1 )