From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001
From: "Matt A. Tobin"
Date: Fri, 2 Feb 2018 04:16:08 -0500
Subject: Add m-esr52 at 52.6.0
---
.../tests/old-tests/webdriver/README.md | 38 +++
.../tests/old-tests/webdriver/base_test.py | 60 ++++
.../webdriver/command_contexts/__init__.py | 0
.../command_contexts/open_and_close_window_test.py | 64 ++++
.../webdriver/command_contexts/res/first-page.html | 11 +
.../webdriver/command_contexts/res/other-page.html | 11 +
.../command_contexts/window_handle_test.py | 33 ++
.../webdriver/command_contexts/window_size_test.py | 35 +++
.../tests/old-tests/webdriver/cookie/__init__.py | 0
.../old-tests/webdriver/cookie/cookie_test.py | 57 ++++
.../webdriver/cookie/res/cookie_container.html | 5 +
.../webdriver/ecmascript/ecmascript_test.py | 17 +
.../webdriver/ecmascript/res/ecmascript_test.html | 2 +
.../webdriver/element_location/__init__.py | 0
.../element_location/element_location_test.py | 60 ++++
.../webdriver/element_location/res/elements.html | 10 +
.../old-tests/webdriver/element_state/__init__.py | 0
.../webdriver/element_state/method_test.py | 107 +++++++
.../webdriver/element_state/properties.py | 17 +
.../webdriver/element_state/res/0x0-pixels.html | 12 +
.../webdriver/element_state/res/1x1-pixels.html | 12 +
.../element_state/res/a-with-href-attribute.html | 5 +
...absolute-children-ancestor-hidden-overflow.html | 16 +
.../webdriver/element_state/res/body_empty.html | 4 +
.../webdriver/element_state/res/body_implicit.html | 3 +
.../element_state/res/body_overflow_hidden.html | 4 +
.../element_state/res/body_visibility_hidden.html | 4 +
.../webdriver/element_state/res/display-block.html | 5 +
.../element_state/res/display-none-child-link.html | 11 +
.../res/display-none-child-paragraph.html | 11 +
.../element_state/res/display-none-child.html | 11 +
.../element_state/res/display-none-dynamic.html | 10 +
.../display-none-parent-presedence-visibility.html | 15 +
.../res/display-none-parent-presedence.html | 14 +
.../webdriver/element_state/res/display-none.html | 11 +
...element-dynamically-moved-outside-viewport.html | 15 +
.../res/element-hidden-by-other-element.html | 20 ++
.../res/element-hidden-by-z-index.html | 29 ++
...nt-moved-behind-other-element-by-transform.html | 31 ++
...lement-moved-outside-viewport-by-transform.html | 15 +
.../res/element-outside-viewport.html | 13 +
.../element-partially-hidden-by-other-element.html | 23 ++
.../element_state/res/element-selected.html | 89 ++++++
.../res/element-with-color-style-attribute.html | 5 +
.../res/element-with-custom-attribute.html | 5 +
.../res/element-with-id-attribute.html | 5 +
.../res/element-with-same-color-as-background.html | 10 +
...ement-with-same-color-as-parent-background.html | 18 ++
.../res/element-with-style-attribute.html | 5 +
.../res/element-without-attribute.html | 5 +
.../webdriver/element_state/res/elements_text.html | 10 +
.../res/get-element-attribute-extended.html | 72 +++++
.../hidden-input-type-checkbox-untogglable.html | 9 +
.../res/hidden-input-type-text-writing.html | 9 +
.../webdriver/element_state/res/hidden.html | 5 +
.../element_state/res/img-with-src-attribute.html | 5 +
.../res/input-morphs-into-hidden.html | 10 +
.../res/input-type-hidden-unclickable.html | 5 +
.../element_state/res/input-type-hidden.html | 5 +
.../res/input-with-checked-attribute.html | 5 +
.../res/input-without-checked-attribute.html | 5 +
.../res/option-with-value-attribute.html | 7 +
.../res/option-without-value-attribute.html | 7 +
.../text-with-matching-color-and-background.html | 14 +
.../res/text-with-same-color-as-background.html | 12 +
.../text-with-same-color-as-parent-background.html | 14 +
.../element_state/res/visibility-child-link.html | 11 +
.../res/visibility-child-paragraph.html | 11 +
.../res/visibility-child-presedence.html | 12 +
.../element_state/res/visibility-child.html | 11 +
.../element_state/res/visibility-hidden.html | 11 +
.../element_state/res/visibility-visible.html | 5 +
.../element_state/res/x-auto-y-hidden.html | 30 ++
.../element_state/res/x-hidden-y-auto.html | 30 ++
.../element_state/res/x-hidden-y-hidden.html | 30 ++
.../element_state/res/x-hidden-y-scroll.html | 30 ++
.../element_state/res/x-scroll-y-hidden.html | 30 ++
.../zero-sized-element-with-sizable-decendant.html | 14 +
.../webdriver/element_state/selected_test.py | 210 +++++++++++++
.../webdriver/element_state/visibility_test.py | 324 +++++++++++++++++++
.../old-tests/webdriver/javascript/__init__.py | 0
.../webdriver/javascript/execute_script_test.py | 129 ++++++++
.../javascript/res/execute_script_test.html | 2 +
.../res/return_array_of_dom_elements.html | 3 +
.../javascript/res/return_document_body.html | 2 +
.../webdriver/javascript/res/return_node_list.html | 3 +
.../tests/old-tests/webdriver/modal/__init__.py | 0
.../old-tests/webdriver/modal/alerts_quit_test.py | 26 ++
.../tests/old-tests/webdriver/modal/alerts_test.py | 148 +++++++++
.../old-tests/webdriver/modal/res/alerts.html | 53 ++++
.../old-tests/webdriver/navigation/__init__.py | 0
.../old-tests/webdriver/navigation/auth_tests.py | 42 +++
.../old-tests/webdriver/navigation/forward.py | 24 ++
.../webdriver/navigation/forwardToNothing.py | 20 ++
.../webdriver/navigation/get_from_http_test.py | 60 ++++
.../webdriver/navigation/invalid_cert_test.py | 28 ++
.../old-tests/webdriver/navigation/refresh-page.py | 27 ++
.../old-tests/webdriver/navigation/refresh_page.py | 27 ++
.../webdriver/navigation/res/1s-meta-redirect.html | 4 +
.../navigation/res/60s-meta-redirect.html | 4 +
.../webdriver/navigation/res/authenticated.html | 5 +
.../old-tests/webdriver/navigation/res/empty.html | 4 +
.../webdriver/navigation/res/forwardNext.html | 6 +
.../webdriver/navigation/res/forwardStart.html | 6 +
.../webdriver/navigation/res/fragment.html | 9 +
.../navigation/res/instant-meta-redirect.html | 4 +
.../navigation/res/refreshPageDynamic.html | 10 +
.../navigation/res/refreshPageStatic.html | 6 +
.../webdriver/navigation/res/self-signed.key | 28 ++
.../tests/old-tests/webdriver/network.py | 30 ++
.../tests/old-tests/webdriver/runtests.py | 14 +
.../tests/old-tests/webdriver/runtests_p0.py | 42 +++
.../old-tests/webdriver/screenshot/__init__.py | 1 +
.../webdriver/screenshot/res/screenshot.html | 5 +
.../webdriver/screenshot/take_screenshot.py | 15 +
.../tests/old-tests/webdriver/timeouts/__init__.py | 0
.../webdriver/timeouts/implicit_waits_tests.py | 64 ++++
.../webdriver/timeouts/page_load_timeouts_tests.py | 26 ++
.../timeouts/res/implicit_waits_tests.html | 38 +++
.../timeouts/res/page_load_timeouts_tests.html | 12 +
.../old-tests/webdriver/user_input/__init__.py | 0
.../old-tests/webdriver/user_input/clear_test.py | 53 ++++
.../old-tests/webdriver/user_input/click_test.py | 349 +++++++++++++++++++++
.../old-tests/webdriver/user_input/res/click.html | 45 +++
.../res/element_clear_contenteditable_page.html | 13 +
.../res/element_clear_disabled_input_page.html | 11 +
.../res/element_clear_disabled_textarea_page.html | 13 +
.../res/element_clear_readonly_input_page.html | 11 +
.../res/element_clear_readonly_textarea_page.html | 13 +
.../res/element_clear_writable_input_page.html | 11 +
.../res/element_clear_writable_textarea_page.html | 13 +
.../user_input/res/text-form-landing.html | 8 +
.../webdriver/user_input/res/text-form.html | 25 ++
.../webdriver/user_input/sendkeys_test.py | 96 ++++++
.../tests/old-tests/webdriver/webdriver.cfg | 35 +++
.../tests/old-tests/webdriver/windows/__init__.py | 1 +
.../old-tests/webdriver/windows/res/win1.html | 5 +
.../old-tests/webdriver/windows/res/win2.html | 5 +
.../old-tests/webdriver/windows/res/win3.html | 5 +
.../old-tests/webdriver/windows/res/win4.html | 5 +
.../old-tests/webdriver/windows/res/win5.html | 5 +
.../tests/old-tests/webdriver/windows/tabbing.py | 30 ++
.../webdriver/windows/window_manipulation.py | 43 +++
143 files changed, 3638 insertions(+)
create mode 100644 testing/web-platform/tests/old-tests/webdriver/README.md
create mode 100644 testing/web-platform/tests/old-tests/webdriver/base_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/command_contexts/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/command_contexts/open_and_close_window_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/command_contexts/res/first-page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/command_contexts/res/other-page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/command_contexts/window_handle_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/command_contexts/window_size_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/cookie/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/cookie/cookie_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/cookie/res/cookie_container.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/ecmascript/ecmascript_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/ecmascript/res/ecmascript_test.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_location/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_location/element_location_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_location/res/elements.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/method_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/properties.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/0x0-pixels.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/1x1-pixels.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/a-with-href-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/absolute-children-ancestor-hidden-overflow.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/body_empty.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/body_implicit.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/body_overflow_hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/body_visibility_hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-block.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-link.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-paragraph.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-dynamic.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence-visibility.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-dynamically-moved-outside-viewport.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-other-element.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-z-index.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-behind-other-element-by-transform.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-outside-viewport-by-transform.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-outside-viewport.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-partially-hidden-by-other-element.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-selected.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-color-style-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-custom-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-id-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-background.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-parent-background.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-style-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/element-without-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/elements_text.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/get-element-attribute-extended.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-checkbox-untogglable.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-text-writing.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/img-with-src-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/input-morphs-into-hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden-unclickable.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/input-with-checked-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/input-without-checked-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/option-with-value-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/option-without-value-attribute.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-matching-color-and-background.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-background.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-parent-background.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-link.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-paragraph.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-presedence.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-visible.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/x-auto-y-hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-auto.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-scroll.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/x-scroll-y-hidden.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/res/zero-sized-element-with-sizable-decendant.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/selected_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/element_state/visibility_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/javascript/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/javascript/execute_script_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/javascript/res/execute_script_test.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/javascript/res/return_array_of_dom_elements.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/javascript/res/return_document_body.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/javascript/res/return_node_list.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/modal/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/modal/alerts_quit_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/modal/alerts_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/modal/res/alerts.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/forward.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageStatic.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/navigation/res/self-signed.key
create mode 100644 testing/web-platform/tests/old-tests/webdriver/network.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/runtests.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/runtests_p0.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/screenshot/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/screenshot/res/screenshot.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/screenshot/take_screenshot.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/timeouts/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/timeouts/implicit_waits_tests.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/timeouts/page_load_timeouts_tests.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/timeouts/res/implicit_waits_tests.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/timeouts/res/page_load_timeouts_tests.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/clear_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/click_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/click.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_contenteditable_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_disabled_input_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_disabled_textarea_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_readonly_input_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_readonly_textarea_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_writable_input_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/element_clear_writable_textarea_page.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/text-form-landing.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/res/text-form.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/user_input/sendkeys_test.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/webdriver.cfg
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/__init__.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/res/win1.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/res/win2.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/res/win3.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/res/win4.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/res/win5.html
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/tabbing.py
create mode 100644 testing/web-platform/tests/old-tests/webdriver/windows/window_manipulation.py
(limited to 'testing/web-platform/tests/old-tests/webdriver')
diff --git a/testing/web-platform/tests/old-tests/webdriver/README.md b/testing/web-platform/tests/old-tests/webdriver/README.md
new file mode 100644
index 000000000..7a89fb78a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/README.md
@@ -0,0 +1,38 @@
+# W3C Browser Automation Specification Tests
+
+This repository defines a set of conformance tests for the W3C web
+browser automation specification known as WebDriver. The purpose is
+for the different driver implementations to be tested to determine
+whether they meet the recognized standard.
+
+## How to run the tests
+
+1. Go to the WebDriver tests: `cd _WEBDRIVER_TEST_ROOT_`
+2. Run the tests: `python runtests.py`
+3. Run the test against a different config specified in webdriver.cfg:
+ `WD_BROWSER=chrome python runtests.py`
+
+To be run a specific test file you can just run `python test_file.py`
+
+Similarly you can specify a different browser to run against if in webdriver.cfg:
+ `WD_BROWSER=chrome python ecmascript/ecmascript_test.py`
+
+Note: that you will need likely need to start the driver's server before running.
+
+## Updating configuration
+
+The _webdriver.cfg_ file holds any configuration that the tests might
+require. Change the value of browser to your needs. This will then
+be picked up by WebDriverBaseTest when tests are run.
+
+Be sure not to commit your _webdriver.cfg_ changes when your create or modify tests.
+
+## How to write tests
+
+1. Create a test file per section from the specification.
+2. For each test there needs to be one or more corresponding HTML
+ files that will be used for testing. HTML files are not to be
+ reused between tests. HTML files and other support files
+ should be stored in a folder named 'res'.
+3. Test name should explain the intention of the test e.g. `def
+ test_navigate_and_return_title(self):`
diff --git a/testing/web-platform/tests/old-tests/webdriver/base_test.py b/testing/web-platform/tests/old-tests/webdriver/base_test.py
new file mode 100644
index 000000000..851099936
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/base_test.py
@@ -0,0 +1,60 @@
+import ConfigParser
+import json
+import os
+import sys
+import unittest
+
+from network import get_lan_ip
+
+repo_root = os.path.abspath(os.path.join(__file__, "../.."))
+sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
+sys.path.insert(1, os.path.join(repo_root, "tools", "wptserve"))
+from wptserve import server
+from selenium import webdriver
+
+
+class WebDriverBaseTest(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.driver = create_driver()
+
+ cls.webserver = server.WebTestHttpd(host=get_lan_ip())
+ cls.webserver.start()
+ cls.webserver.where_is = cls.webserver.get_url
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.webserver.stop()
+ if cls.driver:
+ cls.driver.quit()
+
+
+def create_driver():
+ config = ConfigParser.ConfigParser()
+ config.read('webdriver.cfg')
+ section = os.environ.get("WD_BROWSER", 'firefox')
+ if config.has_option(section, 'url'):
+ url = config.get(section, "url")
+ else:
+ url = 'http://127.0.0.1:4444/wd/hub'
+ capabilities = None
+ if config.has_option(section, 'capabilities'):
+ try:
+ capabilities = json.loads(config.get(section, "capabilities"))
+ except:
+ pass
+ mode = 'compatibility'
+ if config.has_option(section, 'mode'):
+ mode = config.get(section, 'mode')
+ if section == 'firefox':
+ driver = webdriver.Firefox()
+ elif section == 'chrome':
+ driver = webdriver.Chrome()
+ elif section == 'edge':
+ driver = webdriver.Remote()
+ elif section == 'ie':
+ driver = webdriver.Ie()
+ elif section == 'selendroid':
+ driver = webdriver.Android()
+
+ return driver
diff --git a/testing/web-platform/tests/old-tests/webdriver/command_contexts/__init__.py b/testing/web-platform/tests/old-tests/webdriver/command_contexts/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/command_contexts/open_and_close_window_test.py b/testing/web-platform/tests/old-tests/webdriver/command_contexts/open_and_close_window_test.py
new file mode 100644
index 000000000..61d04d93d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/command_contexts/open_and_close_window_test.py
@@ -0,0 +1,64 @@
+import os
+import sys
+import random
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
+sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
+from webdriver import exceptions
+
+
+class OpenAndCloseWindowTest(base_test.WebDriverBaseTest):
+ def setUp(self):
+ self.driver.get(self.webserver.where_is("command_contexts/res/first-page.html"))
+
+ def tearDown(self):
+ handles = self.driver.get_window_handles()
+
+ for i in range(len(handles) - 1):
+ self.driver.switch_to_window(handles[i])
+ self.driver.close()
+
+ self.driver.switch_to_window(self.driver.get_window_handles()[0])
+
+ def test_open_new_window(self):
+ handles = self.driver.get_window_handles()
+ self.driver.find_element_by_id("open_new_window").click()
+ self.assertEquals(len(handles) + 1, len(self.driver.get_window_handles()))
+
+ def test_get_window_handles_returns_the_windows_that_have_been_opened(self):
+ self.driver.find_element_by_id("open_new_window").click()
+ handles = self.driver.get_window_handles()
+ self.driver.switch_to_window(handles[0])
+ url1 = self.driver.get_current_url()
+ self.driver.switch_to_window(handles[1])
+ url2 = self.driver.get_current_url()
+
+ if url1 == self.webserver.where_is("controlling_windows/res/other-page.html"):
+ self.assertEquals(url2, self.webserver.where_is("controlling_windows/res/first-page.html"))
+ elif url1 == self.webserver.where_is("controlling_windows/res/first-page.html"):
+ self.assertEquals(url2, self.webserver.where_is("controlling_windows/res/other-page.html"))
+ else:
+ self.fail("The wrong set of URLs were returned")
+
+ def test_close_window(self):
+ open_windows = len(self.driver.get_window_handles())
+
+ self.driver.find_element_by_id("open_new_window").click()
+ self.assertEquals(1 + open_windows, len(self.driver.get_window_handles()))
+
+ self.driver.close()
+ self.assertEquals(open_windows, len(self.driver.get_window_handles()))
+
+ def test_command_sent_to_closed_window_returns_no_such_window_exception(self):
+ self.driver.find_element_by_id("open_new_window").click()
+ self.driver.close()
+
+ with self.assertRaises(exceptions.NoSuchWindowException):
+ self.driver.get_window_handle()
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/command_contexts/res/first-page.html b/testing/web-platform/tests/old-tests/webdriver/command_contexts/res/first-page.html
new file mode 100644
index 000000000..e4aa13ebd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/command_contexts/res/first-page.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+ First Page
+
+
+ Open new window
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/command_contexts/res/other-page.html b/testing/web-platform/tests/old-tests/webdriver/command_contexts/res/other-page.html
new file mode 100644
index 000000000..4bb487452
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/command_contexts/res/other-page.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+ Other Page
+
+
+ Open new window
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/command_contexts/window_handle_test.py b/testing/web-platform/tests/old-tests/webdriver/command_contexts/window_handle_test.py
new file mode 100644
index 000000000..6d8e569f0
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/command_contexts/window_handle_test.py
@@ -0,0 +1,33 @@
+import os
+import sys
+import random
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
+sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
+from webdriver import exceptions
+
+
+class WindowHandleTest(base_test.WebDriverBaseTest):
+ def setUp(self):
+ self.driver.get(self.webserver.where_is("command_contexts/res/first-page.html"))
+
+ def test_window_handle_is_not_current(self):
+ handle = self.driver.get_window_handle()
+ self.assertNotEquals(handle, "current")
+
+ def test_window_handles_are_unique(self):
+ number_of_windows = 20
+ new_window_button = self.driver.find_element_by_id("open_new_window")
+ for i in range(0, number_of_windows):
+ new_window_button.click()
+
+ handles = self.driver.get_window_handles()
+ if len(handles) > len(set(handles)):
+ self.fail('At least one window handle was repeated')
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/command_contexts/window_size_test.py b/testing/web-platform/tests/old-tests/webdriver/command_contexts/window_size_test.py
new file mode 100644
index 000000000..955e9fea0
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/command_contexts/window_size_test.py
@@ -0,0 +1,35 @@
+import os
+import sys
+import random
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
+sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
+from webdriver import exceptions
+
+class WindowSizeTest(base_test.WebDriverBaseTest):
+
+ def test_set_and_get_window_size(self):
+ self.driver.get(self.webserver.where_is("command_contexts/res/first-page.html"))
+
+ initial_dimensions = self.driver.get_window_size()
+
+ new_dimensions = {
+ "height": initial_dimensions["height"] - 100,
+ "width": initial_dimensions["width"] - 100}
+
+ try:
+ self.driver.set_window_size(new_dimensions["height"], new_dimensions["width"])
+
+ actual_dimensions = self.driver.get_window_size()
+
+ self.assertDictEqual(new_dimensions, actual_dimensions)
+ except exceptions.UnsupportedOperationException:
+ pass
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/cookie/__init__.py b/testing/web-platform/tests/old-tests/webdriver/cookie/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/cookie/cookie_test.py b/testing/web-platform/tests/old-tests/webdriver/cookie/cookie_test.py
new file mode 100644
index 000000000..e57d46713
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/cookie/cookie_test.py
@@ -0,0 +1,57 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.common import exceptions
+
+
+class CookieTest(base_test.WebDriverBaseTest):
+ def setUp(self):
+ self.driver.get(self.webserver.where_is("cookie/res/cookie_container.html"))
+
+ def test_can_create_a_well_formed_cookie( self ):
+ self.driver.add_cookie({'name': 'foo', 'value': 'bar'})
+
+ def test_cookies_should_allow_secure_to_be_set( self ):
+ name = 'foo'
+ self.driver.add_cookie({'name': name,
+ 'value': 'bar',
+ 'path': '/',
+ 'secure': (True)})
+ self.assertTrue(self.driver.get_cookie(name)[0]['secure'])
+
+ def test_secure_defaults_to_false( self ):
+ name = 'foo'
+ value = 'bar'
+
+ self.driver.add_cookie({ 'name': name,
+ 'value': value})
+
+ self.assertFalse(self.driver.get_cookie(name)[0]['secure'])
+
+ def test_should_throw_an_exception_when_semicolon_exists_in_the_cookie_attribute(self):
+ invalid_name = 'foo;bar'
+ try:
+ self.driver.add_cookie({'name': invalid_name, 'value': 'foobar'})
+ self.fail( 'should have thrown exceptions.' )
+
+ except exceptions.UnableToSetCookieException:
+ pass
+ except exceptions.InvalidCookieDomainException:
+ pass
+
+ def test_should_throw_an_exception_the_name_is_null(self):
+ try:
+ self.driver.add_cookie({'name': None, 'value': 'foobar'})
+ self.fail( 'should have thrown exceptions.' )
+
+ except exceptions.UnableToSetCookieException:
+ pass
+ except exceptions.InvalidCookieDomainException:
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/cookie/res/cookie_container.html b/testing/web-platform/tests/old-tests/webdriver/cookie/res/cookie_container.html
new file mode 100644
index 000000000..bb6b209bb
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/cookie/res/cookie_container.html
@@ -0,0 +1,5 @@
+
+
+Cookie Container
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/ecmascript/ecmascript_test.py b/testing/web-platform/tests/old-tests/webdriver/ecmascript/ecmascript_test.py
new file mode 100644
index 000000000..89764bf68
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/ecmascript/ecmascript_test.py
@@ -0,0 +1,17 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class EcmasScriptTest(base_test.WebDriverBaseTest):
+ def test_that_ecmascript_returns_document_title(self):
+ self.driver.get(self.webserver.where_is("ecmascript/res/ecmascript_test.html"))
+ result = self.driver.execute_script("return document.title;");
+ self.assertEquals("ecmascript test", result);
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/ecmascript/res/ecmascript_test.html b/testing/web-platform/tests/old-tests/webdriver/ecmascript/res/ecmascript_test.html
new file mode 100644
index 000000000..346e2ef75
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/ecmascript/res/ecmascript_test.html
@@ -0,0 +1,2 @@
+
+ecmascript test
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_location/__init__.py b/testing/web-platform/tests/old-tests/webdriver/element_location/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_location/element_location_test.py b/testing/web-platform/tests/old-tests/webdriver/element_location/element_location_test.py
new file mode 100644
index 000000000..aff548ea5
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_location/element_location_test.py
@@ -0,0 +1,60 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+class ElementLocationTest(base_test.WebDriverBaseTest):
+ def test_find_element_by_name(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_element_by_name("name")
+ self.assertEquals("name", e.text)
+
+ def test_find_element_by_css_selector(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_element_by_css_selector("#id")
+ self.assertEquals("id", e.text)
+
+ def test_find_element_by_link_text(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_element_by_link_text("link text")
+ self.assertEquals("link text", e.text)
+
+ def test_find_element_by_partial_link_text(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_element_by_partial_link_text("link tex")
+ self.assertEquals("link text", e.text)
+
+ def test_find_element_by_xpath(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_element_by_xpath("//*[@id='id']")
+ self.assertEquals("id", e.text)
+
+ def test_find_elements_by_name(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_elements_by_name("name")
+ self.assertEquals("name", e[0].text)
+
+ def test_find_elements_by_css_selector(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_elements_by_css_selector("#id")
+ self.assertEquals("id", e[0].text)
+
+ def test_find_elements_by_link_text(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_elements_by_link_text("link text")
+ self.assertEquals("link text", e[0].text)
+
+ def test_find_elements_by_partial_link_text(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_elements_by_partial_link_text("link tex")
+ self.assertEquals("link text", e[0].text)
+
+ def test_find_elements_by_xpath(self):
+ self.driver.get(self.webserver.where_is("element_location/res/elements.html"))
+ e = self.driver.find_elements_by_xpath("//*[@id='id']")
+ self.assertEquals("id", e[0].text)
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_location/res/elements.html b/testing/web-platform/tests/old-tests/webdriver/element_location/res/elements.html
new file mode 100644
index 000000000..45b7c2370
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_location/res/elements.html
@@ -0,0 +1,10 @@
+
+
+
+Element location
+
+
+ id
+ name
+ link text
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/__init__.py b/testing/web-platform/tests/old-tests/webdriver/element_state/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/method_test.py b/testing/web-platform/tests/old-tests/webdriver/element_state/method_test.py
new file mode 100644
index 000000000..85b240c7a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/method_test.py
@@ -0,0 +1,107 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class GetElementAttributeTest(base_test.WebDriverBaseTest):
+ def test_get_element_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-with-id-attribute.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertEqual("myId", el.get_attribute("id"))
+
+ def test_style_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-with-style-attribute.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ expected_style = """
+ font-family: \"Gill Sans Extrabold\",Helvetica,sans-serif;
+ line-height: 1.2; font-weight: bold;
+ """
+ self.assertEqual(expected_style, el.get_attribute("style"))
+
+ def test_color_serialization_of_style_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-with-color-style-attribute.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertEqual("color: rgba(255, 0, 0, 1.0);", el.get_attribute("style"))
+
+ def test_true_if_boolean_attribute_present(self):
+ self.driver.get(self.webserver.where_is("element_state/res/input-with-checked-attribute.html"))
+ el = self.driver.find_element_by_css_selector("input")
+ self.assertEqual("true", el.get_attribute("checked"))
+
+ def test_none_if_boolean_attribute_absent(self):
+ self.driver.get(self.webserver.where_is("element_state/res/input-without-checked-attribute.html"))
+ el = self.driver.find_element_by_css_selector("input")
+ self.assertIsNone(el.get_attribute("checked"))
+
+ def test_option_with_attribute_value(self):
+ self.driver.get(self.webserver.where_is("element_state/res/option-with-value-attribute.html"))
+ el = self.driver.find_element_by_css_selector("option")
+ self.assertEqual("value1", el.get_attribute("value"))
+
+ def test_option_without_value_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/option-without-value-attribute.html"))
+ el = self.driver.find_element_by_css_selector("option")
+ self.assertEqual("Value 1", el.get_attribute("value"))
+
+ def test_a_href_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/a-with-href-attribute.html"))
+ el = self.driver.find_element_by_css_selector("a")
+ self.assertEqual("http://web-platform.test:8000/path#fragment", el.get_attribute("href"))
+
+ def test_img_src_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/img-with-src-attribute.html"))
+ el = self.driver.find_element_by_css_selector("img")
+ self.assertEqual("http://web-platform.test:8000/images/blue.png", el.get_attribute("src"))
+
+ def test_custom_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-with-custom-attribute.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertEqual("attribute value", el.get_attribute("webdriver-custom-attribute"))
+
+ def test_attribute_not_present(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-without-attribute.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertIsNone(el.get_attribute("class"))
+
+ def test_find_attribute_with_special_characters(self):
+ self.driver.get(self.webserver.where_is("element_state/res/get-element-attribute-extended.html"))
+ element = self.driver.find_element_by_id("id_special_char_attribute_name")
+ attribute = element.get_attribute("*")
+ self.assertEquals("special_char_attribute_name", attribute)
+
+ def test_find_attribute_with_special_char_name_and_value(self):
+ self.driver.get(self.webserver.where_is("element_state/res/get-element-attribute-extended.html"))
+ element = self.driver.find_element_by_id("id_special_char_attribute_name_and_value")
+ attribute = element.get_attribute("@")
+ self.assertEquals("(", attribute)
+
+ def test_find_attribute_with_numeric_name(self):
+ self.driver.get(self.webserver.where_is("element_state/res/get-element-attribute-extended.html"))
+ element = self.driver.find_element_by_id("id_attribute_name_numeric")
+ attribute = element.get_attribute("1")
+ self.assertEquals("numeric attribute name", attribute)
+
+ def test_find_attribute_with_numeric_value(self):
+ self.driver.get(self.webserver.where_is("element_state/res/get-element-attribute-extended.html"))
+ element = self.driver.find_element_by_id("id_attribute_value_numeric")
+ attribute = element.get_attribute("one")
+ self.assertEquals("2", attribute)
+
+ def test_find_attribute_with_negative_numeric_name(self):
+ self.driver.get(self.webserver.where_is("element_state/res/get-element-attribute-extended.html"))
+ element = self.driver.find_element_by_id("id_attribute_negative_numeric_name")
+ attribute = element.get_attribute("-5")
+ self.assertEquals("attribute name is -5", attribute)
+
+ def test_find_attribute_with_negative_numeric_value(self):
+ self.driver.get(self.webserver.where_is("element_state/res/get-element-attribute-extended.html"))
+ element = self.driver.find_element_by_id("id_attribute_negative_numeric_value")
+ attribute = element.get_attribute("negative_numeric_value")
+ self.assertEquals("-9", attribute)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/properties.py b/testing/web-platform/tests/old-tests/webdriver/element_state/properties.py
new file mode 100644
index 000000000..a76770085
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/properties.py
@@ -0,0 +1,17 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class GetElementPropertiesTest(base_test.WebDriverBaseTest):
+ def test_get_element_text(self):
+ self.driver.get(self.webserver.where_is("element_state/res/elements_text.html"))
+ e = self.driver.find_element_by_name("name")
+ self.assertEquals("name", e.text)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/0x0-pixels.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/0x0-pixels.html
new file mode 100644
index 000000000..3b081ca09
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/0x0-pixels.html
@@ -0,0 +1,12 @@
+
+
+0x0 pixel element
+
+
+
+This element is not visible.
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/1x1-pixels.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/1x1-pixels.html
new file mode 100644
index 000000000..f9b2cbc3c
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/1x1-pixels.html
@@ -0,0 +1,12 @@
+
+
+1x1 pixel element
+
+
+
+This element is visible.
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/a-with-href-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/a-with-href-attribute.html
new file mode 100644
index 000000000..7722426a3
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/a-with-href-attribute.html
@@ -0,0 +1,5 @@
+
+
+"a" element with not fully qualified url
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/absolute-children-ancestor-hidden-overflow.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/absolute-children-ancestor-hidden-overflow.html
new file mode 100644
index 000000000..fcf104414
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/absolute-children-ancestor-hidden-overflow.html
@@ -0,0 +1,16 @@
+
+
+Parent node visible with absolutely positioned children, where ancestor overflow is hidden
+
+
+
+
+
grated
+
cheese
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_empty.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_empty.html
new file mode 100644
index 000000000..0f4dff691
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_empty.html
@@ -0,0 +1,4 @@
+
+
+
BODY element has no children. MUST be reported displayed
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_implicit.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_implicit.html
new file mode 100644
index 000000000..f45815380
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_implicit.html
@@ -0,0 +1,3 @@
+
+
+BODY tag is omitted; BODY element MUST be reported displayed
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_overflow_hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_overflow_hidden.html
new file mode 100644
index 000000000..1411ef37b
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_overflow_hidden.html
@@ -0,0 +1,4 @@
+
+
+BODY element with style=overflow:hidden. MUST be reported displayed
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_visibility_hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_visibility_hidden.html
new file mode 100644
index 000000000..ce4d41036
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/body_visibility_hidden.html
@@ -0,0 +1,4 @@
+
+
+
BODY element with style=visibility:hidden. MUST be reported displayed
+
+
+ selected-1
+
+
+ selected-2
+ unselected-1
+
+
+ unselected-2
+ selected-3
+ unselected-3
+
+
+ unselected-4
+ unselected-5
+ selected-4
+
+
+ unselected-6
+ selected-5
+
+
+
+ unselected-7
+ unselected-8
+
+
+ selected-6
+ unselected-9
+ selected-7
+
+
+
+Input Checkbox Elements
+ selected-8
+
+ selected-9
+
+ unselected-10
+ unselected-11
+
+ unselected-12
+
+ unselected-13
+ selected-10
+
+Input Radio Elements
+ Group 1:
+ selected-11
+ Group 2:
+ selected-12
+
+ Group 3:
+ unselected-14
+ selected-13
+ Group 4:
+ unselected-15
+ selected-14
+ Group 5:
+ unselected-16
+ unselected-17
+
+ Group 6
+ selected-15
+ unselected-18
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-color-style-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-color-style-attribute.html
new file mode 100644
index 000000000..acf2fc095
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-color-style-attribute.html
@@ -0,0 +1,5 @@
+
+
+Element with color style attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-custom-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-custom-attribute.html
new file mode 100644
index 000000000..8f84b97ff
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-custom-attribute.html
@@ -0,0 +1,5 @@
+
+
+Element with custom attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-id-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-id-attribute.html
new file mode 100644
index 000000000..7512344f5
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-id-attribute.html
@@ -0,0 +1,5 @@
+
+
+Element with id attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-background.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-background.html
new file mode 100644
index 000000000..aaea9a935
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-background.html
@@ -0,0 +1,10 @@
+
+
+Element with same color as background
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-parent-background.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-parent-background.html
new file mode 100644
index 000000000..80a4118df
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-same-color-as-parent-background.html
@@ -0,0 +1,18 @@
+
+
+Element with same color as background
+
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-style-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-style-attribute.html
new file mode 100644
index 000000000..b163a751a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-with-style-attribute.html
@@ -0,0 +1,5 @@
+
+
+Element with style attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-without-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-without-attribute.html
new file mode 100644
index 000000000..b03d4545b
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-without-attribute.html
@@ -0,0 +1,5 @@
+
+
+Element without attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/elements_text.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/elements_text.html
new file mode 100644
index 000000000..45b7c2370
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/elements_text.html
@@ -0,0 +1,10 @@
+
+
+
+Element location
+
+
+ id
+ name
+ link text
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/get-element-attribute-extended.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/get-element-attribute-extended.html
new file mode 100644
index 000000000..1fff60f03
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/get-element-attribute-extended.html
@@ -0,0 +1,72 @@
+
+
+Get Element Attribute Extended
+
+Span
+Span
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-checkbox-untogglable.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-checkbox-untogglable.html
new file mode 100644
index 000000000..7e7c2e238
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-checkbox-untogglable.html
@@ -0,0 +1,9 @@
+
+
+Hidden INPUT @type="checkbox" is untogglable
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-text-writing.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-text-writing.html
new file mode 100644
index 000000000..a1db85009
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden-input-type-text-writing.html
@@ -0,0 +1,9 @@
+
+
+Typing in hidden input is impossible
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden.html
new file mode 100644
index 000000000..0e8097e97
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/hidden.html
@@ -0,0 +1,5 @@
+
+This will not be visible
+
+
My parent is hidden so you can't see me
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/img-with-src-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/img-with-src-attribute.html
new file mode 100644
index 000000000..057bb9bf5
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/img-with-src-attribute.html
@@ -0,0 +1,5 @@
+
+
+"img" element with not fully qualified url
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-morphs-into-hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-morphs-into-hidden.html
new file mode 100644
index 000000000..98b954855
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-morphs-into-hidden.html
@@ -0,0 +1,10 @@
+
+
+INPUT motphs into @type="hidden"
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden-unclickable.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden-unclickable.html
new file mode 100644
index 000000000..b06822b10
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden-unclickable.html
@@ -0,0 +1,5 @@
+
+
+INPUT @type="hidden" is unclickable
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden.html
new file mode 100644
index 000000000..b7195709d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-type-hidden.html
@@ -0,0 +1,5 @@
+
+
+INPUT @type="hidden" are always hidden
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-with-checked-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-with-checked-attribute.html
new file mode 100644
index 000000000..d7aad5ea5
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-with-checked-attribute.html
@@ -0,0 +1,5 @@
+
+
+Input with checked attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-without-checked-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-without-checked-attribute.html
new file mode 100644
index 000000000..9f1d5ad35
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/input-without-checked-attribute.html
@@ -0,0 +1,5 @@
+
+
+Input without checked attribute
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/option-with-value-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/option-with-value-attribute.html
new file mode 100644
index 000000000..5ef08c405
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/option-with-value-attribute.html
@@ -0,0 +1,7 @@
+
+
+Option with value attribute
+
+
+ Value 1
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/option-without-value-attribute.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/option-without-value-attribute.html
new file mode 100644
index 000000000..5f6087ddd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/option-without-value-attribute.html
@@ -0,0 +1,7 @@
+
+
+Option without value attribute
+
+
+ Value 1
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-matching-color-and-background.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-matching-color-and-background.html
new file mode 100644
index 000000000..d6591ef04
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-matching-color-and-background.html
@@ -0,0 +1,14 @@
+
+
+Text with matching color and background
+
+
+
+
+ This on the other hand, should be visible
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-background.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-background.html
new file mode 100644
index 000000000..e6290d576
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-background.html
@@ -0,0 +1,12 @@
+
+
+Text with same color as background
+
+
+
+
+ Shouldn't be visible.
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-parent-background.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-parent-background.html
new file mode 100644
index 000000000..f7480f509
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/text-with-same-color-as-parent-background.html
@@ -0,0 +1,14 @@
+
+
+Text with same color as parent background
+
+
+
+
+
+ Should not be visible
+
+
g
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-link.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-link.html
new file mode 100644
index 000000000..638c3c9ee
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-link.html
@@ -0,0 +1,11 @@
+
+
+visibility: hidden applies to child node of type A
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-paragraph.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-paragraph.html
new file mode 100644
index 000000000..8f703ba54
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-paragraph.html
@@ -0,0 +1,11 @@
+
+
+visibility: hidden applies to child nodes of type P
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-presedence.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-presedence.html
new file mode 100644
index 000000000..adf679c8a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child-presedence.html
@@ -0,0 +1,12 @@
+
+
+visibility: visible on child node takes presedence
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child.html
new file mode 100644
index 000000000..5464025fa
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-child.html
@@ -0,0 +1,11 @@
+
+
+visibility: hidden applies to child nodes
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-hidden.html
new file mode 100644
index 000000000..24e89499f
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-hidden.html
@@ -0,0 +1,11 @@
+
+
+visibility: hidden;
+
+
+
+This element is not visible.
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-visible.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-visible.html
new file mode 100644
index 000000000..e0c090217
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/visibility-visible.html
@@ -0,0 +1,5 @@
+
+
+visibility: visible;
+
+This element is visible.
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-auto-y-hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-auto-y-hidden.html
new file mode 100644
index 000000000..e9ce24c73
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-auto-y-hidden.html
@@ -0,0 +1,30 @@
+
+
+
+ Page with overflow
+
+
+
+
+
+
+ Right clicked:
+ Bottom clicked:
+ Bottom-right clicked:
+
+
+
Click bottom
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-auto.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-auto.html
new file mode 100644
index 000000000..22b5049ff
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-auto.html
@@ -0,0 +1,30 @@
+
+
+
+ Page with overflow
+
+
+
+
+
+
+ Right clicked:
+ Bottom clicked:
+ Bottom-right clicked:
+
+
+
Click bottom
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-hidden.html
new file mode 100644
index 000000000..c26b48aea
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-hidden.html
@@ -0,0 +1,30 @@
+
+
+
+ Page with overflow
+
+
+
+
+
+
+ Right clicked:
+ Bottom clicked:
+ Bottom-right clicked:
+
+
+
Click bottom
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-scroll.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-scroll.html
new file mode 100644
index 000000000..b98b79a7e
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-hidden-y-scroll.html
@@ -0,0 +1,30 @@
+
+
+
+ Page with overflow
+
+
+
+
+
+
+ Right clicked:
+ Bottom clicked:
+ Bottom-right clicked:
+
+
+
Click bottom
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-scroll-y-hidden.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-scroll-y-hidden.html
new file mode 100644
index 000000000..9348681ac
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/x-scroll-y-hidden.html
@@ -0,0 +1,30 @@
+
+
+
+ Page with overflow
+
+
+
+
+
+
+ Right clicked:
+ Bottom clicked:
+ Bottom-right clicked:
+
+
+
Click bottom
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/zero-sized-element-with-sizable-decendant.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/zero-sized-element-with-sizable-decendant.html
new file mode 100644
index 000000000..f7e37f855
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/zero-sized-element-with-sizable-decendant.html
@@ -0,0 +1,14 @@
+
+
+Zero sized element with sizable decendant
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/selected_test.py b/testing/web-platform/tests/old-tests/webdriver/element_state/selected_test.py
new file mode 100644
index 000000000..9c80f29f6
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/selected_test.py
@@ -0,0 +1,210 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class GetElementSelectedTest(base_test.WebDriverBaseTest):
+ def test_selected_1(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-1")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_2(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-2")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_3(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-3")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_4(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-4")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_5(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-5")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_6(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-6")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_7(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-7")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_8(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-8")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_9(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-9")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_10(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-10")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_11(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-11")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_12(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-12")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_13(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-13")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_14(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-14")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_selected_15(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("selected-15")
+
+ self.assertEquals(element.is_selected(), True)
+
+ def test_unselected_1(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-1")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_2(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-2")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_3(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-3")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_4(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-4")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_5(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-5")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_6(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-6")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_7(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-7")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_8(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-8")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_9(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-9")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_10(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-10")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_11(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-11")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_12(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-12")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_13(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-13")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_14(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-14")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_15(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-15")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_16(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-16")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_17(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-17")
+
+ self.assertEquals(element.is_selected(), False)
+
+ def test_unselected_18(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
+ element = self.driver.find_element_by_id("unselected-18")
+
+ self.assertEquals(element.is_selected(), False)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/visibility_test.py b/testing/web-platform/tests/old-tests/webdriver/element_state/visibility_test.py
new file mode 100644
index 000000000..58218a7ff
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/element_state/visibility_test.py
@@ -0,0 +1,324 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.common import exceptions
+
+
+class NaturalNonVisibleElementsTest(base_test.WebDriverBaseTest):
+ def test_0x0_pixel_element_is_not_visible(self):
+ self.driver.get(self.webserver.where_is("element_state/res/0x0-pixels.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertFalse(el.is_displayed())
+
+ def test_0x0_pixel_text_node_is_visible(self):
+ self.driver.get(self.webserver.where_is("element_state/res/0x0-pixels-text-node.html"))
+ el = self.driver.find_element_by_css_selector("p")
+ self.assertTrue(el.is_displayed())
+
+ def test_1x1_pixel_element(self):
+ self.driver.get(self.webserver.where_is("element_state/res/1x1-pixels.html"))
+ el = self.driver.find_element_by_css_selector("p")
+ self.assertTrue(el.is_displayed())
+
+ def test_zero_sized_element_is_shown_if_decendant_has_size(self):
+ self.driver.get(self.webserver.where_is("element_state/res/zero-sized-element-with-sizable-decendant.html"))
+ parent = self.driver.find_element_by_css_selector("#parent")
+ child = self.driver.find_element_by_css_selector("#child")
+
+ self.assertTrue(parent.is_displayed())
+ self.assertTrue(child.is_displayed())
+
+ def test_input_type_hidden_is_never_visible(self):
+ self.driver.get(self.webserver.where_is("element_state/res/input-type-hidden.html"))
+ input = self.driver.find_element_by_css_selector("input")
+ self.assertFalse(input.is_displayed())
+
+ def test_input_morphs_into_hidden(self):
+ self.driver.get(self.webserver.where_is("element_state/res/input-morphs-into-hidden.html"))
+ input = self.driver.find_element_by_css_selector("input")
+ self.assertFalse(input.is_displayed())
+
+ def test_parent_node_visible_when_all_children_are_absolutely_positioned_and_overflow_is_hidden(self):
+ pass
+
+ def test_parent_of_absolutely_positioned_elements_visible_where_ancestor_overflow_is_hidden(self):
+ """When a parent's ancestor hides any overflow, absolutely positioned child elements are
+ still visible. The parent container is also considered visible by webdriver for this
+ reason because it is interactable."""
+
+ self.driver.get(self.webserver.where_is("element_state/res/absolute-children-ancestor-hidden-overflow.html"))
+
+ children = self.driver.find_elements_by_css_selector(".child")
+ assert all(child.is_displayed() for child in children)
+
+ parent = self.driver.find_element_by_css_selector("#parent")
+ assert parent.is_displayed()
+
+ def test_element_hidden_by_overflow_x_is_not_visible(self):
+ # TODO(andreastt): This test should probably be split in three. Also it's making two
+ # assertions.
+ pages = ["element_state/res/x-hidden-y-hidden.html",
+ "element_state/res/x-hidden-y-scroll.html",
+ "element_state/res/x-hidden-y-auto.html"]
+
+ for page in pages:
+ self.driver.get(self.webserver.where_is(page))
+ right = self.driver.find_element_by_css_selector("#right")
+ bottom_right = self.driver.find_element_by_css_selector("#bottom-right")
+
+ self.assertFalse(right.is_displayed())
+ self.assertFalse(bottom_right.is_displayed())
+
+ def test_element_hidden_by_overflow_y_is_not_visible(self):
+ # TODO(andreastt): This test should probably be split in three. Also it's making two
+ # assertions.
+ pages = ["element_state/res/x-hidden-y-hidden.html",
+ "element_state/res/x-scroll-y-hidden.html",
+ "element_state/res/x-auto-y-hidden.html"]
+
+ for page in pages:
+ self.driver.get(self.webserver.where_is(page))
+ bottom = self.driver.find_element_by_css_selector("#bottom")
+ bottom_right = self.driver.find_element_by_css_selector("#bottom-right")
+
+ self.assertFalse(bottom.is_displayed())
+ self.assertFalse(bottom_right.is_displayed())
+
+ def test_parent_node_visible_when_all_children_are_absolutely_position_and_overflow_is_hidden(self):
+ pass
+
+ def test_element_scrollable_by_overflow_x_is_visible(self):
+ pass
+
+ def test_element_scrollable_by_overflow_y_is_visible(self):
+ pass
+
+ def test_element_scrollable_by_overflow_x_and_y_is_visible(self):
+ pass
+
+ def test_element_scrollable_by_overflow_y_is_visible(self):
+ pass
+
+ def test_element_outside_viewport(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-outside-viewport.html"))
+ hidden = self.driver.find_element_by_css_selector("div")
+ self.assertFalse(hidden.is_displayed())
+
+ def test_element_dynamically_moved_outside_viewport(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-dynamically-moved-outside-viewport.html"))
+ hidden = self.driver.find_element_by_css_selector("div")
+ self.assertFalse(hidden.is_displayed())
+
+ def test_element_hidden_by_other_element(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-hidden-by-other-element.html"))
+ overlay = self.driver.find_element_by_css_selector("#overlay")
+ hidden = self.driver.find_element_by_css_selector("#hidden")
+
+ self.assertTrue(overlay.is_displayed())
+ self.assertFalse(hidden.is_displayed())
+
+ def test_element_partially_hidden_by_other_element(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-partially-hidden-by-other-element.html"))
+ partial = self.driver.find_element_by_css_selector("#partial")
+ self.assertTrue(partial.is_displayed())
+
+ def test_element_hidden_by_z_index(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-hidden-by-z-index.html"))
+ overlay = self.driver.find_element_by_css_selector("#overlay")
+ hidden = self.driver.find_element_by_css_selector("#hidden")
+
+ self.assertTrue(overlay.is_displayed())
+ self.assertFalse(hidden.is_displayed())
+
+ def test_element_moved_outside_viewport_by_transform(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-moved-outside-viewport-by-transform.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertFalse(el.is_displayed())
+
+ def test_element_moved_behind_other_element_by_transform(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-moved-behind-other-element-by-transform.html"))
+ overlay = self.driver.find_element_by_css_selector("#overlay")
+ hidden = self.driver.find_element_by_css_selector("#hidden")
+
+ self.assertTrue(overlay.is_displayed())
+ self.assertFalse(hidden.is_displayed())
+
+ def test_text_with_same_color_as_background(self):
+ self.driver.get(self.webserver.where_is("element_state/res/text-with-same-color-as-background.html"))
+ p = self.driver.find_element_by_css_selector("p")
+ self.assertFalse(p.is_displayed())
+
+ def test_text_with_same_color_as_parent_background(self):
+ self.driver.get(self.webserver.where_is("element_state/res/text-with-same-color-as-parent-background.html"))
+ p = self.driver.find_element_by_css_selector("p")
+ self.assertFalse(p.is_displayed())
+
+ def test_text_with_matching_color_and_background(self):
+ self.driver.get(self.webserver.where_is("element_state/res/text-with-matching-color-and-background.html"))
+ p = self.driver.find_element_by_css_selector("p")
+ self.assertTrue(p.is_displayed())
+
+ def test_element_with_same_color_as_background(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-with-same-color-as-background.html"))
+ el = self.driver.find_element_by_css_selector("div")
+ self.assertFalse(el.is_displayed())
+
+ def test_element_with_same_color_as_parent_background(self):
+ self.driver.get(self.webserver.where_is("element_state/res/element-with-same-color-as-parent-background.html"))
+ hidden = self.driver.find_element_by_css_selector("#hidden")
+ self.assertFalse(hidden.is_displayed())
+
+
+class BodyElementIsAlwaysDisplayedTest(base_test.WebDriverBaseTest):
+ def assert_body_is_displayed_on(self, page):
+ self.driver.get(self.webserver.where_is(page))
+ body = self.driver.find_element_by_css_selector("body")
+ assert body.is_displayed()
+
+ def test_implicit(self):
+ self.assert_body_is_displayed_on("element_state/res/body_implicit.html")
+
+ def test_empty(self):
+ self.assert_body_is_displayed_on("element_state/res/body_empty.html")
+
+ def test_visibility_hidden(self):
+ self.assert_body_is_displayed_on("element_state/res/body_visibility_hidden.html")
+
+ def test_overflow_hidden(self):
+ self.assert_body_is_displayed_on("element_state/res/body_overflow_hidden.html")
+
+
+class DisplayTest(base_test.WebDriverBaseTest):
+ def test_display_block(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-block.html"))
+ el = self.driver.find_element_by_css_selector("p")
+ self.assertTrue(el.is_displayed())
+
+ def test_display_none(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none.html"))
+ el = self.driver.find_element_by_css_selector("p")
+ self.assertFalse(el.is_displayed())
+
+ def test_display_none_hides_child_node(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none-child.html"))
+ parent = self.driver.find_element_by_css_selector("#parent")
+ child = self.driver.find_element_by_css_selector("#child")
+
+ self.assertFalse(parent.is_displayed())
+ self.assertFalse(child.is_displayed())
+
+ def test_display_none_hides_child_node_link(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none-child-link.html"))
+ child = self.driver.find_element_by_css_selector("#child")
+ self.assertFalse(child.is_displayed())
+
+ def test_display_none_hides_child_node_paragraph(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none-child-paragraph.html"))
+ child = self.driver.find_element_by_css_selector("#child")
+ self.assertFalse(child.is_displayed())
+
+ def test_display_none_on_parent_takes_presedence(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none-parent-presedence.html"))
+ child = self.driver.find_element_by_css_selector("#child")
+ self.assertFalse(child.is_displayed())
+
+ def test_display_none_on_parent_takes_presedence_over_visibility_visible(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none-parent-presedence-visibility.html"))
+ child = self.driver.find_element_by_css_selector("#child")
+ self.assertFalse(child.is_displayed())
+
+ def test_display_none_hidden_dynamically(self):
+ self.driver.get(self.webserver.where_is("element_state/res/display-none-dynamic.html"))
+ hidden = self.driver.find_element_by_css_selector("#hidden")
+ self.assertFalse(hidden.is_displayed())
+
+
+class VisibilityTest(base_test.WebDriverBaseTest):
+ def test_element_state_hidden(self):
+ self.driver.get(self.webserver.where_is("element_state/res/visibility-hidden.html"))
+ el = self.driver.find_element_by_css_selector("p")
+ self.assertFalse(el.is_displayed())
+
+ def test_element_state_visible(self):
+ self.driver.get(self.webserver.where_is("element_state/res/visibility-visible.html"))
+ el = self.driver.find_element_by_css_selector("p")
+ self.assertTrue(el.is_displayed())
+
+ def test_visibility_hidden_hides_child_node(self):
+ self.driver.get(self.webserver.where_is("element_state/res/visibility-child.html"))
+ parent = self.driver.find_element_by_css_selector("#parent")
+ child = self.driver.find_element_by_css_selector("#child")
+
+ self.assertFalse(parent.is_displayed())
+ self.assertFalse(child.is_displayed())
+
+ def test_visibility_hidden_hides_child_node_link(self):
+ self.driver.get(self.webserver.where_is("element_state/res/visibility-child-link.html"))
+ parent = self.driver.find_element_by_css_selector("#parent")
+ child = self.driver.find_element_by_css_selector("#child")
+
+ self.assertFalse(parent.is_displayed())
+ self.assertFalse(child.is_displayed())
+
+ def test_visibility_hidden_hides_child_node_paragraph(self):
+ self.driver.get(self.webserver.where_is("element_state/res/visibility-child-paragraph.html"))
+ parent = self.driver.find_element_by_css_selector("#parent")
+ child = self.driver.find_element_by_css_selector("#child")
+
+ self.assertFalse(parent.is_displayed())
+ self.assertFalse(child.is_displayed())
+
+ def test_visibility_hidden_on_child_takes_precedence(self):
+ self.driver.get(self.webserver.where_is("element_state/res/visibility-child-presedence.html"))
+ child = self.driver.find_element_by_css_selector("#child")
+ self.assertTrue(child.is_displayed())
+
+ def test_visibility_hidden_on_parent_takes_precedence_over_display_block(self):
+ pass
+
+ def test_visibility_hidden_set_dynamically(self):
+ pass
+
+ def test_should_show_element_not_visible_with_hidden_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/hidden.html"))
+ singleHidden = self.driver.find_element_by_css_selector('#singleHidden')
+ self.assertFalse(singleHidden.is_displayed())
+
+ def test_should_show_element_not_visible_when_parent_element_has_hidden_attribute(self):
+ self.driver.get(self.webserver.where_is("element_state/res/hidden.html"))
+ child = self.driver.find_element_by_css_selector('#child')
+ self.assertFalse(child.is_displayed())
+
+
+class VisibilityInteractionTest(base_test.WebDriverBaseTest):
+ def test_input_hidden_is_unclickable(self):
+ self.driver.get(self.webserver.where_is("element_state/res/input-type-hidden-unclickable.html"))
+ input = self.driver.find_element_by_css_selector("input")
+
+ with self.assertRaises(exceptions.ElementNotVisibleException):
+ input.click()
+
+ def test_hidden_input_checkbox_is_untogglable(self):
+ self.driver.get(self.webserver.where_is("element_state/res/hidden-input-type-checkbox-untogglable.html"))
+ checkbox = self.driver.find_element_by_css_selector("input")
+
+ with self.assertRaises(exceptions.ElementNotVisibleException):
+ checkbox.click()
+
+ def test_typing_in_hidden_input_is_impossible(self):
+ self.driver.get(self.webserver.where_is("element_state/res/hidden-input-type-text-writing.html"))
+ textfield = self.driver.find_element_by_css_selector("input")
+
+ with self.assertRaises(exceptions.ElementNotVisibleException):
+ textfield.send_keys("Koha is a popular Indian cheese")
+
+
+class OpacityTest(base_test.WebDriverBaseTest):
+ pass
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/javascript/__init__.py b/testing/web-platform/tests/old-tests/webdriver/javascript/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/javascript/execute_script_test.py b/testing/web-platform/tests/old-tests/webdriver/javascript/execute_script_test.py
new file mode 100644
index 000000000..dd7cfca94
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/javascript/execute_script_test.py
@@ -0,0 +1,129 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.webdriver.remote.webelement import WebElement
+
+
+class ExecuteScriptTest(base_test.WebDriverBaseTest):
+ def test_ecmascript_translates_null_return_to_none(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ result = self.driver.execute_script("return null;")
+ self.assertIsNone(result)
+
+ def test_ecmascript_translates_undefined_return_to_none(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ result = self.driver.execute_script("var undef; return undef;")
+ self.assertIsNone(result)
+
+ def test_can_return_numbers_from_scripts(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ self.assertEquals(1, self.driver.execute_script("return 1;"))
+ self.assertEquals(3.14, self.driver.execute_script("return 3.14;"))
+
+ def test_can_return_strings_from_scripts(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ self.assertEquals("hello, world!",
+ self.driver.execute_script("return 'hello, world!'"))
+
+ def test_can_return_booleans_from_scripts(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ self.assertTrue(self.driver.execute_script("return true;"))
+ self.assertFalse(self.driver.execute_script("return false;"))
+
+ def test_can_return_an_array_of_primitives(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+
+ result = self.driver.execute_script("return [1, false, null, 3.14]")
+ self.assertListEqual([1, False, None, 3.14], result)
+
+ def test_can_return_nested_arrays(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ result = self.driver.execute_script("return [[1, 2, [3]]]")
+
+ self.assertIsInstance(result, list)
+ self.assertEquals(1, len(result))
+
+ result = result[0]
+ self.assertListEqual([1, 2], result[:2])
+ self.assertListEqual([3], result[2])
+
+ def test_can_return_object_literals(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+
+ result = self.driver.execute_script("return {}")
+ self.assertDictEqual({}, result)
+
+ result = self.driver.execute_script("return {a: 1, b: false, c: null}")
+ self.assertDictEqual({
+ "a": 1,
+ "b": False,
+ "c": None
+ }, result)
+
+ def test_can_return_complex_object_literals(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ result = self.driver.execute_script("return {a:{b: 'hello'}}")
+ self.assertIsInstance(result, dict)
+ self.assertIsInstance(result['a'], dict)
+ self.assertDictEqual({"b": "hello"}, result["a"])
+
+ def test_dom_element_return_value_is_translated_to_a_web_element(self):
+ self.driver.get(self.webserver.where_is(
+ "javascript/res/return_document_body.html"))
+
+ result = self.driver.execute_script("return document.body")
+ self.assertEquals(result.text, "Hello, world!")
+
+ def test_return_an_array_of_dom_elements(self):
+ self.driver.get(self.webserver.where_is(
+ "javascript/res/return_array_of_dom_elements.html"))
+
+ result = self.driver.execute_script(
+ "var nodes = document.getElementsByTagName('div');"
+ "return [nodes[0], nodes[1]]")
+
+ self.assertIsInstance(result, list)
+ self.assertEquals(2, len(result))
+ self.assertEquals("a", result[0].text)
+ self.assertEquals("b", result[1].text)
+
+ def test_node_list_return_value_is_translated_to_list_of_web_elements(self):
+ self.driver.get(self.webserver.where_is(
+ "javascript/res/return_array_of_dom_elements.html"))
+
+ result = self.driver.execute_script(
+ "return document.getElementsByTagName('div');")
+
+ self.assertIsInstance(result, list)
+ self.assertEquals(2, len(result))
+ self.assertEquals("a", result[0].text)
+ self.assertEquals("b", result[1].text)
+
+ def test_return_object_literal_with_dom_element_property(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ result = self.driver.execute_script("return {a: document.body}")
+ self.assertIsInstance(result, dict)
+ self.assertEquals("body", result["a"].tag_name)
+
+ def test_scripts_execute_in_anonymous_function_and_do_not_pollute_global_scope(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ self.driver.execute_script("var x = 1;")
+ self.assertEquals("undefined", self.driver.execute_script("return typeof x;"));
+
+ def test_scripts_can_modify_context_window_object(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ self.driver.execute_script("window.x = 1;")
+ self.assertEquals("number", self.driver.execute_script("return typeof x;"));
+ self.assertEquals(1, self.driver.execute_script("return x;"));
+
+ def test_that_ecmascript_returns_document_title(self):
+ self.driver.get(self.webserver.where_is("javascript/res/execute_script_test.html"))
+ result = self.driver.execute_script("return document.title;")
+ self.assertEquals("executeScript test", result)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/javascript/res/execute_script_test.html b/testing/web-platform/tests/old-tests/webdriver/javascript/res/execute_script_test.html
new file mode 100644
index 000000000..9491b441a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/javascript/res/execute_script_test.html
@@ -0,0 +1,2 @@
+
+executeScript test
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_array_of_dom_elements.html b/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_array_of_dom_elements.html
new file mode 100644
index 000000000..32827f950
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_array_of_dom_elements.html
@@ -0,0 +1,3 @@
+
+a
+b
diff --git a/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_document_body.html b/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_document_body.html
new file mode 100644
index 000000000..ba1eab446
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_document_body.html
@@ -0,0 +1,2 @@
+
+Hello, world!
diff --git a/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_node_list.html b/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_node_list.html
new file mode 100644
index 000000000..32827f950
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/javascript/res/return_node_list.html
@@ -0,0 +1,3 @@
+
+a
+b
diff --git a/testing/web-platform/tests/old-tests/webdriver/modal/__init__.py b/testing/web-platform/tests/old-tests/webdriver/modal/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/modal/alerts_quit_test.py b/testing/web-platform/tests/old-tests/webdriver/modal/alerts_quit_test.py
new file mode 100644
index 000000000..83f7d1450
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/modal/alerts_quit_test.py
@@ -0,0 +1,26 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.common import exceptions
+from selenium.webdriver.support import wait
+
+
+class AlertsQuitTest(base_test.WebDriverBaseTest):
+ def setUp(self):
+ self.wait = wait.WebDriverWait(self.driver, 5, ignored_exceptions=[exceptions.NoAlertPresentException])
+ self.driver.get(self.webserver.where_is('modal/res/alerts.html'))
+
+ def test_can_quit_when_an_alert_is_present(self):
+ self.driver.find_element_by_css_selector('#alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ self.driver.quit()
+ with self.assertRaises(Exception):
+ alert.accept()
+ AlertsQuitTest.driver = None
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/modal/alerts_test.py b/testing/web-platform/tests/old-tests/webdriver/modal/alerts_test.py
new file mode 100644
index 000000000..5f6f8a9f5
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/modal/alerts_test.py
@@ -0,0 +1,148 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.common import exceptions
+from selenium.webdriver.support import wait
+
+class AlertsTest(base_test.WebDriverBaseTest):
+ def setUp(self):
+ self.wait = wait.WebDriverWait(self.driver, 5, ignored_exceptions = [exceptions.NoAlertPresentException])
+ self.driver.get(self.webserver.where_is('modal/res/alerts.html'))
+
+ def tearDown(self):
+ try:
+ self.driver.switch_to_alert().dismiss()
+ except exceptions.NoAlertPresentException:
+ pass
+
+ # Alerts
+ def test_should_allow_user_to_accept_an_alert(self):
+ self.driver.find_element_by_css_selector('#alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ self.driver.current_url
+
+ def test_should_allow_user_to_accept_an_alert_with_no_text(self):
+ self.driver.find_element_by_css_selector('#empty-alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ self.driver.current_url
+
+ def test_should_allow_user_to_dismiss_an_alert(self):
+ self.driver.find_element_by_css_selector('#alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.dismiss()
+ self.driver.current_url
+
+ def test_should_allow_user_to_get_text_of_an_alert(self):
+ self.driver.find_element_by_css_selector('#alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ value = alert.text
+ alert.accept()
+ self.assertEquals('cheese', value)
+
+ def test_setting_the_value_of_an_alert_throws(self):
+ self.driver.find_element_by_css_selector('#alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ with self.assertRaises(exceptions.ElementNotVisibleException):
+ alert.send_keys('cheese')
+ alert.accept()
+
+ def test_alert_should_not_allow_additional_commands_if_dismissed(self):
+ self.driver.find_element_by_css_selector('#alert').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ with self.assertRaises(exceptions.NoAlertPresentException):
+ alert.text
+
+ # Prompts
+ def test_should_allow_user_to_accept_a_prompt(self):
+ self.driver.find_element_by_css_selector('#prompt').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == '')
+
+ def test_should_allow_user_to_dismiss_a_prompt(self):
+ self.driver.find_element_by_css_selector('#prompt').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.dismiss()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == 'null')
+
+ def test_should_allow_user_to_set_the_value_of_a_prompt(self):
+ self.driver.find_element_by_css_selector('#prompt').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.send_keys('cheese')
+ alert.accept()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == 'cheese')
+
+ def test_should_allow_user_to_get_text_of_a_prompt(self):
+ self.driver.find_element_by_css_selector('#prompt').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ value = alert.text
+ alert.accept()
+ self.assertEquals('Enter something', value)
+
+ def test_prompt_should_not_allow_additional_commands_if_dismissed(self):
+ self.driver.find_element_by_css_selector('#prompt').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ with self.assertRaises(exceptions.NoAlertPresentException):
+ alert.text
+
+ def test_prompt_should_use_default_value_if_no_keys_sent(self):
+ self.driver.find_element_by_css_selector('#prompt-with-default').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == 'This is a default value')
+
+ def test_prompt_should_have_null_value_if_dismissed(self):
+ self.driver.find_element_by_css_selector('#prompt-with-default').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.dismiss()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == 'null')
+
+ # Confirmations
+ def test_should_allow_user_to_accept_a_confirm(self):
+ self.driver.find_element_by_css_selector('#confirm').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == 'true')
+
+ def test_should_allow_user_to_dismiss_a_confirm(self):
+ self.driver.find_element_by_css_selector('#confirm').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.dismiss()
+ self.wait.until(lambda x: x.find_element_by_css_selector('#text').text == 'false')
+
+ def test_setting_the_value_of_a_confirm_throws(self):
+ self.driver.find_element_by_css_selector('#confirm').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ with self.assertRaises(exceptions.ElementNotVisibleException):
+ alert.send_keys('cheese')
+ alert.accept()
+
+ def test_should_allow_user_to_get_text_of_a_confirm(self):
+ self.driver.find_element_by_css_selector('#confirm').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ value = alert.text
+ alert.accept()
+ self.assertEquals('cheese', value)
+
+ def test_confirm_should_not_allow_additional_commands_if_dismissed(self):
+ self.driver.find_element_by_css_selector('#confirm').click()
+ alert = self.wait.until(lambda x: x.switch_to_alert())
+ alert.accept()
+ with self.assertRaises(exceptions.NoAlertPresentException):
+ alert.text
+
+"""
+ def test_switch_to_missing_alert_fails(self):
+ with self.assertRaises(exceptions.NoAlertPresentException):
+ self.driver.switch_to_alert()
+"""
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/modal/res/alerts.html b/testing/web-platform/tests/old-tests/webdriver/modal/res/alerts.html
new file mode 100644
index 000000000..36c5dc139
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/modal/res/alerts.html
@@ -0,0 +1,53 @@
+
+
+
+
+ Testing Alerts
+
+
+
+
+
+Testing Alerts and Stuff
+
+This tests alerts: click me
+
+This tests alerts: click me
+
+Let's make the prompt happen
+
+Let's make the prompt with default happen
+
+Let's make TWO prompts happen
+
+This tests confirm: test confirm
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py b/testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py b/testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py
new file mode 100644
index 000000000..52a18cdb8
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py
@@ -0,0 +1,42 @@
+import os
+import sys
+import unittest
+import ConfigParser
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.common import exceptions
+from wptserve import server
+from wptserve.router import any_method
+from wptserve.handlers import basic_auth_handler
+
+class WebDriverAuthTest(unittest.TestCase):
+
+ # Set up class to start HTTP Server that responds to
+ # test URLs with various 401 responses
+ @classmethod
+ def setUpClass(cls):
+ cls.driver = base_test.create_driver()
+ cls.webserver = server.WebTestHttpd(routes=[(any_method, "*", basic_auth_handler)])
+ cls.webserver.start()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.driver.quit()
+ cls.webserver.stop()
+
+ # Test that when 401 is seen by browser, a WebDriver response is still sent
+ def test_response_401_auth_basic(self):
+ page = self.webserver.get_url('navigation/res/authenticated.html')
+ self.driver.set_page_load_timeout(5)
+ try:
+ self.driver.get( page )
+ # if we got a responses instead of timeout, that's success
+ self.assertTrue(True)
+ except exceptions.TimeoutException:
+ self.fail("Did not get response from browser.")
+ except:
+ self.fail("Unexpected failure. Please investigate.")
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/forward.py b/testing/web-platform/tests/old-tests/webdriver/navigation/forward.py
new file mode 100644
index 000000000..67ca83227
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/forward.py
@@ -0,0 +1,24 @@
+import unittest
+import sys
+import os
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class ForwardTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_forward(self):
+ self.driver.get(self.webserver.where_is('navigation/res/forwardStart.html'))
+ self.driver.get(self.webserver.where_is('navigation/res/forwardNext.html'))
+ nextbody = self.driver.find_element_by_css_selector("body").text
+ self.driver.back()
+ currbody = self.driver.find_element_by_css_selector("body").text
+ self.assertNotEqual(nextbody, currbody)
+ self.driver.forward()
+ currbody = self.driver.find_element_by_css_selector("body").text
+ self.assertEqual(nextbody, currbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py b/testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py
new file mode 100644
index 000000000..99759681a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py
@@ -0,0 +1,20 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class ForwardToNothingTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_forwardToNothing(self):
+ self.driver.get(self.webserver.where_is('navigation/forwardStart.html'))
+ body = self.driver.find_element_by_css_selector("body").text
+ self.driver.forward()
+ currbody = self.driver.find_element_by_css_selector("body").text
+ self.assertEqual(body, currbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py b/testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py
new file mode 100644
index 000000000..d28a0d0b1
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py
@@ -0,0 +1,60 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class GetFromHttpTest(base_test.WebDriverBaseTest):
+ def testGetUrlWithNoRedirectionOverHttp(self):
+ page = self.webserver.where_is('navigation/res/empty.html')
+ self.driver.get(page)
+ url = self.driver.current_url
+ self.assertEquals(page, url)
+
+
+ def testGetWillFollowTheLocationHeader(self):
+ page = self.webserver.where_is('navigation/redirect')
+ self.driver.get(page)
+ expected = self.webserver.where_is('navigation/res/empty.html')
+ url = self.driver.current_url
+ self.assertEquals(expected, url)
+
+
+ def testGetWillFollowMetaRefreshThatRefreshesInstantly(self):
+ page = self.webserver.where_is('navigation/res/instant-meta-redirect.html')
+ self.driver.get(page)
+ expected = self.webserver.where_is('navigation/res/empty.html')
+ url = self.driver.current_url
+ self.assertEquals(expected, url)
+
+
+ def testGetWillFollowMetaRefreshThatRefreshesAfterOneSecond(self):
+ page = self.webserver.where_is('navigation/res/1s-meta-redirect.html')
+ self.driver.get(page)
+ expected = self.webserver.where_is('navigation/res/empty.html')
+ url = self.driver.current_url
+ self.assertEquals(expected, url)
+
+
+ def testGetWillNotFollowMetaRefreshThatRefreshesAfterMoreThanOneSecond(self):
+ page = self.webserver.where_is('navigation/res/60s-meta-redirect.html')
+ self.driver.get(page)
+ url = self.driver.current_url
+ self.assertEquals(page, url)
+
+
+ def testGetFragmentInCurrentDocumentDoesNotReloadPage(self):
+ page = self.webserver.where_is("navigation/res/fragment.html")
+ fragment_page = "%s#%s" % (page, "fragment")
+
+ self.driver.get(page)
+ self.driver.execute_script("state = true")
+
+ self.driver.get(fragment_page)
+ self.assertEquals(True, self.driver.execute_script("return state"))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py b/testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py
new file mode 100644
index 000000000..b980146ee
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py
@@ -0,0 +1,28 @@
+import BaseHTTPServer
+import os
+import ssl
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+here = os.path.dirname(os.path.abspath(__file__))
+
+
+class InvalidCertTest(base_test.WebDriverBaseTest):
+ def testCanNavigateToSiteWithSelfSignedCert(self):
+ self.webserver.httpd.socket = ssl.wrap_socket(
+ self.webserver.httpd.socket,
+ certfile=os.path.join(here, 'res/self-signed.key'),
+ server_side=True)
+ expected = self.webserver.where_is(
+ 'navigation/res/empty.html').replace('http:', 'https:', 1)
+
+ self.driver.get(expected)
+ self.assertEquals(expected, self.driver.current_url)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py
new file mode 100644
index 000000000..b0638e568
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py
@@ -0,0 +1,27 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class RefreshPageTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_refreshPage(self):
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageStatic.html'))
+ body = self.driver.find_element_by_css("body").text
+ self.driver.execute_script("document.getElementById('body').innerHTML=''")
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css("body").text
+ self.assertEqual(body, newbody)
+
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageDynamic.html'))
+ body = self.driver.find_element_by_css("body").text
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css("body").text
+ self.assertNotEqual(body, newbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py
new file mode 100644
index 000000000..1e1899008
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py
@@ -0,0 +1,27 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class RefreshPageTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_refreshPage(self):
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageStatic.html'))
+ body = self.driver.find_element_by_css_selector("body").text
+ self.driver.execute_script("document.getElementById('body').innerHTML=''")
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css_selector("body").text
+ self.assertEqual(body, newbody)
+
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageDynamic.html'))
+ body = self.driver.find_element_by_css_selector("body").text
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css_selector("body").text
+ self.assertNotEqual(body, newbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html
new file mode 100644
index 000000000..44fd332bd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html
@@ -0,0 +1,4 @@
+
+
+
+meta-redirect
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html
new file mode 100644
index 000000000..9e56bc96a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html
@@ -0,0 +1,4 @@
+
+
+
+meta-redirect
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html
new file mode 100644
index 000000000..c77449344
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html
@@ -0,0 +1,5 @@
+
+
+
+authentication successful
+You're in!
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html
new file mode 100644
index 000000000..da58ac21d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html
@@ -0,0 +1,4 @@
+
+
+
+Cheese
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html
new file mode 100644
index 000000000..edd77f866
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html
@@ -0,0 +1,6 @@
+
+
+
+This is the next page.
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html
new file mode 100644
index 000000000..3ab4f3cdd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html
@@ -0,0 +1,6 @@
+
+
+
+This is the start page.
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html
new file mode 100644
index 000000000..bd09434a6
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html
@@ -0,0 +1,9 @@
+
+
+Fragment
+
+
+
+I wish I were a pea, alas I am only a fragment.
\ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html
new file mode 100644
index 000000000..c6ad7c9f2
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html
@@ -0,0 +1,4 @@
+
+
+
+meta-redirect
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html
new file mode 100644
index 000000000..bedd20c35
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html
@@ -0,0 +1,10 @@
+
+
+
+This is a dynamic page. It will always have different content if refreshed.
+
+
+