зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1272653 - Merge element state tests; r=jgriffin
Renames test_elementState.py to test_element_state.py to patch Python naming conventions. Merges test_getattr*.py tests into test_element_state.py to match WebDriver specification chapter structure. MozReview-Commit-ID: GkHgaUCdktp
This commit is contained in:
Родитель
b6a9cf2e30
Коммит
749065a09e
|
@ -22,3 +22,17 @@ class TestState(MarionetteTestCase):
|
|||
self.assertTrue(l.is_displayed())
|
||||
self.marionette.execute_script("arguments[0].hidden = true;", [l])
|
||||
self.assertFalse(l.is_displayed())
|
||||
|
||||
|
||||
class TestGetAttribute(MarionetteTestCase):
|
||||
def test_getAttribute(self):
|
||||
test_html = self.marionette.absolute_url("test.html")
|
||||
self.marionette.navigate(test_html)
|
||||
l = self.marionette.find_element(By.ID, "mozLink")
|
||||
self.assertEqual("mozLink", l.get_attribute("id"))
|
||||
|
||||
def test_that_we_can_return_a_boolean_attribute_correctly(self):
|
||||
test_html = self.marionette.absolute_url("html5/boolean_attributes.html")
|
||||
self.marionette.navigate(test_html)
|
||||
disabled = self.marionette.find_element(By.ID, "disabled")
|
||||
self.assertEqual('true', disabled.get_attribute("disabled"))
|
|
@ -41,4 +41,24 @@ class TestStateChrome(MarionetteTestCase):
|
|||
self.marionette.execute_script("arguments[0].hidden = true;", [l])
|
||||
self.assertFalse(l.is_displayed())
|
||||
self.marionette.execute_script("arguments[0].hidden = false;", [l])
|
||||
'''
|
||||
'''
|
||||
|
||||
|
||||
class TestGetAttributeChrome(MarionetteTestCase):
|
||||
def setUp(self):
|
||||
MarionetteTestCase.setUp(self)
|
||||
self.marionette.set_context("chrome")
|
||||
self.win = self.marionette.current_window_handle
|
||||
self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
|
||||
self.marionette.switch_to_window('foo')
|
||||
self.assertNotEqual(self.win, self.marionette.current_window_handle)
|
||||
|
||||
def tearDown(self):
|
||||
self.assertNotEqual(self.win, self.marionette.current_window_handle)
|
||||
self.marionette.execute_script("window.close();")
|
||||
self.marionette.switch_to_window(self.win)
|
||||
MarionetteTestCase.tearDown(self)
|
||||
|
||||
def test_getAttribute(self):
|
||||
el = self.marionette.execute_script("return window.document.getElementById('textInput');")
|
||||
self.assertEqual(el.get_attribute("id"), "textInput")
|
|
@ -1,20 +0,0 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from marionette import MarionetteTestCase
|
||||
from marionette_driver.by import By
|
||||
|
||||
|
||||
class TestGetAttribute(MarionetteTestCase):
|
||||
def test_getAttribute(self):
|
||||
test_html = self.marionette.absolute_url("test.html")
|
||||
self.marionette.navigate(test_html)
|
||||
l = self.marionette.find_element(By.ID, "mozLink")
|
||||
self.assertEqual("mozLink", l.get_attribute("id"))
|
||||
|
||||
def test_that_we_can_return_a_boolean_attribute_correctly(self):
|
||||
test_html = self.marionette.absolute_url("html5/boolean_attributes.html")
|
||||
self.marionette.navigate(test_html)
|
||||
disabled = self.marionette.find_element(By.ID, "disabled")
|
||||
self.assertEqual('true', disabled.get_attribute("disabled"))
|
|
@ -1,26 +0,0 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from marionette import MarionetteTestCase
|
||||
|
||||
|
||||
class TestGetAttributeChrome(MarionetteTestCase):
|
||||
def setUp(self):
|
||||
MarionetteTestCase.setUp(self)
|
||||
self.marionette.set_context("chrome")
|
||||
self.win = self.marionette.current_window_handle
|
||||
self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
|
||||
self.marionette.switch_to_window('foo')
|
||||
self.assertNotEqual(self.win, self.marionette.current_window_handle)
|
||||
|
||||
def tearDown(self):
|
||||
self.assertNotEqual(self.win, self.marionette.current_window_handle)
|
||||
self.marionette.execute_script("window.close();")
|
||||
self.marionette.switch_to_window(self.win)
|
||||
MarionetteTestCase.tearDown(self)
|
||||
|
||||
def test_getAttribute(self):
|
||||
el = self.marionette.execute_script("return window.document.getElementById('textInput');")
|
||||
self.assertEqual(el.get_attribute("id"), "textInput")
|
||||
|
|
@ -16,16 +16,13 @@ skip-if = buildapp == 'b2g'
|
|||
[test_selected.py]
|
||||
[test_selected_chrome.py]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_getattr.py]
|
||||
[test_getattr_chrome.py]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_elementsize.py]
|
||||
[test_position.py]
|
||||
[test_rendered_element.py]
|
||||
[test_chrome_element_css.py]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_elementState.py]
|
||||
[test_elementState_chrome.py]
|
||||
[test_element_state.py]
|
||||
[test_element_state_chrome.py]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_text.py]
|
||||
[test_text_chrome.py]
|
||||
|
@ -134,4 +131,4 @@ skip-if = buildapp == 'b2g' || os == "win" # http://bugs.python.org/issue14574
|
|||
[test_chrome.py]
|
||||
skip-if = buildapp == 'b2g'
|
||||
|
||||
[test_addons.py]
|
||||
[test_addons.py]
|
Загрузка…
Ссылка в новой задаче