def test_login_secretary(self): driver.login('secretary', passwords['secretary']) assert 'forms' not in driver.menu_names() assert 'admin' not in driver.menu_names() assert driver.single_sms_available() driver.logout() assert 'logged out' in driver.alerts()
def test_login_fieldofficer(self): driver.login('fieldofficer', passwords['fieldofficer']) assert driver.title() == 'SAMPLE CONFIG' assert len(driver.menu_names()) == 1 assert not driver.single_sms_available() driver.logout() assert 'logged out' in driver.alerts()
def test_login_fieldofficer(self): driver.login('fieldofficer', passwords['fieldofficer']) assert driver.title() == 'SAMPLE CONFIG' assert 'forms' not in driver.menu_names() assert 'admin' not in driver.menu_names() assert not driver.single_sms_available() driver.logout() assert 'logged out' in driver.alerts()
def test_user_log(self): driver.login('secretary', passwords['secretary']) assert driver.logged_in() driver.logout() driver.login('admin', passwords['admin']) userlog = driver.log_messages('user') assert userlog.index('user "secretary" logged in') == 2 assert userlog.index('user "secretary" logged out') == 1 driver.logout()
def test_access(self): driver.overview_go('All') data = driver.data_dict('80001', 'CRF1') assert data['info']['full_name'] == 'Alice Armstrong' driver.logout() driver.login('secretary', passwords['secretary']) data = driver.data_dict('80001', 'CRF1') assert data['info']['full_name'] == '(masked)' driver.logout() driver.login('admin', passwords['admin'])
def test_login_admin(self): assert not driver.logged_in() driver.login('admin', passwords['admin']) assert driver.logged_in() assert driver.title() == 'SAMPLE CONFIG' items = driver.menu_names() assert 'forms' in items assert 'admin' in items assert 'help' in items driver.logout() assert 'logged out' in driver.alerts()
def test_access(self): driver.get('') assert 'doughnut' in driver.menu_names() driver.menu_go('doughnut') assert len(driver.els_xpath('//canvas')) == 6 driver.logout() driver.login('overview', passwords['overview']) assert 'doughnut' not in driver.menu_names() assert len(driver.els_xpath('//canvas')) == 0 driver.logout() driver.login('admin', passwords['admin'])
def test_create_user(self): driver.login('admin', passwords['admin']) ec = default_config() userdict = dict(name='blah', password='******', rights='overview') ec.add_row('users', userdict) upload_config(ec) driver.logout() assert not driver.logged_in() driver.login('blah', 'blah123') assert driver.logged_in() driver.logout()
def setUpClass(cls): driver.logout() driver.login('admin', passwords['admin'])
def test_login_failed(self): t0 = time.time() driver.login('admin', 'admin') assert 'wrong password' in driver.alerts() assert time.time() - t0 > 2.
def setUpClass(cls): root = os.path.join(os.path.dirname(__file__), os.path.pardir) cls.cron_php = os.path.join(root, 'cron.php') driver.logout() driver.login('admin', passwords['admin'])
def setUpClass(cls): driver.logout() driver.login('admin', passwords['admin']) driver.overview_go('All')