def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab')
    assert actions.get_browser().get_window_index() == 0
    actions.switch_to_window_by_index(1)
    assert actions.get_browser().get_window_index() == 1
def test(data):
    actions.navigate(data.env.url+'tabs/')
    actions.click("#openTab")
    actions.wait_for_window_present_by_title('Tab', 5)
    actions.verify_window_present_by_title('Tab')
    golem_steps.assert_last_step_message("Verify window present by title 'Tab'")
    actions.verify_window_present_by_title('Web Playground - Tabs')
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click('#openTab')
    # firefox does not wait for tabs to load
    actions.wait_for_window_present_by_title('Tab', timeout=5)
    assert actions.get_window_index() == 0
    actions.switch_to_window_by_index(1)
    assert actions.get_window_index() == 1
Beispiel #4
0
def test(data):
    tabs_url = data.env.url + 'tabs/'
    tab_url = data.env.url + 'tab/'
    actions.navigate(tabs_url)
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab')
    window_urls = actions.get_browser().get_window_urls()
    assert window_urls == [tabs_url, tab_url]
Beispiel #5
0
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab', timeout=5)
    current_window_handle = actions.get_window_handle()
    all_handles = actions.get_window_handles()
    assert len(all_handles) == 2
    assert current_window_handle in all_handles
Beispiel #6
0
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click("#openTab")
    actions.wait_for_window_present_by_title('Tab')
    actions.verify_amount_of_windows(2)
    golem_steps.assert_last_step_message('Verify amount of open windows is 2')
    actions.switch_to_window_by_title('Tab')
    actions.close_window()
    actions.verify_amount_of_windows(1)
Beispiel #7
0
def test(data):
    actions.navigate(data.env.url+'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab')
    actions.get_browser().switch_to_window_by_index(1)
    assert actions.get_window_index() == 1
    actions.verify_title('Tab')
    actions.switch_to_first_window()
    assert actions.get_window_index() == 0
    actions.verify_title('Web Playground - Tabs')
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.assert_amount_of_windows(1)
    assert golem_steps.get_last_step_message(
    ) == 'Assert amount of open windows is 1'
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab', 3)
    actions.assert_amount_of_windows(2)
    with expected_exception(AssertionError, 'expected 3 windows but got 2'):
        actions.assert_amount_of_windows(3)
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab', 5)
    actions.assert_amount_of_windows(2)
    tab_url = data.env.url + 'tab/'
    actions.close_window_by_url(tab_url)
    golem_steps.assert_last_step_message(
        "Close window by URL '{}'".format(tab_url))
    actions.assert_amount_of_windows(1)
Beispiel #10
0
def test(data):
    actions.navigate(data.env.url+'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab')
    actions.switch_to_window_by_index(1)
    assert actions.get_window_index() == 1
    actions.assert_title('Tab')
    actions.switch_to_first_window()
    golem_steps.assert_last_step_message('Switch to first window')
    assert actions.get_window_index() == 0
    actions.assert_title('Web Playground - Tabs')
Beispiel #11
0
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab', 5)
    actions.assert_amount_of_windows(2)
    actions.switch_to_window_by_title('Tab')
    actions.assert_title('Tab')
    actions.close_window()
    golem_steps.assert_last_step_message('Close current window')
    actions.assert_amount_of_windows(1)
    actions.assert_title('Web Playground - Tabs')
Beispiel #12
0
def test(data):
    actions.navigate(data.env.url+'tabs/')
    actions.click('#openTab')
    # firefox does not wait for tabs to load
    actions.wait_for_window_present_by_title('Tab')
    actions.switch_to_window_by_index(1)
    golem_steps.assert_last_step_message('Switch to window of index 1')
    assert actions.get_window_index() == 1
    actions.verify_title('Tab')
    actions.switch_to_window_by_index(0)
    assert actions.get_window_index() == 0
    actions.verify_title('Web Playground - Tabs')
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.send_keys('#delay', 3)
    actions.send_keys('#title', 'MY TITLE')
    actions.click("#goButtonCustom")
    actions.wait_for_window_present_by_title('MY TITLE', timeout=5)
    golem_steps.assert_last_step_message(
        "Wait for window present by title 'MY TITLE'")
    actions.verify_window_present_by_title('MY TITLE')
    msg = "Timeout waiting for window present by title 'TITLE NOT PRESENT'"
    with expected_exception(Exception, msg):
        actions.wait_for_window_present_by_title('TITLE NOT PRESENT',
                                                 timeout=2)
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.send_keys('#urlInput', '/elements/')
    actions.click("#goButton")
    actions.wait_for_window_present_by_title('Web Playground - Elements',
                                             timeout=3)
    actions.switch_to_window_by_title('Web Playground - Elements')
    golem_steps.assert_last_step_message(
        "Switch to window with title 'Web Playground - Elements'")
    actions.verify_title('Web Playground - Elements')
    msg = "Window with title 'incorrect title' was not found"
    with expected_exception(Exception, msg):
        actions.switch_to_window_by_title('incorrect title')
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.send_keys('#title', 'SECOND TAB')
    actions.click('#goButtonCustom')
    actions.clear_element('#title')
    actions.send_keys('#title', 'THIRD TAB')
    actions.click('#goButtonCustom')
    actions.wait_for_window_present_by_title('SECOND TAB', timeout=10)
    actions.wait_for_window_present_by_title('THIRD TAB', timeout=10)
    actions.get_browser().switch_to_window_by_index(2)
    assert actions.get_window_index() == 2
    actions.navigate(data.env.url)
    actions.switch_to_first_window()
    actions.verify_title('Web Playground - Tabs')
    actions.get_browser().switch_to_last_window()
    assert actions.get_window_index() == 2
    actions.verify_title('Web Playground')
Beispiel #16
0
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    # open two more tabs
    actions.send_keys('#title', 'SECOND TAB')
    actions.click('#goButtonCustom')
    actions.clear_element('#title')
    actions.send_keys('#title', 'THIRD TAB')
    actions.click('#goButtonCustom')
    # wait for the new tabs to load
    actions.wait_for_window_present_by_title('SECOND TAB', timeout=5)
    actions.wait_for_window_present_by_title('THIRD TAB', timeout=5)
    # switch to last tab and navigate to index
    actions.switch_to_window_by_index(2)
    assert actions.get_window_index() == 2
    actions.navigate(data.env.url)
    # switch to first tab
    actions.switch_to_first_window()
    actions.assert_title('Web Playground - Tabs')
    # switch to last tab
    actions.switch_to_last_window()
    golem_steps.assert_last_step_message('Switch to last window')
    assert actions.get_window_index() == 2
    actions.assert_title('Web Playground')
Beispiel #17
0
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.click('#openTab')
    actions.wait_for_window_present_by_title('Tab')
    window_titles = actions.get_browser().get_window_titles()
    assert window_titles == ['Web Playground - Tabs', 'Tab']