Beispiel #1
0
 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()
Beispiel #2
0
 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()
Beispiel #3
0
 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()
Beispiel #4
0
 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()
Beispiel #5
0
 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()
Beispiel #6
0
 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'])
Beispiel #7
0
 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'])
Beispiel #8
0
 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()
Beispiel #9
0
 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()
Beispiel #10
0
 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'])
Beispiel #11
0
 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'])
Beispiel #12
0
    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()
Beispiel #13
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
Beispiel #14
0
 def test_login_failed(self):
     t0 = time.time()
     driver.login('admin', 'admin')
     assert 'wrong password' in driver.alerts()
     assert time.time() - t0 > 2.
Beispiel #15
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
Beispiel #16
0
 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'])
Beispiel #17
0
 def test_login_failed(self):
     t0 = time.time()
     driver.login('admin', 'admin')
     assert 'wrong password' in driver.alerts()
     assert time.time() - t0 > 2.
Beispiel #18
0
 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'])
Beispiel #19
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
     driver.overview_go('All')
Beispiel #20
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
     driver.overview_go('All')