示例#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()
示例#2
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()
示例#3
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()
示例#4
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'])
示例#5
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'])
示例#6
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()
示例#7
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()
示例#8
0
 def setUpClass(cls):
     driver.logout()
示例#9
0
 def setUpClass(cls):
     driver.logout()
示例#10
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
示例#11
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'])
示例#12
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
示例#13
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'])
示例#14
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
     driver.overview_go('All')
示例#15
0
 def setUpClass(cls):
     driver.logout()
     driver.login('admin', passwords['admin'])
     driver.overview_go('All')