diff options
Diffstat (limited to 'testing/web-platform/tests/old-tests/webdriver/element_state')
64 files changed, 1513 insertions, 0 deletions
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 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/__init__.py 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 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<title>0x0 pixel element</title> + +<style> +div { + height: 0; + width: 0; +} +</style> + +<div>This element is not visible.</div> 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 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<title>1x1 pixel element</title> + +<style> +p { + height: 1px; + width: 1px; +} +</style> + +<p>This element is visible.</p> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>"a" element with not fully qualified url</title> + +<a href="//web-platform.test:8000/path#fragment"> </a>
\ 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 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Parent node visible with absolutely positioned children, where ancestor overflow is hidden</title> + +<style> + body { + overflow: hidden; + height: 0; + width: 0; + } + .child { position: absolute } +</style> + +<div id=parent> + <div class=child>grated</div> + <div class=child>cheese</div> 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 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>BODY element has no children. MUST be reported displayed</title> +<body/> 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 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>BODY tag is omitted; BODY element MUST be reported displayed</title> 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 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>BODY element with style=overflow:hidden. MUST be reported displayed</title> +<body style="overflow:hidden"/> 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 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>BODY element with style=visibility:hidden. MUST be reported displayed</title> +<body style="visibility:hidden"/> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-block.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-block.html new file mode 100644 index 000000000..0f31557e6 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-block.html @@ -0,0 +1,5 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<title>display: block;</title> + +<p>This element is visible.</p> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-link.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-link.html new file mode 100644 index 000000000..88bdef6b5 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-link.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>display: none applies to child node links</title> + +<style> +#parent { display: none } +</style> + +<div id="parent"> + <a id="child">hidden</a> +</div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-paragraph.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-paragraph.html new file mode 100644 index 000000000..31ab16da4 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child-paragraph.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>display: none applies to child node paragraphs</title> + +<style> +#parent { display: none } +</style> + +<div id="parent"> + <p id="child">hidden</p> +</div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child.html new file mode 100644 index 000000000..b45ea0e5a --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-child.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>display: none applies to child nodes</title> + +<style> +#parent { display: none } +</style> + +<div id="parent"> + <div id="child">Brie is good</div> +</div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-dynamic.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-dynamic.html new file mode 100644 index 000000000..074f0b3c1 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-dynamic.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>display: none set dynamically</title> + +<p id="hidden">Should not be visible</span> + +<script> + var hidden = document.getElementById("hidden"); + hidden.style.display = "none"; +</script> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence-visibility.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence-visibility.html new file mode 100644 index 000000000..37ca02391 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence-visibility.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>display: none on parent takes presedence over visibility: visible on child node</title> + +<style> + #parent { display: none } + #child { visibility: visible } +</style> + +<div id="parent"> + <div id="child"> + hidden + </div> +</div> +in
\ No newline at end of file diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence.html new file mode 100644 index 000000000..0f166d1e5 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none-parent-presedence.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>display: none on parent takes presedence</title> + +<style> + #parent { display: none } + #child { dipslay: block } +</style> + +<div id="parent"> + <div id="child"> + hidden + </div> +</div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none.html new file mode 100644 index 000000000..469fc934b --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/display-none.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<title>display: none;</title> + +<style> +p { + display: none; +} +</style> + +<p>This element is not visible.</p> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-dynamically-moved-outside-viewport.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-dynamically-moved-outside-viewport.html new file mode 100644 index 000000000..e31912bfd --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-dynamically-moved-outside-viewport.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element outside viewport</title> + +<style> + div { position: absolute } +</style> + +<div>hidden</div> + +<script> + var el = document.getElementsByTagName("div")[0]; + el.style.top = "-500px"; + el.style.left = "-500px"; +</script> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-other-element.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-other-element.html new file mode 100644 index 000000000..a2cf645a3 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-other-element.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element hidden by other element</title> + +<style> + div { + position: absolute; + height: 100px; + width: 100px; + } + + #overlay { + background: blue; + } + + #hidden { background: red } +</style> + +<div id="hidden"></div> +<div id="overlay"></div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-z-index.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-z-index.html new file mode 100644 index 000000000..05e8eebeb --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-hidden-by-z-index.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element hidden by z-index</title> + +<style> + * { position: relative } + + #overlay, + #hidden { + height: 50px; + width: 50px; + } + + #overlay { + background: blue; + + z-index: 1; + } + + #hidden { + background: red; + top: -50px; + + z-index: -1; + } +</style> + +<div id="overlay"></div> +<div id="hidden"></div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-behind-other-element-by-transform.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-behind-other-element-by-transform.html new file mode 100644 index 000000000..f91e729de --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-behind-other-element-by-transform.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element moved behind other element by transform</title> + +<style> + * { position: relative } + + #overlay { + height: 50px; + width: 50px; + background: blue; + z-index: 1; + } + + #hidden { + height: 50px; + width: 50px; + background: red; + z-index: -1; + + transform: translate(0, -50px); + + /* fix your browsers god damnit */ + -webkit-transform: translate(0, -50px); + -moz-transform: translate(0x, -50px); + } +</style> + +<div id="overlay"></div> +<div id="hidden"></div> + diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-outside-viewport-by-transform.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-outside-viewport-by-transform.html new file mode 100644 index 000000000..51f6ee89f --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-moved-outside-viewport-by-transform.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element moved outside viewpor by transform</title> + +<style> + div { + transform: translate(-200px, -200px); + + /* fix your browsers god damnit */ + -webkit-transform: translate(-200px, -200px); + -moz-transform: translate(-200px, -200px); + } +</style> + +<div>Cheddar!</div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-outside-viewport.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-outside-viewport.html new file mode 100644 index 000000000..e3382ad09 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-outside-viewport.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element outside viewport</title> + +<style> + div { + position: absolute; + top: -500px; + left: -500px; + } +</style> + +<div>hidden</div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-partially-hidden-by-other-element.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-partially-hidden-by-other-element.html new file mode 100644 index 000000000..3d0325928 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-partially-hidden-by-other-element.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element partially hidden by other element</title> + +<style> + div { + height: 100px; + width: 100px; + } + + #partial { + background: yellow; + } + + #other { + background: blue; + margin-top: -50px; + margin-left: 50px; + } +</style> + +<div id="partial"></div> +<div id="other"></div> diff --git a/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-selected.html b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-selected.html new file mode 100644 index 000000000..c2ad98924 --- /dev/null +++ b/testing/web-platform/tests/old-tests/webdriver/element_state/res/element-selected.html @@ -0,0 +1,89 @@ +<html> +<body> +<select> + <option id="selected-1">selected-1</option> +</select> +<select> + <option id="selected-2">selected-2</option> + <option id="unselected-1">unselected-1</option> +</select> +<select disabled> + <option id="unselected-2">unselected-2</option> + <option id="selected-3" selected>selected-3</option> + <option id="unselected-3">unselected-3</option> +</select> +<select> + <option id="unselected-4" checked>unselected-4</option> + <option id="unselected-5">unselected-5</option> + <option id="selected-4" selected>selected-4</option> +</select> +<select> + <option id="unselected-6" selected>unselected-6</option> + <option id="selected-5">selected-5</option> +</select> +<script> + document.getElementById("selected-5").selected = true; +</script> +<select multiple> + <option id="unselected-7">unselected-7</option> + <option id="unselected-8">unselected-8</option> +</select> +<select multiple> + <option id="selected-6" selected>selected-6</option> + <option id="unselected-9" selected>unselected-9</option> + <option id="selected-7">selected-7</option> +</select> +<script> + document.getElementById("unselected-9").selected = false; + document.getElementById("selected-7").selected = true; +</script> + +<h1>Input Checkbox Elements</h1> +<input type="checkbox" id="selected-8" />selected-8 +<script> + document.getElementById("selected-8").checked = true; +</script> +<input type="checkbox" id="selected-9" checked />selected-9 +<script> + document.getElementById("selected-9").indeterminate = true; +</script> +<input type="checkbox" id="unselected-10" />unselected-10 +<input type="checkbox" id="unselected-11" checked />unselected-11 +<script> + document.getElementById("unselected-11").checked = false; +</script> +<input type="checkbox" id="unselected-12" />unselected-12 +<script> + document.getElementById("unselected-12").indeterminate = true; +</script> +<input type="checkbox" id="unselected-13" selected />unselected-13 +<input type="checkbox" id="selected-10" checked />selected-10 + +<h1>Input Radio Elements</h1> +<br>Group 1:<br> +<input type="radio" name="group1" id="selected-11" checked />selected-11 +<br>Group 2:<br> +<input type="radio" name="group2" id="selected-12" />selected-12 +<script> + document.getElementById("selected-12").checked = true; +</script> +<br>Group 3:<br> +<input type="radio" name="group3" id="unselected-14" />unselected-14 +<input type="radio" name="group3" id="selected-13" checked />selected-13 +<br>Group 4:<br> +<input type="radio" name="group4" id="unselected-15" checked />unselected-15 +<input type="radio" name="group4" id="selected-14" checked />selected-14 +<br>Group 5:<br> +<input type="radio" name="group5" id="unselected-16" />unselected-16 +<input type="radio" name="group5" id="unselected-17" checked />unselected-17 +<script> + document.getElementById("unselected-17").checked = false; +</script> +<br>Group 6<br> +<input type="radio" name="group6" id="selected-15" />selected-15 +<input type="radio" name="group6" id="unselected-18" checked />unselected-18 +<script> + document.getElementById("selected-15").checked = true; +</script> +</body> +</html> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element with color style attribute</title> + +<div style="color: red"> </div>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element with custom attribute</title> + +<div webdriver-custom-attribute="attribute value"> </div>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element with id attribute</title> + +<div id="myId"> </div>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element with same color as background</title> + +<style> + body, div { background: white } + div { width: 50px; height: 50px; } +</style> + +<div> </div> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element with same color as background</title> + +<style> + #overlay, + #hidden { + background: blue; + width: 50px; height: 50px; + } + + #hidden { + margin-top: -50px; + } +</style> + +<div id="overlay"></div> +<div id="hidden"></div> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element with style attribute</title> + +<div style='font-family: "Gill Sans Extrabold", Helvetica, sans-serif; line-height: 1.2; font-weight:bold'> </div>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Element without attribute</title> + +<div> </div>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8"> + +<title>Element location</title> + +<body> + <div id="id">id</div> + <div id="name" name="name">name</div> + <a id="link">link text</a> +</body> 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 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Get Element Attribute Extended</title> + +<span id=my_id_with_a_relatively_long_name_test class=my_id_with_a_relatively_long_name_test_class>Span</span> +<span id=my-id>Span</span> + +<div class=container> + <div id=div1 name=div-name> + <div id=div1-1_div1> + <h1 id=h1_div1.1_div1 class=span-class>h1 element, id:h1_div1.1_div1</h1> + </div> + </div> + + <div class=div-depth-2> + <div class=div-depth-3> + <div class=div-depth-4> + <span id=my_id_with_a_relatively_long_name_test class=my_id_with_a_relatively_long_name_test_class>Span</span> + </div> + </div> + </div> + + <div> + <a>anchor text 123</a> + <a>anchor text 123</a> + + <select> + <option id="opt-1" style="font-size: 11px; display: block;" selected>My Option 1</option> + <option class="opt" >My Option 2</option> + <option value="one">My Option 3</option> + </select> + </div> + + <a id="no-vi-1" class="cant-see" style="display:none">no visibility</a><br/> + <a id="no-vi-2" style="display:none">no visibility</a><br/> + <a id="no-vi-2" style="display:none">no visibility</a><br/> + + <span id=my_id_with_a_relatively_long_name_test2>Span</span> + <span id="id.period">Span</span> +</div> + +<div id=id_attribute_accesskey accesskey=nothing></div> + +<!-- Multiple elements with same class --> + +<div id=id_div_multiple_elements_same_class_nested_depth_0 class=multiple_elements_same_class_nested> + <div id=id_multiple_elements_same_class_nested_div_depth_1 class=multiple_elements_same_class_nested> + <div id=id_multiple_elements_same_class_nested_div_depth_2 class=multiple_elements_same_class_nested> + </div> + </div> +</div> + +<!-- Attribute name with special characters --> +<div id=id_special_char_attribute_name *=special_char_attribute_name></div> + +<!-- Attribute value with special characters --> +<div id=id_special_char_attribute_value name="*"></div> + +<!-- Attribute value and name with special characters --> +<div id=id_special_char_attribute_name_and_value @="("></div> + +<!-- Attribute name is numeric. --> +<div id"id_attribute_name_numeric 1="numeric attribute name"></div> + +<!-- Attribute value is numeric. --> +<div id=id_attribute_value_numeric one=2></div> + +<!-- Attribute name is negative numeric. --> +<div id=id_attribute_negative_numeric_name -5="attribute name is -5"></div> + +<!-- Attribute value is negative numeric. --> +<div id=id_attribute_negative_numeric_value negative_numeric_value=-9></div> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Hidden INPUT @type="checkbox" is untogglable</title> + +<style> + input { display: none } +</style> + +<input type="checkbox" /> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Typing in hidden input is impossible</title> + +<style> + input { display: none } +</style> + +<input type="text" /> 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 @@ +<!DOCTYPE html> +<div id='singleHidden' hidden>This will not be visible</div> +<div id='parent' hidden> + <div id='child'>My parent is hidden so you can't see me</div> +</div>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>"img" element with not fully qualified url</title> + +<img src="//web-platform.test:8000/images/blue.png"> </a>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>INPUT motphs into @type="hidden"</title> + +<input /> + +<script> + var input = document.getElementsByTagName("input")[0]; + input.type = "hidden"; +</script> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>INPUT @type="hidden" is unclickable</title> + +<input type="hidden" /> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>INPUT @type="hidden" are always hidden</title> + +<input type="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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Input with checked attribute</title> + +<input type=checkbox checked="false"> </input>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Input without checked attribute</title> + +<input type=checkbox> </input>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Option with value attribute</title> + +<select> + <option value="value1">Value 1</option> +</select>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Option without value attribute</title> + +<select> + <option>Value 1</option> +</select>
\ 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Text with matching color and background</title> + +<style> + p { + background: blue; + color: blue; + } +</style> + +<p> + This on the other hand, should be visible +</p> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Text with same color as background</title> + +<style> + body { background: white } + p { color: white } +</style> + +<p> + Shouldn't be visible. +</p> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Text with same color as parent background</title> + +<style> + #parent { background: gray } + p { color: gray } +</style> + +<div id="parent"> + <p> + Should not be visible + </p> +</div>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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>visibility: hidden applies to child node of type A</title> + +<style> +#parent { visibility: hidden } +</style> + +<div id="parent"> + <a id="child" href="#">Brie is good</a> +</div> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>visibility: hidden applies to child nodes of type P</title> + +<style> +#parent { visibility: hidden } +</style> + +<div id="parent"> + <p id="child">Brie is good</p> +</div> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>visibility: visible on child node takes presedence</title> + +<style> +#parent { visibility: hidden } +#child { visibility: visible } +</style> + +<div id="parent"> + <div id="child">Brie is good</div> +</div> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>visibility: hidden applies to child nodes</title> + +<style> +#parent { visibility: hidden } +</style> + +<div id="parent"> + <div id="child">Brie is good</div> +</div> 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 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<title>visibility: hidden;</title> + +<style> +p { + visibility: hidden; +} +</style> + +<p>This element is not visible.</p> 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 @@ +<!DOCTYPE html> +<meta charset='utf-8'> +<title>visibility: visible;</title> + +<p>This element is visible.</p> 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 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with overflow</title> + <style> + #over { + width:400px; + height: 300px; + overflow-x: auto; + overflow-y: hidden; + } + </style> +</head> +<body> + <div id="over"> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="right" onclick="document.getElementById('right-clicked').textContent='ok'">Click right</a></div> + </div> + <div style="height: 5000px; width: 5000px;"> + Right clicked: <span id="right-clicked"></span></br> + Bottom clicked: <span id="bottom-clicked"></span></br> + Bottom-right clicked: <span id="bottom-right-clicked"></span></br> + </div> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="bottom-right" onclick="document.getElementById('bottom-right-clicked').textContent='ok'">Click bottom-right</a></div> + </div> + <a href="#" id="bottom" onclick="document.getElementById('bottom-clicked').textContent='ok'">Click bottom</a> + </div> +</body> +</html> 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 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with overflow</title> + <style> + #over { + width:400px; + height: 300px; + overflow-x: hidden; + overflow-y: auto; + } + </style> +</head> +<body> + <div id="over"> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="right" onclick="document.getElementById('right-clicked').textContent='ok'">Click right</a></div> + </div> + <div style="height: 5000px; width: 5000px;"> + Right clicked: <span id="right-clicked"></span></br> + Bottom clicked: <span id="bottom-clicked"></span></br> + Bottom-right clicked: <span id="bottom-right-clicked"></span></br> + </div> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="bottom-right" onclick="document.getElementById('bottom-right-clicked').textContent='ok'">Click bottom-right</a></div> + </div> + <a href="#" id="bottom" onclick="document.getElementById('bottom-clicked').textContent='ok'">Click bottom</a> + </div> +</body> +</html> 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 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with overflow</title> + <style> + #over { + width:400px; + height: 300px; + overflow-x: hidden; + overflow-y: hidden; + } + </style> +</head> +<body> + <div id="over"> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="right" onclick="document.getElementById('right-clicked').textContent='ok'">Click right</a></div> + </div> + <div style="height: 5000px; width: 5000px;"> + Right clicked: <span id="right-clicked"></span></br> + Bottom clicked: <span id="bottom-clicked"></span></br> + Bottom-right clicked: <span id="bottom-right-clicked"></span></br> + </div> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="bottom-right" onclick="document.getElementById('bottom-right-clicked').textContent='ok'">Click bottom-right</a></div> + </div> + <a href="#" id="bottom" onclick="document.getElementById('bottom-clicked').textContent='ok'">Click bottom</a> + </div> +</body> +</html> 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 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with overflow</title> + <style> + #over { + width:400px; + height: 300px; + overflow-x: hidden; + overflow-y: scroll; + } + </style> +</head> +<body> + <div id="over"> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="right" onclick="document.getElementById('right-clicked').textContent='ok'">Click right</a></div> + </div> + <div style="height: 5000px; width: 5000px;"> + Right clicked: <span id="right-clicked"></span></br> + Bottom clicked: <span id="bottom-clicked"></span></br> + Bottom-right clicked: <span id="bottom-right-clicked"></span></br> + </div> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="bottom-right" onclick="document.getElementById('bottom-right-clicked').textContent='ok'">Click bottom-right</a></div> + </div> + <a href="#" id="bottom" onclick="document.getElementById('bottom-clicked').textContent='ok'">Click bottom</a> + </div> +</body> +</html> 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 @@ +<!DOCTYPE html> +<html> +<head> + <title>Page with overflow</title> + <style> + #over { + width:400px; + height: 300px; + overflow-x: scroll; + overflow-y: hidden; + } + </style> +</head> +<body> + <div id="over"> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="right" onclick="document.getElementById('right-clicked').textContent='ok'">Click right</a></div> + </div> + <div style="height: 5000px; width: 5000px;"> + Right clicked: <span id="right-clicked"></span></br> + Bottom clicked: <span id="bottom-clicked"></span></br> + Bottom-right clicked: <span id="bottom-right-clicked"></span></br> + </div> + <div style="width: 5000px;"> + <div style="width: 100%; text-align: right;" ><a href="#" id="bottom-right" onclick="document.getElementById('bottom-right-clicked').textContent='ok'">Click bottom-right</a></div> + </div> + <a href="#" id="bottom" onclick="document.getElementById('bottom-clicked').textContent='ok'">Click bottom</a> + </div> +</body> +</html> 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 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Zero sized element with sizable decendant</title> + +<style> + #parent { width: 0; height: 0; } + #child { width: 100; height: 100; background-color: blue; } +</style> + +<div id="parent"> + <div id="child"> + + </div> +</div> 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() |