def test_handle_prompt_default(session, create_dialog, dialog_type): create_dialog(dialog_type, text="dialog") response = get_window_rect(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_accept(session, create_dialog, dialog_type): create_dialog(dialog_type, text="dialog") response = delete_cookie(session, "foo") assert_success(response) assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_default(session, create_dialog, dialog_type): create_dialog(dialog_type, text="dialog") response = delete_cookie(session, "foo") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_accept(session, create_dialog, dialog_type): create_dialog(dialog_type, text="dialog") response = get_window_rect(session) assert_success(response) assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_accept(session, create_dialog, dialog_type): original = session.window.rect create_dialog(dialog_type, text="dialog") response = set_window_rect(session, {"x": original["x"], "y": original["y"]}) assert_success(response) assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_with_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = execute_async_script(session, "window.result = 1; arguments[0](1);") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.execute_script("return window.result;") is None
def check_user_prompt_closed_with_exception(dialog_type, retval): create_cookie("foo", value="bar", path="/common/blank.html") create_dialog(dialog_type, text=dialog_type) response = get_named_cookie(session, "foo") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def test_handle_prompt_default(session, create_dialog, dialog_type): session.url = inline("<title>WD doc title</title>") create_dialog(dialog_type, text="dialog") response = get_current_url(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<p>bar</p>") create_dialog(dialog_type, text=dialog_type) response = find_element(session, "css selector", "p") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = forward(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.url == pages[0]
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<title>Foo</title>") create_dialog(dialog_type, text=dialog_type) response = get_title(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): assert not document_hidden(session) create_dialog(dialog_type, text=dialog_type) response = minimize(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert not document_hidden(session)
def check_user_prompt_closed_without_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = back(session) assert_success(response) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.url == pages[0]
def test_handle_prompt_dismiss(session, create_dialog, dialog_type): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text="dialog") response = is_element_selected(session, element.id) assert_success(response, False) assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_default(session, create_dialog, dialog_type): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text="dialog") response = is_element_selected(session, element.id) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("<div/>") expected = session.execute_script("return document.documentElement.outerHTML") create_dialog(dialog_type, text=dialog_type) response = get_page_source(session) assert_success(response, expected) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def test_handle_prompt_default(session, create_dialog, create_window, dialog_type): session.window_handle = create_window() create_dialog(dialog_type, text="dialog") response = close(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("""<input style="display: block">""") element = session.find.css("input", all=False) create_dialog(dialog_type, text=dialog_type) response = get_element_css_value(session, element.id, "display") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): assert not is_fullscreen(session) create_dialog(dialog_type, text=dialog_type) response = fullscreen(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert not is_fullscreen(session)
def test_handle_prompt_accept(session, create_dialog, dialog_type): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text="dialog") response = get_property(session, element.id, "id") assert_success(response, "foo") assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_default(session, create_dialog, dialog_type): original = session.window.rect create_dialog(dialog_type, text="dialog") response = set_window_rect(session, {"x": original["x"], "y": original["y"]}) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<div><p>bar</p><div>") outer_element = session.find.css("div", all=False) create_dialog(dialog_type, text=dialog_type) response = find_elements(session, outer_element.id, "css selector", "p") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def test_handle_prompt_dismiss(session, create_dialog, dialog_type): session.url = inline("<title>WD doc title</title>") expected_title = session.title create_dialog(dialog_type, text="dialog") response = get_title(session) assert_success(response, expected_title) assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text=dialog_type) response = get_element_tag_name(session, element.id) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<input id=foo type=checkbox checked>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text=dialog_type) response = is_element_selected(session, element.id) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_without_exception(dialog_type, retval): assert not is_fullscreen(session) create_dialog(dialog_type, text=dialog_type) response = fullscreen(session) assert_success(response) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert is_fullscreen(session)
def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text=dialog_type) response = get_element_tag_name(session, element.id) assert_success(response, "input") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("<input>") element = session.find.css("input", all=False) create_dialog(dialog_type, text=dialog_type) response = get_element_rect(session, element.id) assert_success(response, retrieve_element_rect(session, element)) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_without_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = forward(session) assert_success(response) # retval not testable for confirm and prompt because window is gone assert_dialog_handled(session, expected_text=dialog_type, expected_retval=None) assert session.url == pages[1]
def test_handle_prompt_default(session, create_dialog, dialog_type): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text="dialog") response = get_tag_name(session, element.id) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_accept(session, create_dialog, dialog_type): session.url = inline("<title>WD doc title</title>") expected_url = session.url create_dialog(dialog_type, text="dialog") response = get_current_url(session) assert_success(response, expected_url) assert_dialog_handled(session, expected_text="dialog")
def test_handle_prompt_dismiss(session, create_dialog, dialog_type): session.url = inline("<input id=foo>") element = session.find.css("#foo", all=False) create_dialog(dialog_type, text="dialog") response = get_tag_name(session, element.id) assert_success(response, "input") assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("<title>Foo</title>") expected_title = session.title create_dialog(dialog_type, text=dialog_type) response = get_title(session) assert_success(response, expected_title) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def test_handle_prompt_default(session, create_dialog, dialog_type): session.url = inline("<input>") element = session.find.css("input", all=False) create_dialog(dialog_type, text="dialog") response = element_send_keys(session, element, "foo") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text="dialog")
def check_user_prompt_closed_with_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = perform_actions(session, actions) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert get_keys(key_reporter) == ""
def check_user_prompt_closed_with_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = back(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.url == pages[1]
def check_user_prompt_closed_without_exception(dialog_type, retval): url = inline("<div/>") create_dialog(dialog_type, text=dialog_type) response = navigate_to(session, url) assert_success(response) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.url == url
def test_handle_prompt_accept(session, create_dialog, dialog_type, retval): assert is_fullscreen(session) is False create_dialog(dialog_type, text=dialog_type) response = fullscreen(session) assert_success(response) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert is_fullscreen(session) is True
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<p id=1>") create_dialog(dialog_type, text=dialog_type) response = get_current_url(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_without_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = execute_script(session, "window.result = 1; return 1;") assert_success(response, 1) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.execute_script("return window.result;") == 1
def check_user_prompt_closed_with_exception(dialog_type, retval): url = inline("<div/>") create_dialog(dialog_type, text=dialog_type) response = navigate_to(session, url) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.url != url
def check_user_prompt_closed_without_exception(dialog_type, retval): original_size = session.window.size create_dialog(dialog_type, text=dialog_type) response = maximize(session) assert_success(response) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.window.size != original_size
def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("<input/>") create_dialog(dialog_type, text=dialog_type) response = take_screenshot(session) value = assert_success(response) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert_png(value)
def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("<input id=foo type=checkbox checked>") element = session.find.css("#foo", all=False) element.send_keys("foo") create_dialog(dialog_type, text=dialog_type) response = is_element_selected(session, element.id) assert_success(response, True) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): create_dialog(dialog_type, text=dialog_type) response = execute_script(session, "window.result = 1; return 1;") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.execute_script("return window.result;") is None
def check_user_prompt_closed_with_exception(dialog_type, retval): original_size = session.window.size create_dialog(dialog_type, text=dialog_type) response = maximize(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert session.window.size == original_size
def test_handle_prompt_default(session, create_dialog, dialog_type, retval): session.url = inline("<title>Foo</title>") create_dialog(dialog_type, text=dialog_type) response = get_title(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("<input/>") create_dialog(dialog_type, text=dialog_type) response = do_print(session, {}) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline(get_shadow_page("<div><p>bar</p><div>")) outer_element = session.find.css("custom-shadow-element", all=False) shadow_root = outer_element.shadow_root create_dialog(dialog_type, text=dialog_type) response = find_element(session, shadow_root.id, "css selector", "p") assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def test_handle_prompt_accept(session, create_dialog, dialog_type, retval): original_rect = session.window.rect create_dialog(dialog_type, text=dialog_type) response = get_window_rect(session) assert_success(response, original_rect) assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval)
def test_handle_prompt_default(session, create_dialog, dialog_type, retval): assert is_fullscreen(session) is False create_dialog(dialog_type, text=dialog_type) response = fullscreen(session) assert_error(response, "unexpected alert open") assert_dialog_handled(session, expected_text=dialog_type, expected_retval=retval) assert is_fullscreen(session) is False