示例#1
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="react_table"]/table/tbody/tr[1]/td[3]/a'
     )[0]
     group_button.click()
     sleep(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)
     wrench = browser_in.find_elements_by_class_name('wrench')[0]
     wrench.click()
     buttons = browser_in.find_elements_by_class_name('fluid')
     pull_button = buttons[1]
     pull_button.click()
     sleep(driver_wait_time)
     fab_dim = browser_in.find_elements_by_id('fabDim')[0]
     fab_dim.click()
     sleep(driver_wait_time)
     check_and_close_biu(browser_in, driver_wait_time)
示例#2
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="react_table"]/table/tbody/tr[1]/td[3]/a')[0]
     group_button.click()
     sleep(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)
     wrench = browser_in.find_elements_by_class_name('wrench')[0]
     wrench.click()
     buttons = browser_in.find_elements_by_class_name('fluid')
     pull_button = buttons[1]
     pull_button.click()
     check_and_close_biu(browser_in, driver_wait_time)
示例#3
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)
     wrench = browser_in.find_elements_by_class_name('wrench')[0]
     wrench.click()
     buttons = browser_in.find_elements_by_class_name('fluid')
     fetch_button = buttons[0]
     fetch_button.click()
     sleep(driver_wait_time)
     check_and_close_biu(browser_in, driver_wait_time)
示例#4
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)
     wrench = browser_in.find_elements_by_class_name('wrench')[0]
     wrench.click()
     buttons = browser_in.find_elements_by_class_name('fluid')
     fetch_button = buttons[0]
     fetch_button.click()
     sleep(driver_wait_time)
     check_and_close_biu(browser_in, driver_wait_time)
示例#5
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')
     toggle_buttons[0].click()
     sleep(driver_wait_time)
     check_and_close_biu(browser_in, driver_wait_time)
示例#6
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')
     toggle_buttons[0].click()
     sleep(driver_wait_time)
     check_and_close_biu(browser_in, driver_wait_time)