コード例 #1
0
def test(data):
    actions.navigate(data.env.url)
    actions.click(('link_text', 'Elements'))
    assert actions.get_current_url() == data.env.url + 'elements/'
    actions.go_back()
    golem_steps.assert_last_step_message('Go back')
    assert actions.get_current_url() == data.env.url
コード例 #2
0
def test(data):
    actions.navigate(data.env.url + 'tabs/')
    actions.send_keys('#urlInput', '/elements/')
    actions.click("#goButton")
    actions.clear_element('#urlInput')
    actions.send_keys('#urlInput', '/alert/')
    actions.click("#goButton")
    actions.switch_to_window_by_index(0)
    first_url = actions.get_current_url()
    actions.switch_to_window_by_index(1)
    second_url = actions.get_current_url()
    actions.switch_to_window_by_index(2)
    third_url = actions.get_current_url()
    actions.switch_to_window_by_index(0)
    # close third window by URL
    actions.get_browser().close_window_by_url(third_url)
    actions.verify_amount_of_windows(2)
    actions.verify_url(first_url)
    # close first window by URL, from the first window
    actions.get_browser().close_window_by_url(first_url)
    # second window is now active
    actions.verify_amount_of_windows(1)
    actions.verify_url(second_url)
    # try to close a window that is not present
    msg = "a window with URL '/incorrect/url' was not found"
    with expected_exception(Exception, msg):
        actions.get_browser().close_window_by_url('/incorrect/url')
コード例 #3
0
def test(data):
    suite_builder.run_suite()
    suite_builder.access_suite_execution_from_toast()
    report_execution.wait_until_execution_end()
    current_url = actions.get_current_url()
    actions.navigate(current_url + 'html/')
    actions.assert_element_text_contains(report_execution.title,
                                         'report execution - simple suite')
    actions.navigate(current_url + 'html-no-images/')
    actions.assert_element_text_contains(report_execution.title,
                                         'report execution - simple suite')
    actions.navigate(current_url + 'json/')
    assert '"totals_by_result"' in actions.get_browser().page_source
    actions.navigate(current_url + 'junit/')
    actions.assert_url_contains('/junit')
コード例 #4
0
def test(data):
    actions.navigate(data.env.url)
    assert actions.get_current_url() == data.env.url