Example #1
0
 def test_fetch_groups(self, uri, live_server, browser_in, driver_wait_time):
     "Test fetch group button." ""
     # fetch groups
     browser_in.get(live_server + uri)
     fetch_button = browser_in.find_element_by_id('fetch_button')
     click_and_wait(fetch_button, driver_wait_time)
     check_and_close_msg(browser_in, driver_wait_time)
Example #2
0
 def test_archive_without_permission(self, live_server, browser_in, recipients, driver_wait_time):
     # remove priveleges:
     u = User.objects.get(username='******')
     u.is_staff = False
     u.is_superuser = False
     u.save()
     p = u.profile
     p.can_archive = False
     p.save()
     # open page:
     uri = '/recipient/all/'
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     sleep(driver_wait_time)
     # archive (should fail and show a popup):
     toggle_buttons = browser_in.find_elements_by_class_name('grey')
     click_and_wait(toggle_buttons[0], driver_wait_time)
     check_and_close_msg(browser_in, driver_wait_time)
Example #3
0
 def test_archive_without_permission(self, live_server, browser_in, recipients, driver_wait_time):
     # remove priveleges:
     u = User.objects.get(username='******')
     u.is_staff = False
     u.is_superuser = False
     u.save()
     p = u.profile
     p.can_archive = False
     p.save()
     # open page:
     uri = '/recipient/all/'
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     sleep(driver_wait_time)
     # archive (should fail and show a popup):
     toggle_buttons = browser_in.find_elements_by_id('archiveItemButton')
     click_and_wait(toggle_buttons[0], driver_wait_time)
     check_and_close_msg(browser_in, driver_wait_time)
Example #4
0
 def test_pull_groups(self, uri, live_server, browser_in, driver_wait_time):
     """Test toggle syncing of a group and then pull groups."""
     # load groups
     ElvantoGroup.fetch_all_groups()
     # load page
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     # enable a group
     sleep(driver_wait_time)
     group_button = browser_in.find_element_by_id('elvantoGroupButton')
     click_and_wait(group_button, driver_wait_time)
     table = browser_in.find_elements_by_xpath('//table')[0]
     assert 'Syncing' in table.text
     # pull groups
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     sleep(driver_wait_time)
     pull_button = browser_in.find_elements_by_id('pull_button')[0]
     pull_button.click()
     check_and_close_msg(browser_in, driver_wait_time)
Example #5
0
 def test_pull_groups(self, uri, live_server, browser_in, driver_wait_time):
     """Test toggle syncing of a group and then pull groups."""
     # load groups
     ElvantoGroup.fetch_all_groups()
     # load page
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     # enable a group
     sleep(driver_wait_time)
     group_button = browser_in.find_elements_by_xpath(
         '//*[@id="elmContainer"]/div/div[3]/div/div/div[2]/table/tbody/tr[1]/td[3]/a'
     )[0]
     click_and_wait(group_button, driver_wait_time)
     table = browser_in.find_elements_by_class_name('table')[0]
     assert 'Syncing' in table.text
     # pull groups
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     sleep(driver_wait_time)
     pull_button = browser_in.find_elements_by_id('pull_button')[0]
     pull_button.click()
     check_and_close_msg(browser_in, driver_wait_time)