Beispiel #1
0
def pull_elvanto_groups(force=False):
    """Pull all the Elvanto groups that are set to sync."""
    from site_config.models import SiteConfiguration
    config = SiteConfiguration.get_solo()
    if force or config.sync_elvanto:
        from elvanto.models import ElvantoGroup
        ElvantoGroup.pull_all_groups()
Beispiel #2
0
def pull_elvanto_groups(force=False):
    """Pull all the Elvanto groups that are set to sync."""
    from site_config.models import SiteConfiguration
    config = SiteConfiguration.get_solo()
    if force or config.sync_elvanto:
        from elvanto.models import ElvantoGroup
        ElvantoGroup.pull_all_groups()
Beispiel #3
0
def fetch_elvanto_groups(force=False):
    """Fetch all Elvanto groups."""
    from site_config.models import SiteConfiguration
    config = SiteConfiguration.get_solo()
    if force or config.sync_elvanto:
        from elvanto.models import ElvantoGroup
        ElvantoGroup.fetch_all_groups()
 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="elvanto_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()
     alert = browser_in.switch_to_alert()
     alert.accept()
Beispiel #5
0
def fetch_elvanto_groups(force=False):
    """Fetch all Elvanto groups."""
    from site_config.models import SiteConfiguration
    config = SiteConfiguration.get_solo()
    if force or config.sync_elvanto:
        from elvanto.models import ElvantoGroup
        ElvantoGroup.fetch_all_groups()
 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="elvanto_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()
     alert = browser_in.switch_to_alert()
     alert.accept()
 def test_page_load(self, uri, live_server, browser_in, driver_wait_time):
     """Test page loads and table renders."""
     # load groups
     ElvantoGroup.fetch_all_groups()
     # load page
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     # check table is there
     sleep(driver_wait_time)
     tables = browser_in.find_elements_by_class_name('table')
     assert len(tables) == 1
     table = tables[0]
     assert 'Geneva' in table.text
     assert 'Scotland' in table.text
     assert 'Disabled' in table.text
Beispiel #8
0
 def test_page_load(self, uri, live_server, browser_in, driver_wait_time):
     """Test page loads and table renders."""
     # load groups
     ElvantoGroup.fetch_all_groups()
     # load page
     browser_in.get(live_server + uri)
     assert uri in browser_in.current_url
     # check table is there
     sleep(driver_wait_time)
     tables = browser_in.find_elements_by_xpath('//table')
     assert len(tables) == 1
     table = tables[0]
     assert 'Geneva' in table.text
     assert 'Scotland' in table.text
     assert 'Disabled' in table.text
Beispiel #9
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)
Beispiel #10
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)