Ejemplo n.º 1
0
 def _check_url():
     try:
         found = parse_url(driver.current_url).group('access')
     except AttributeError:
         return False
     else:
         return 'onedata' == found.lower()
Ejemplo n.º 2
0
 def _check_url():
     try:
         found = parse_url(driver.current_url).group('access')
     except AttributeError:
         return False
     else:
         return 'onedata' == found.lower()
Ejemplo n.º 3
0
def change_app_path_with_copied_item(selenium, browser_id, path,
                                     displays, clipboard):
    driver = selenium[browser_id]
    base_url = parse_url(driver.current_url).group('base_url')
    item = clipboard.paste(display=displays[browser_id])
    url = '{base_url}{path}/{item}'.format(base_url=base_url,
                                           path=path, item=item)
    driver.get(url)
Ejemplo n.º 4
0
def change_app_path_with_copied_item(selenium, browser_id, path, displays,
                                     clipboard):
    driver = selenium[browser_id]
    base_url = parse_url(driver.current_url).group('base_url')
    item = clipboard.paste(display=displays[browser_id])
    url = '{base_url}{path}/{item}'.format(base_url=base_url,
                                           path=path,
                                           item=item)
    driver.get(url)
Ejemplo n.º 5
0
def change_app_path_with_recv_item(selenium, browser_id, path, tmp_memory,
                                   item):
    driver = selenium[browser_id]
    base_url = parse_url(driver.current_url).group('base_url')
    item = tmp_memory[browser_id]['mailbox'][item.lower()]
    url = '{base_url}{path}/{item}'.format(base_url=base_url,
                                           path=path,
                                           item=item)

    driver.get(url)
Ejemplo n.º 6
0
def open_received_url(selenium, browser_id, tmp_memory, base_url):
    driver = selenium[browser_id]

    old_page = driver.find_element_by_css_selector('html')
    url = tmp_memory[browser_id]['mailbox']['url']
    driver.get(url.replace(parse_url(url).group('base_url'), base_url, 1))

    Wait(driver, WAIT_BACKEND).until(
        staleness_of(old_page),
        message='waiting for page {:s} to load'.format(url))
Ejemplo n.º 7
0
def change_app_path_with_recv_item(selenium, browser_id, path,
                                   tmp_memory, item):
    driver = selenium[browser_id]
    base_url = parse_url(driver.current_url).group('base_url')
    item = tmp_memory[browser_id]['mailbox'][item.lower()]
    url = '{base_url}{path}/{item}'.format(base_url=base_url,
                                           path=path,
                                           item=item)

    driver.get(url)
Ejemplo n.º 8
0
def change_app_path_with_recv_item(selenium, browser_id, path, tmp_memory,
                                   item):
    driver = selenium[browser_id]
    base_url = parse_url(driver.current_url).group('base_url')
    item = tmp_memory[browser_id]['mailbox'][item.lower()]
    url = '{base_url}{path}/{item}'.format(base_url=base_url,
                                           path=path,
                                           item=item)
    # We use javascript instead of driver.get because of chromedriver being
    # unable to determine whether page has been loaded
    driver.execute_script('window.location = \'{}\''.format(url))
Ejemplo n.º 9
0
def open_received_url(selenium, browser_id, tmp_memory, base_url):
    driver = selenium[browser_id]

    old_page = driver.find_element_by_css_selector('html')
    url = tmp_memory[browser_id]['mailbox']['url']
    driver.get(url.replace(parse_url(url).group('base_url'), base_url, 1))

    Wait(driver, WAIT_BACKEND).until(
        staleness_of(old_page),
        message='waiting for page {:s} to load'.format(url)
    )
Ejemplo n.º 10
0
def change_app_path_with_copied_item(selenium, browser_id, path, displays,
                                     clipboard):
    driver = selenium[browser_id]
    base_url = parse_url(driver.current_url).group('base_url')
    item = clipboard.paste(display=displays[browser_id])
    url = '{base_url}{path}/{item}'.format(base_url=base_url,
                                           path=path,
                                           item=item)
    # We use javascript instead of driver.get because of chromedriver being
    # unable to determine whether page has been loaded
    driver.execute_script('window.location = \'{}\''.format(url))
Ejemplo n.º 11
0
def _wait_for_op_session_to_start(selenium, browser_id_list):
    def _check_url():
        try:
            found = parse_url(driver.current_url).group('access')
        except AttributeError:
            return False
        else:
            return 'onedata' == found.lower()

    for browser_id in parse_seq(browser_id_list):
        driver = selenium[browser_id]

        # because of current subscription it is necessary
        # to wait under certain circumstances for things to properly work
        time.sleep(12)
        driver.get(parse_url(driver.current_url).group('base_url'))

        # TODO rm *4 when provider session starts becomes faster
        Wait(driver,
             WAIT_BACKEND * 4).until(lambda _: _check_url(),
                                     message='waiting for session to start')
Ejemplo n.º 12
0
def _wait_for_op_session_to_start(selenium, browser_id_list):
    def _check_url():
        try:
            found = parse_url(driver.current_url).group('access')
        except AttributeError:
            return False
        else:
            return 'onedata' == found.lower()

    for browser_id in parse_seq(browser_id_list):
        driver = selenium[browser_id]

        # because of current subscription it is necessary
        # to wait under certain circumstances for things to properly work
        time.sleep(12)
        driver.get(parse_url(driver.current_url).group('base_url'))

        # TODO rm *4 when provider session starts becomes faster
        Wait(driver, WAIT_BACKEND*4).until(
            lambda _: _check_url(),
            message='waiting for session to start'
        )
Ejemplo n.º 13
0
def on_ember_path(selenium, browser_id, path):
    driver = selenium[browser_id]
    driver.get(parse_url(driver.current_url).group('base_url') + '/#' + path)
Ejemplo n.º 14
0
def refresh_site(selenium, browser_id):
    driver = selenium[browser_id]
    driver.get(parse_url(driver.current_url).group('base_url'))
Ejemplo n.º 15
0
def on_ember_path(selenium, browser_id, path):
    driver = selenium[browser_id]
    driver.get(parse_url(driver.current_url).group('base_url') + '/#' + path)
Ejemplo n.º 16
0
def visit_relative(selenium, browser_id, path):
    driver = selenium[browser_id]
    driver.get(parse_url(driver.current_url).group('base_url') + path)
Ejemplo n.º 17
0
def cp_part_of_url(selenium, browser_id, item, displays, clipboard):
    driver = selenium[browser_id]
    clipboard.copy(parse_url(driver.current_url).group(item.lower()),
                   display=displays[browser_id])
Ejemplo n.º 18
0
def op_refresh_op_site_by_rm_hashtag(selenium, browser_id):
    driver = selenium[browser_id]
    op_url = parse_url(driver.current_url).group('base_url')
    driver.get(op_url)
Ejemplo n.º 19
0
def cp_part_of_url(selenium, browser_id, item, displays, clipboard):
    driver = selenium[browser_id]
    clipboard.copy(parse_url(driver.current_url).group(item.lower()),
                   display=displays[browser_id])
Ejemplo n.º 20
0
def visit_relative(selenium, browser_id, path):
    driver = selenium[browser_id]
    driver.get(parse_url(driver.current_url).group('base_url') + path)
Ejemplo n.º 21
0
def op_refresh_op_site_by_rm_hashtag(selenium, browser_id):
    driver = selenium[browser_id]
    op_url = parse_url(driver.current_url).group('base_url')
    driver.get(op_url)
Ejemplo n.º 22
0
def refresh_site(selenium, browser_id):
    driver = selenium[browser_id]
    driver.get(parse_url(driver.current_url).group('base_url'))