Граф коммитов

73 Коммитов

Автор SHA1 Сообщение Дата
Andreas Tolfsen 29f6ebe13f Bug 1394881 - Use Node.isConnected for web element staleness check. r=automatedtester
It turns out that Node.isConnected (described in
https://dom.spec.whatwg.org/#dom-node-isconnected) handles an element’s
shadow root, which element.isDisconnected tries to replicate.

element.isDisconnected and element.isStale are both long and error-prone
and can be removed entirely in favour of this web platform API.

The relevant change to the WebDriver specification landed in
32a477b023.

MozReview-Commit-ID: 5Q0gWLvw8KL

--HG--
extra : rebase_source : 773ab302df27cf11be6079f918a48d3730ceb5c1
2017-08-30 14:22:39 +01:00
Andreas Tolfsen 6a8d4baed7 Bug 1393812 - Fix call to element.isDisconnected. r=automatedtester
A fallout from https://bugzil.la/1392346 was that element.isStale called
element.isDisconnected incorrectly by using the old container object.
This was reported in https://bugzil.la/1392854.

Since we in the long term want to get rid of the concept
of window/shadow root containers (in preparation for
https://bugzil.la/marionette-window-tracking), we might as well fix
the fallout by making element.isDisconnected take separate window-
and shadowRoot arguments, like element.isStale.

Fixes: https://bugzil.la/1392854
MozReview-Commit-ID: ELIu8HsZUfK

--HG--
extra : rebase_source : 3f0cc83048d9f069c47c08c0a6d886033c106825
2017-08-25 16:30:08 +01:00
Andreas Tolfsen 7c7d5a22d4 Bug 1392346 - Decouple element staleness check from element.Store. r=automatedtester
In preparation for a larger window tracking change to Marionette, we
want to decouple the element staleness check from the element.Store.

MozReview-Commit-ID: JNZqCc2eZqy

--HG--
extra : rebase_source : a21344ef9ecc01523545b2f866fbb5415afcedb3
2017-08-21 19:09:15 +01:00
Andreas Tolfsen c07ee45e6b Bug 1392339 - Fix misuse of nsIDOMElement in API docs. r=automatedtester
MozReview-Commit-ID: 3q35q6TTbTH

--HG--
extra : rebase_source : 07b2d26874a051a8b6663020ee49dcd20beb286c
2017-08-21 18:56:19 +01:00
Andreas Tolfsen 34a091cffa Bug 1392339 - Fix misuse of nsIDOMWindow in API docs. r=automatedtester
nsIDOMWindow is the XPCOM interface and not what we mean in all these
cases.  We either want to refer to the ChromeWindow or to the WindowProxy,
depending on the context of the code.

MozReview-Commit-ID: 405po1XLXRi

--HG--
extra : rebase_source : 47a179f7caed76592dab28f8e10550cda5fe3d02
2017-08-21 18:52:18 +01:00
David Burns 74b035b657 Bug 1387644 - Return NoSuchElementError when element is not found r=ato
MozReview-Commit-ID: LDHiyce09GR

--HG--
extra : rebase_source : dff3b50237a3d124c0c41458c0adaf94694f45ef
2017-08-05 00:50:46 +01:00
Andreas Tolfsen 26e6ac4cfd Bug 1387461 - Add note to remove element.isVisible. r=automatedtester
DONTBUILD

MozReview-Commit-ID: AO8ikaX6RHB

--HG--
extra : rebase_source : d222314bc744df440594946f3b88435c5a89b17e
2017-08-04 15:51:19 +01:00
Andreas Tolfsen d29f92675d Bug 1385547 - Lint testing/marionette. r=automatedtester
Automatic fixes from './mach lint --fix testing/marionette'.

MozReview-Commit-ID: 4UOLrLLxMbH
2017-07-31 16:01:12 +01:00
Andreas Tolfsen dd7a57fd22 Bug 1384517 - Fix testing/marionette API docs; r=automatedtester
Various fixes to make the generated API documentation from
testing/marionette somewhat easier to read.

MozReview-Commit-ID: F9duuQoOYBt

--HG--
extra : rebase_source : 3ade69773ceba42826aedef05b1371240b51cf82
2017-07-26 13:11:53 +01:00
Andreas Tolfsen de001d80b7 Bug 1376128 - Lint testing/marionette; r=automatedtester
MozReview-Commit-ID: DY4yCSBEZrN

--HG--
extra : rebase_source : d4e25369418cc72a6ee9f78d44b050a87403391d
2017-06-29 16:40:24 -07:00
Andreas Tolfsen b8fed800ba Bug 1376128 - Ensure consistent return types from findElement; r=automatedtester
MozReview-Commit-ID: LnzsAHCMAxW

--HG--
extra : rebase_source : c9c44c07df3c29b3c5b80c507ab875278d597c90
2017-06-28 11:16:34 -07:00
Andreas Tolfsen 98e70a93d3 Bug 1376128 - Fix undefined id variable; r=automatedtester
We try to delete the element entry by "id", which is not defined.

MozReview-Commit-ID: DXAOJAV1z9Q

--HG--
extra : rebase_source : 103209d203f64bb354e46fb4fb98225b8e7165a0
2017-06-28 11:15:00 -07:00
Andreas Tolfsen b86d19c98a Bug 1376128 - Expose unrecognised eslint globals; r=automatedtester
In particular, XPCNativeWrapper should probably be made available
by default.

MozReview-Commit-ID: E1oYFyApbLi

--HG--
extra : rebase_source : 4e27ad6882bd4e43dadc97d4fd2a186e01510dfd
2017-06-28 11:04:14 -07:00
Andreas Tolfsen 54c2f296a7 Bug 1376128 - Use selective imports from error module; r=automatedtester
Instead of importing everything from the testing/marionette/error.js
module into the global scope, we need to be selective about what symbols
we want.

MozReview-Commit-ID: HZDAS0bs0GD

--HG--
extra : rebase_source : 14a300bb2cedc0716168d50846755a6faed83012
2017-06-28 11:01:49 -07:00
Andreas Tolfsen a9505b4395 Bug 1363053 - Move element.fromJson/toJson to evaluate module r=maja_zf
This patch renames element.fromJson and element.toJson to
evaluate.fromJSON and evaluate.toJSON, respectively.

The JSON (de)serialisation code belongs more naturally in the evaluate
module, which did not exist when these functions were written.

MozReview-Commit-ID: FJGbjGD1kZ6

--HG--
extra : rebase_source : b2528f545c8213b06b9116299806d8ab8a875250
2017-05-08 17:05:20 +01:00
Andreas Tolfsen 8f9f92f1cb Bug 1359079 - Take <select multiple> into account for obscured click test; r=whimboo
Because individual <option> elements are painted and represented in the
DOM when they belong to a <select multiple> list, the center point of
the list might be one of the options.

To take this into account, we perform an inclusive descendant check
(DOMElement.contains) to see if the <option> element is a descendant of
the container <select> element.

In the case the targetted element is the element itself, the test will
still pass since it is an _inclusive_ descendant check.  In other words,
containerEl.contains(tree[0]), if tree[0] is equal to containerEl,
will pass.

The relevant specification changes were made in
40abcefd6a.

MozReview-Commit-ID: ORX8zLxQJ

--HG--
extra : rebase_source : 87ca38df6696257d569ef1ffcb888426d1f569af
2017-04-17 17:24:19 +01:00
Andreas Tolfsen 0c61ad5319 Bug 1359050 - Test element in view with pointer events enabled; r=maja_zf
This change makes it possible to click elements that has its
pointer-events style property set to "none".

If an element has its style property pointer-events set to "none",
the element in view test will fail due to document.elementsFromPoint
excluding it due to non-interactability.  This is only a problem when
checking if the element is inside the viewport, and not when actually
performing interaction with the element.

The relevant specification change is
ba6ee925b5.

MozReview-Commit-ID: JwZB6fm7P9A

--HG--
extra : rebase_source : 18ddf7955c7e0bc6d1d7f798aebc6e09799a99ca
2017-04-17 19:34:44 +01:00
Andreas Tolfsen e14f20eea7 Bug 1359054 - Take shadow DOM into account when getting paint tree; r=maja_zf
We want to take shadow DOM into account when getting an element's
pointer-interactable paint tree.

Marionette is currently unable to determine if an element inside a shadow
DOM host is disconnected from the document because we are constructing
the frame container with only the main document.

MozReview-Commit-ID: IPDi8fQZYRP

--HG--
extra : rebase_source : 8c6757a032342aa6bbe50ef15025a37ac09ae413
2017-04-17 17:51:13 +01:00
Andreas Tolfsen b741a8e4f6 Bug 1333014 - Lint testing/marionette/element.js; r=maja_zf
No functional changes.

MozReview-Commit-ID: CK33FjpQMmO

--HG--
extra : rebase_source : ed16cf02808e39fedd3f22388f77d3055ffcb51d
2017-02-07 19:18:40 +00:00
Andreas Tolfsen 5688e3c5b4 Bug 1333014 - Change element.isDisconnected to take container; r=maja_zf
It makes sense for element.isDisconnected to accept a container object
with frame and shadowRoot, instead of taking the shadowRoot as an optional
third argument, since this is what most consumers start out with.

MozReview-Commit-ID: 6kfEIEf8u96

--HG--
extra : rebase_source : 084b39ff6796747470bf49acdab0dbbfc8f67f98
2017-02-07 19:00:28 +00:00
Andreas Tolfsen fe9efe4a62 Bug 1333014 - Remove unused element.isInteractable API; r=maja_zf
MozReview-Commit-ID: 5iBcHUeNmSN

--HG--
extra : rebase_source : 6f4d83e019829a06a4354952d78fe6a0ef1c4764
2017-02-07 17:05:06 +00:00
Andreas Tolfsen 493bce4e65 Bug 1333014 - Pretty-print HTML elements; r=maja_zf
When passing a DOM element that is an HTML element to error.pprint,
it will get pretty-printed with its ID and class properties.

This helps to identify elements when one is obscuring the other when
clicking. For example, the error message

	Element <input id="foo"> is obscured by <input id="bar">

is nicer than the old error message

	Element [object HTMLElement] {} is obscured by [object HTMLElement] {}

MozReview-Commit-ID: 8U2Lo8V4lmv

--HG--
extra : rebase_source : a0a0176f1fed9786da6260e27d28c23c8eb2a944
2017-02-07 16:59:59 +00:00
Andreas Tolfsen 287f6b6d18 Bug 1333014 - Support intercepted clicks and align with spec; r=automatedtester,whimboo
The WebDriver specification changed recently to introduce a new
'element click intercepted' error that is returned if the high-level
Element Click command attempts an element that is obscured by another
(the other element's z-index, or order in the paint tree, is higher).

This patch introduces the notion of 'container elements', which is an
element's context.  For example, an <option> element's container element
or context is the nearest ancestral <select> or <datalist> element.

It also makes a distinction between an element being pointer-interactable
and merely being in-view.  This is important since an element may be in
view but not pointer-interactable (i.e. clicking its centre coordinates
might be intercepted), and we do not want to wait for an element to
become pointer-interactable after scrolling it into view if it is indeed
obscured.

MozReview-Commit-ID: 8dqGZP6UyOo

--HG--
extra : rebase_source : 68f1f7ee922ab8ed6acd92d3f89d6887b23ae801
2017-02-03 19:52:34 +00:00
Andreas Tolfsen 645c6db1b0 Bug 1319237 - Generalise wait condition utility; r=automatedtester,maja_zf
This makes the `implicitWaitFor` utility from
testing/marionette/element.js generally available in Marionette.

It improves on the design of the old wait utility by providing
promise-like resolve and reject options to the evaluated function.  These
can be used to indicate success or failure of waiting.  If resolved, the
provided value is returned immediately.  When rejected, the function is
evaluated over again until the timeout is reached or an error is thrown.

It is useful to indicate success and failure state because it saves the
calling code from guessing based on the return value.  Guessing from
the return value can be problematic since there are certain types and
values in JavaScript that are ambigeous or misleading, such as the fact
that empty arrays are evaluated as a truthy value.

MozReview-Commit-ID: G8F99tdbiNb

--HG--
extra : rebase_source : 88647b1c7115f15649d5029391ff21567f9d527c
2016-11-21 23:41:20 +01:00
Wes Kocher 10665c1427 Backed out 14 changesets (bug 1319237) for android xpcshell failures a=backout
Backed out changeset c85849b790c5 (bug 1319237)
Backed out changeset 9746878e5fc7 (bug 1319237)
Backed out changeset 1f7f75c57c59 (bug 1319237)
Backed out changeset 4dc796bbcfaa (bug 1319237)
Backed out changeset f8449c471b8f (bug 1319237)
Backed out changeset f2bdf078f39a (bug 1319237)
Backed out changeset 8df8cda56942 (bug 1319237)
Backed out changeset f651a9e54a57 (bug 1319237)
Backed out changeset 76c8aafbd933 (bug 1319237)
Backed out changeset a2096fa29cd7 (bug 1319237)
Backed out changeset af71a9376bef (bug 1319237)
Backed out changeset 778721edd8b9 (bug 1319237)
Backed out changeset feaf6ba3bd9a (bug 1319237)
Backed out changeset f5f206ed675b (bug 1319237)

MozReview-Commit-ID: EpmToL8Xqfz
2017-02-06 11:28:28 -08:00
Andreas Tolfsen 8856da4c0b Bug 1319237 - Generalise wait condition utility; r=automatedtester,maja_zf
This makes the `implicitWaitFor` utility from
testing/marionette/element.js generally available in Marionette.

It improves on the design of the old wait utility by providing
promise-like resolve and reject options to the evaluated function.  These
can be used to indicate success or failure of waiting.  If resolved, the
provided value is returned immediately.  When rejected, the function is
evaluated over again until the timeout is reached or an error is thrown.

It is useful to indicate success and failure state because it saves the
calling code from guessing based on the return value.  Guessing from
the return value can be problematic since there are certain types and
values in JavaScript that are ambigeous or misleading, such as the fact
that empty arrays are evaluated as a truthy value.

MozReview-Commit-ID: G8F99tdbiNb

--HG--
extra : rebase_source : 1de77b97f0de71e0dc77fc47a6b1aab1ef88ea6f
2016-11-21 23:41:20 +01:00
Florian Quèze b11907c7aa Bug 1334156 - script-generated patch to replace .ownerDocument.defaultView with .ownerGlobal, r=jaws. 2017-01-27 10:51:03 +01:00
Henrik Skupin 32d2092d60 Bug 1143071 - Searching anonymous elements has to use the documentElement as default start node. r=ato
MozReview-Commit-ID: 90zTSulITcR

--HG--
extra : rebase_source : d4a10087681c462eabe497629c9f407788df7a49
2016-12-02 17:36:52 +01:00
Thomas Charles acf2f9d4dd Bug 1316975 - Correct function definition style in Marionette components; r=ato
No functional changes.

MozReview-Commit-ID: 25cWAnpRB9H

--HG--
extra : rebase_source : c8b14bf47a476488568f54d3640b51bbeed5b04b
2016-12-04 12:42:52 +01:00
Andreas Tolfsen 3c262bd4f4 Bug 1317386 - Test pointer interactability of first element in paint order; r=automatedtester
When returning the tree of interactable elemenets under the cursor, we
want to test the first one against the passed element, not that there
are _any_ interactable elements under the cursor.

MozReview-Commit-ID: AUvKAWKHgZk

--HG--
extra : rebase_source : 69563be46dbb18c4c814d6615b1bd2f97179b816
2016-11-15 11:21:32 +00:00
Andreas Tolfsen 3678abebb6 Bug 1317386 - Rewrite in-view centre point calcaulation; r=automatedtester
The old calcaulation to determine an element's in-view centre point was
wrong as pointed out in https://github.com/w3c/webdriver/issues/425,
and this is an implementation of the proposed algorithm which passes
real-world tests.

This also addresses https://github.com/w3c/webdriver/pull/441 which
checks if the `DOMRect` sequence returned from `getClientRects` is empty,
as it may be if the element's `display` style property is `none`.

MozReview-Commit-ID: 4uitUrviW2a

--HG--
extra : rebase_source : d9a3eefc9496500dffe74a28a117e29067a646f1
2016-11-14 21:10:08 +00:00
Andreas Tolfsen cbe8e9b6dc Bug 1317386 - Scroll element into view at the bottom; r=automatedtester
When scrolling an element into view using `Element.scrollIntoView`,
use the `{block: "end", inline: "nearest"}` scroll position arguments,
which are equivalent to `Element.scrollIntoView(false)`.  This is what
other WebDriver implementations have used for a while, and we meant to
change to this sooner.

This ensures that the element appears at the bottom of the viewport
rather than the top, where overlaying menus with fixed style position
may more frequently appear.

In the future we might consider replacing this with `{block: "center"}`
which is specified in the CSSOM specification, but not yet implemented
in any browsers.

This implements https://github.com/w3c/webdriver/pull/440, which should
fix https://github.com/mozilla/geckodriver/issues/327.

MozReview-Commit-ID: BRMupP4fM89

--HG--
extra : rebase_source : 952edd6932b0f7e8b7d2694d428435508a4ffc8c
2016-11-14 21:06:50 +00:00
Maja Frydrychowicz 6da8812934 Bug 1303234 - Implement extracting action chain from a request; r=ato,jgraham
MozReview-Commit-ID: JxNoGZog1om

--HG--
rename : testing/marionette/action.js => testing/marionette/legacyaction.js
extra : rebase_source : 91e9b1915e18362765804e3767dfb834394a35af
2016-10-26 13:04:48 -04:00
Andreas Tolfsen b14cde0605 Bug 1298454 - Use element.makeWebElement instead of manually creating web element; r=automatedtester
MozReview-Commit-ID: 83W3e6mWqYJ

--HG--
extra : rebase_source : ce3ca019ef62573827a790145fe8bb4660b14bc8
2016-08-26 19:02:33 +01:00
Andreas Tolfsen ddc9f80240 Bug 1284232 - Marshal all HTML and JS collections; r=automatedtester
This patch adds marshaling of HTMLFormControlsCollection,
HTMLAllCollection, and HTMLOptionsCollection element collections to
Marionette.

It will allow us you to return from HTMLSelectElement.options,
document.forms[0].elements, and document.all. This is in
addition to the already supported document.querySelector
(NodeList), document.getElementsBy* (HTMLCollection), and
Array.from(ELEMENT...) collections.

MozReview-Commit-ID: 71a65lZRn4S

--HG--
extra : rebase_source : aff3490ceb0db110f392956baaacbd5e2e7acb62
2016-07-04 17:34:06 +01:00
David Burns 2302a9db3b Bug 1285240: Trim leading and trailing space when finding elements by link text r=ato
This gives up parity with the WebDriver project and brings us in line with the current
specification http://w3c.github.io/webdriver/webdriver-spec.html#dfn-link-text

MozReview-Commit-ID: 9OD6B2pKTfx

--HG--
extra : rebase_source : 075fe800d1a82593ebb55987a2eccb2d318e0c5f
2016-07-07 23:06:17 +01:00
Andreas Tolfsen f0497b78dc Bug 1283999 - Publish XPath find element functions; r=automatedtester
Publish the findByXPath and findAllByXPath functions to match the style
of the recently introduces findByLinkText and findByPartialLinkText
functions.

Do note that this patch rearranges the input arguments these functions
take.  Possibly we do not have to send the root element as input at all.

MozReview-Commit-ID: 4H7kpZBUsTw

--HG--
extra : rebase_source : 72c11a2a3e47158d6696db2c5995bea09e57794e
2016-07-02 21:51:21 +01:00
Andreas Tolfsen efe06ca06c Bug 1283999 - Fix lookup of hyperlinks in XHTML documents; r=automatedtester
Lower-case "a" matches hyperlinks in XHTML documents as well as HTML
documents. Upper-case "A" only matches HTML documents.

The patch also refactors link text- and partial link text lookup into
distinct functions, so that there is no more worry about variable scoping
in match blocks.

MozReview-Commit-ID: FB7MAmosBoR

--HG--
extra : rebase_source : 65d0807e33a279fb822078329128c3f3c219a555
2016-07-02 21:38:48 +01:00
Andreas Tolfsen ed4aa96ea4 Bug 1274274 - Rename element store clear function to delete; r=automatedtester
This matches the Map data structure in JavaScript.

MozReview-Commit-ID: 5l2xOb4W2BC

--HG--
extra : rebase_source : 706f8e60fbfc364e56da83f15b9e1a4a94af9c9a
2016-05-20 16:54:42 +01:00
Andreas Tolfsen c87cc1b12b Bug 1274274 - Update exported symbols and correct docs; r=automatedtester
MozReview-Commit-ID: 95ikD0oyrmy

--HG--
extra : rebase_source : 0e8d1aa755c9399eb1970f120c13f796805de2f9
2016-05-20 16:52:01 +01:00
Andreas Tolfsen fb76d98e20 Bug 1274274 - Disassociate wrapValue from element store; r=automatedtester
Moves ElementManager#wrapValue to the testing/marionette/element.js
module level and renames it to toJson.

MozReview-Commit-ID: GJBl2L1GRxZ

--HG--
extra : rebase_source : 5fc81a6b0ebfbd6a12557b3b746e6968c235d674
2016-05-20 16:32:31 +01:00
Andreas Tolfsen 76e7173ffa Bug 1274274 - Disassociate convertWrappedArguments from element store; r=automatedtester
Moved ElementManager#convertWrappedArguments to the
testing/marionette/element.js module scope and renamed it to fromJson.

MozReview-Commit-ID: JMTZcG0JSUE

--HG--
extra : rebase_source : 613faca6a8c81b1ff435c538b0a7347ae548c288
2016-05-20 16:16:56 +01:00
Andreas Tolfsen 8f48cd96ed Bug 1274274 - Remove unused method applyNamedArgs; r=automatedtester
MozReview-Commit-ID: 1FeFZK4VVu2

--HG--
extra : rebase_source : aa89ccc7db341fa330c8777f5a4b73dcf65764f3
2016-05-20 15:13:24 +01:00
Andreas Tolfsen c002fdc182 Bug 1274274 - Disassociate isDisconnected from element store; r=automatedtester
MozReview-Commit-ID: 4uxbLKlgfsL

--HG--
extra : rebase_source : 7e2c236c470b8637aba78461b2c058a005b20ad7
2016-05-20 15:11:37 +01:00
Andreas Tolfsen 0f872f6301 Bug 1274274 - Refactor seen element store; r=automatedtester
Renames ElementManager to element.Store, exposing it on the
testing/marionette/element.js module.  Shortens getKnownElement(uuid)
to get(uuid).  Introduces new method has(uuid) to replace some unnecessary
checks in testing/marionette/driver.js and testing/marionette/listener.js.

MozReview-Commit-ID: D5qAlqrIxi

--HG--
extra : rebase_source : 22fda922e4c5f7bfcd1a5bcbcec6ae1003411535
2016-05-20 15:07:21 +01:00
Andreas Tolfsen c9a06fbbdc Bug 1274274 - Convert ElementManager to a class; r=automatedtester
MozReview-Commit-ID: EqcuWGxxlC

--HG--
extra : rebase_source : 01865b2ef001eaa0e77f80a739545a0f1ed3a0cc
2016-05-20 13:32:52 +01:00
Andreas Tolfsen c47354a3ef Bug 1274274 - Decouple element retrieval methods; r=automatedtester
Moves element retrieval methods from ElementManager to the
testing/marionette/element.js module itself.  This means some more
work needs to be done by the caller, but avoids bloat by ensuring
ElementManager does not end up as a super-object.

MozReview-Commit-ID: 5LGe0vpSWwS

--HG--
extra : rebase_source : d7f4bd64cd1a92ad20a33496708d3f0136531d9f
2016-05-20 13:28:27 +01:00
Andreas Tolfsen 47fd1a56f6 Bug 1272653 - Make Get Element Attribute spec compatible; r=automatedtester
MozReview-Commit-ID: K5PsnmRrDJk
2016-05-24 10:34:23 +01:00
Andreas Tolfsen 0824f63ac1 Bug 1274271 - Remove unused function applyNamedArgs; r=automatedtester
MozReview-Commit-ID: DU5xHDLL4Ww

--HG--
extra : rebase_source : 59949b4c99e007231bf68f94bd1b513c7d43376b
2016-05-19 14:53:00 +01:00
David Burns 42526cc80d Bug 1273275: scroll to the top of elements before interacting r=ato
This allows us to converge with webdriver project which scrolls to the
start of the element instead of the end.

MozReview-Commit-ID: ErQ18bTeo5m

--HG--
extra : rebase_source : 0cb69c80da561e0b0fda288841c415fd206fe907
2016-05-17 11:04:30 +01:00