mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-07 11:56:51 +00:00
Bug 1094441: Allow CSS Selector as a search strategy for Marionette in Chrome context; r=ahal
--HG-- extra : rebase_source : bfbd853e362e62d55ffb0fefff36667aa60ca04f
This commit is contained in:
parent
8d09083020
commit
73f70ec38e
@ -1298,7 +1298,7 @@ class Marionette(object):
|
||||
:param method: The method to use to locate the element; one of: "id",
|
||||
"name", "class name", "tag name", "css selector", "link text",
|
||||
"partial link text", "xpath", "anon" and "anon attribute".
|
||||
Note that the "name", "css selector", "link text" and
|
||||
Note that the "name", "link text" and
|
||||
"partial link test" methods are not supported in the chrome dom.
|
||||
:param target: The target of the search. For example, if method =
|
||||
"tag", target might equal "div". If method = "id", target would be
|
||||
@ -1325,7 +1325,7 @@ class Marionette(object):
|
||||
:param method: The method to use to locate the elements; one of:
|
||||
"id", "name", "class name", "tag name", "css selector", "link text",
|
||||
"partial link text", "xpath", "anon" and "anon attribute".
|
||||
Note that the "name", "css selector", "link text" and
|
||||
Note that the "name", "link text" and
|
||||
"partial link test" methods are not supported in the chrome dom.
|
||||
:param target: The target of the search. For example, if method =
|
||||
"tag", target might equal "div". If method = "id", target would be
|
||||
|
@ -29,6 +29,12 @@ class TestElementsChrome(MarionetteTestCase):
|
||||
self.assertEqual(HTMLElement, type(found_el))
|
||||
self.assertEqual(el, found_el)
|
||||
|
||||
def test_that_we_can_find_elements_from_css_selectors(self):
|
||||
el = self.marionette.execute_script("return window.document.getElementById('textInput');")
|
||||
found_el = self.marionette.find_element(By.CSS_SELECTOR, "#textInput")
|
||||
self.assertEqual(HTMLElement, type(found_el))
|
||||
self.assertEqual(el, found_el)
|
||||
|
||||
def test_child_element(self):
|
||||
el = self.marionette.find_element(By.ID, "textInput")
|
||||
parent = self.marionette.find_element(By.ID, "things")
|
||||
|
@ -2899,7 +2899,7 @@ function BrowserObj(win, server) {
|
||||
this.startPage = "about:blank";
|
||||
this.mainContentId = null; // used in B2G to identify the homescreen content page
|
||||
this.newSession = true; //used to set curFrameId upon new session
|
||||
this.elementManager = new ElementManager([SELECTOR, NAME, LINK_TEXT, PARTIAL_LINK_TEXT]);
|
||||
this.elementManager = new ElementManager([NAME, LINK_TEXT, PARTIAL_LINK_TEXT]);
|
||||
this.setBrowser(win);
|
||||
this.frameManager = new FrameManager(server); //We should have one FM per BO so that we can handle modals in each Browser
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user