Commit Graph

39 Commits

Author SHA1 Message Date
Henrik Skupin
891449384c Bug 1357634 - Use 'beforeunload' to detect a possible page load. r=ato
Using only the different unload events to detect a page load is
unreliable because of a possible delay in starting the navigation,
which could be triggered by a slowness of the application.

By using 'beforeunload', an event will be received much earlier,
and the unload timer can be extended to a couple more seconds to
wait for the navigation request to start.

If a website has it's own 'beforeunload' listener registered,
a tab modal dialog will be opened by Firefox, and Marionette
returns from the currently active command immediately to allow
the test to handle the dialog.

MozReview-Commit-ID: 6ZUYtFJSSnz

--HG--
extra : rebase_source : 3f7b9d9d0067ed7c65a3bb8774f0a5ae8bc702c2
2017-04-28 10:27:12 +02: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
Henrik Skupin
247b5f9899 Bug 1335778 - Make element click command check for page load and wait. r=ato
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.

MozReview-Commit-ID: DWV53sckBS2

--HG--
extra : rebase_source : 1b7905c101b7ebf406e88c73be5d0e069b7342c0
2017-04-20 12:12:27 +02:00
Sebastian Hengst
2bb5df4de7 Backed out changeset e084deb550c2 (bug 1335778) 2017-04-26 14:12:13 +02:00
Henrik Skupin
d9653a7941 Bug 1335778 - Make element click command check for page load and wait. r=ato
If the click command triggered a page load, it should not return before
the page has been fully loaded. With this patch we allow an opt-in for
commands to make use of an unload check. It's set to 200ms right now, and
will cancel an ongoing waitForPageLoad() if no page activity is detected.

MozReview-Commit-ID: DWV53sckBS2

--HG--
extra : rebase_source : 455e252e85c14b4ca841f02794bf0d33133ef10a
2017-04-20 12:12:27 +02:00
Andreas Tolfsen
72f6c01b53 Bug 1359059 - Skip visibility checks when clicking in XUL; r=whimboo
This patch removes the call to element.isVisible when clicking XUL
elements because it does not do anything useful.  element.isVisible skips
the Selenium atom.isElementDisplayed check for XUL elements and runs a
few web content/viewport centric tests that always pass in XUL.

It also splits the chrome click out to a separate function to avoid a
few if-conditions.

MozReview-Commit-ID: EkcwT77ku3C

--HG--
extra : rebase_source : ee5e8148934ec008cda996610c20a826f86412af
2017-04-24 15:01:41 +01:00
Andreas Tolfsen
754d617ec8 Bug 1359053 - Reject interaction.flushEventLoop if window is discarded; r=maja_zf
The window reference may have been discarded as a result of interaction.
For example, this may happen when clicking a button that deletes the
host <iframe> element containing the child window.  In this case, the
WindowProxy will set its closed property to true, to indicate that the
browsing context has been discarded.

We only want to flush the event loop of windows that exist, and so we
return early from interaction.flushEventLoop if the window has been
closed.

MozReview-Commit-ID: LtTHQRudKvk

--HG--
extra : rebase_source : e4133ddeed9e89e38fba6e9b8f17544a3546f7eb
2017-04-17 18:42:18 +01: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
7fbc7c7a97 Bug 1333014 - Align element interaction errors with spec; r=whimboo
This renames the ElementNotVisibleError to ElementNotInteractableError,
and adds a new ElementClickInterceptedError.

MozReview-Commit-ID: 6cjVghUCvyv

--HG--
extra : rebase_source : 3f2105c1f631ac4776e231bb6c88a00e26f1ae6c
2017-02-03 19:30:13 +00:00
Tooru Fujisawa
44f45bf316 Bug 1338257 - Remove remaining legacy generator from testing/marionette/. r=ato 2017-02-11 11:47:57 +09:00
Andrea Marchesini
8cf1cb8c2f Bug 1335536 - File.createFromNsIFile and File.createFromFileName should be async - part 1 - tests, r=smaug 2017-02-08 10:18:32 +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
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
be2dd10746 Bug 1317386 - Check pointer interactability upon interaction; r=automatedtester
Checking for general interactability will also consider keyboard
interactability, which has not yet been implemented.  On interacting with
an element by clicking, we should only test for pointer interactability.

MozReview-Commit-ID: BUCs7zHppRm

--HG--
extra : rebase_source : 2053a49ee4bcb291299568902e9ac25cc747bc5e
2016-11-14 21:07:42 +00:00
Andrea Marchesini
2aba798852 Bug 1303518 - Remove the chrome only constructor for File, r=qdot 2016-11-11 18:56:44 +01:00
Andreas Tolfsen
e3a3466f75 Bug 1244425 - Avoid CPOW when setting file array on <input type=file>; r=automatedtester
This removes the need to use a CPOW when sending keys to <input type=file>
elements.  It was previously not possible to constructo File objects in
privileged content space, but this now appears fixed.

MozReview-Commit-ID: 8XOVsDdypwC

--HG--
extra : rebase_source : 8d4329c4c6a64ac717fc5d54dc42c8eb136f5e7f
2016-08-30 12:46:01 +01:00
Andreas Tolfsen
0f34b42611 Bug 1280947 - Dispatch DOM change event on appending file to input; r=automatedtester
MozReview-Commit-ID: 6SC01AEkuTs

--HG--
extra : rebase_source : ee4ed323e024bf6fdcf9a28ab7f44763c7475c8c
2016-08-25 14:18:04 +01:00
Andreas Tolfsen
cf5f3418f9 Bug 1255955 -Run element enabled check before accessibility checks; r=automatedtester
MozReview-Commit-ID: 18OtOKtox3K

--HG--
extra : rebase_source : 2773dbd04f7a728b6b9fcd5db8e57b8abc28abcc
2016-08-13 20:59:14 +02:00
Andreas Tolfsen
50d1d83f2a Bug 1255955 - Simplify element.clickElement complexity; r=automatedtester
MozReview-Commit-ID: IXqgFlS6R6c

--HG--
extra : rebase_source : 77a35e9dcde68ef8c90888bdf6abea470b442296
2016-08-13 20:54:46 +02:00
Andreas Tolfsen
2b8b321b6a Bug 1255955 - Document clickElement and calculateCentreCoords; r=automatedtester
MozReview-Commit-ID: tSC5xRAVAl

--HG--
extra : rebase_source : 2038db7219878edde781a9823a309efcf8d49053
2016-08-13 20:54:15 +02:00
Andreas Tolfsen
010a199980 Bug 1255955 - Add support for interacting with <select> elements; r=automatedtester
This patch introduces support for clicking on <select> and <select
multiple> elements to Marionette.  As <select> elements, especially
<select multiple>, are operating system level concepts usually implemented
with native widget sets, this patch takes the approach of dispatching
generated events.

MozReview-Commit-ID: 9kwOva43AOL

--HG--
extra : rebase_source : dde090ed9487e593bc16f8a7e12365b97ada9735
2016-08-05 18:08:31 +01:00
Andreas Tolfsen
a6a86c1771 Bug 1255955 - Rename a11y functions check* to assert*; r=automatedtester
"Check" is a fine word but with functions which primary purpose is to
throw an error internally we should use "assert" to make the reprecussions
of using them crystal clear.

MozReview-Commit-ID: Kef4R8y8fiV

--HG--
extra : rebase_source : eb22beb7a33e593f34b3d24ecdaaa7f99d8e5f87
2016-08-05 11:43:40 +01:00
Andreas Tolfsen
a0e56a4788 Bug 1255955 - Perform click checks as part of promise; r=automatedtester
Some of the element interactability- and visibility checks were previously
done when interaction.clickElement was called, and not as part of the
resolution of the returned promise.  This could have caused a potential
race condition.

MozReview-Commit-ID: 691V86B4k5w

--HG--
extra : rebase_source : 7a6951d9c29aa5fa3eb3852d3d6d33e65f7d72c4
2016-08-05 11:38:23 +01:00
Andreas Tolfsen
1eec7ff342 Bug 1255955 - Recalculate visibility after scrolling; r=automatedtester
We want to redo the element interactability calculation after scrolling.
Determining if an element is not visible by the old location would
be wrong.

MozReview-Commit-ID: KGaPVmgcqSX

--HG--
extra : rebase_source : 12ac51e5c9947da1082351c4e382cfc95ea8f843
2016-08-05 11:00:19 +01:00
Andreas Tolfsen
26c6e26783 Bug 1255955 - Scroll element into view when not visible; r=automatedtester
The if-condition in the specification compatible interactability check
for interaction.clickElement is wrong.  It should scroll an element into
view when it is _not_ visible.  If it is visible it does not matter.

MozReview-Commit-ID: 2n34QddDkQv

--HG--
extra : rebase_source : efe079de9a1fa930ea2f3d9d8fff59fc9a4e269b
2016-08-05 10:53:06 +01:00
Andreas Tolfsen
e3854ffb41 Bug 1245064 - Implement element pointer-interactability; r=automatedtester
Implements the WebDriver pointer-interactability algorithm described in
http://w3c.github.io/webdriver/webdriver-spec.html#dfn-interactable-element.

The specification compatible behaviour is enabled only when the client
requests the capability specificationLevel >= 0.

MozReview-Commit-ID: BP60SGj49OW

--HG--
extra : rebase_source : d84d38510e28ab5e0debce2051e336e1fd3f0f86
2016-03-04 16:44:38 +00:00
Andreas Tolfsen
71b94d4505 Bug 1245064 - Refactor interaction- and accessibility API; r=automatedtester
MozReview-Commit-ID: LblRZz8KqPx

--HG--
extra : rebase_source : fbb7995924c7e2707e2aaa2293b8a5c51fc563bc
2016-03-03 13:58:13 +00:00
Carsten "Tomcat" Book
84efe80138 Backed out changeset 4dec8d87c105 (bug 1245064) for marionette bustage 2016-03-09 14:03:28 +01:00
Carsten "Tomcat" Book
38c337c81b Backed out changeset 1dd0bcc1c45e (bug 1245064) 2016-03-09 14:03:07 +01:00
Andreas Tolfsen
ed18a3de7d Bug 1245064 - Implement element pointer-interactability; r=automatedtester
Implements the WebDriver pointer-interactability algorithm described in
http://w3c.github.io/webdriver/webdriver-spec.html#dfn-interactable-element.

The specification compatible behaviour is enabled only when the client
requests the capability specificationLevel >= 0.

MozReview-Commit-ID: BP60SGj49OW

--HG--
extra : rebase_source : 357accaa38b44704fcaf839aa50e1e29af0b3f99
2016-03-04 16:44:38 +00:00
Andreas Tolfsen
fcdf164815 Bug 1245064 - Refactor interaction- and accessibility API; r=automatedtester
MozReview-Commit-ID: LblRZz8KqPx

--HG--
extra : rebase_source : 347210842fae698acde760c2733dd8d882a09c25
2016-03-03 13:58:13 +00:00
Andreas Tolfsen
a1495c253c Bug 1253236 - Remove window argument from element.isVisible; r=automatedtester
MozReview-Commit-ID: ITzY9RXjJCG

--HG--
extra : rebase_source : 7954e5d2891a8d214fdbf00ea1b0b62acc0482b3
2016-03-03 14:20:39 +00:00
Andreas Tolfsen
4a0bcbbee4 Bug 1253236 - Rename element.checkVisible to isVisible; r=automatedtester
MozReview-Commit-ID: 1fkH93OXjWF

--HG--
extra : rebase_source : 39c628d9ca7ef1713a68e620a8c759813c5415fc
2016-03-03 14:18:52 +00:00
Andreas Tolfsen
cb2ec4bbdf Bug 1250102 - Correct exported symbol from testing/marionette/element.js; r=automatedtester
MozReview-Commit-ID: 9naIfpy9HPD

--HG--
extra : rebase_source : dc6b96137ed6c378772477cc36687a1655028ae3
2016-02-23 15:01:12 +00:00
Andreas Tolfsen
b96bf07b7f Bug 1245153 - Rename interactions.js to interaction.js; r=automatedtester
MozReview-Commit-ID: F51ENbkcoR2

--HG--
rename : testing/marionette/interactions.js => testing/marionette/interaction.js
extra : histedit_source : 7269fae81673ad9630ad26e4506f978401c28c3f
extra : rebase_source : d2212a7701857f5a3ea37c400cd7cc49479f6bad
extra : commitid : BW8g2i1Wntt
extra : source : c1e0abbfa66e6289b25e3c6d45867c3b627d33d8
extra : intermediate-source : 6da8099573f3c84ab4361c9987441643488baf5b
2016-02-03 19:15:54 +00:00
Carsten "Tomcat" Book
33e27d2555 Backed out 18 changesets (bug 1245153) for multiple test failures
Backed out changeset 18d54b8d4ae8 (bug 1245153)
Backed out changeset 98b6d0c053c0 (bug 1245153)
Backed out changeset c29a348930a4 (bug 1245153)
Backed out changeset f79252e92acc (bug 1245153)
Backed out changeset 9f3f1c358e47 (bug 1245153)
Backed out changeset 3b9e9a027fa7 (bug 1245153)
Backed out changeset 6da8099573f3 (bug 1245153)
Backed out changeset 63a56310a1b5 (bug 1245153)
Backed out changeset 5fe42d498a2a (bug 1245153)
Backed out changeset b3be2d2f3ac1 (bug 1245153)
Backed out changeset ad5bf32d8fef (bug 1245153)
Backed out changeset 68a6dda373d2 (bug 1245153)
Backed out changeset 6ebd9fde50c0 (bug 1245153)
Backed out changeset e41a5b41859a (bug 1245153)
Backed out changeset 048d70070751 (bug 1245153)
Backed out changeset eff85dc0eaa9 (bug 1245153)
Backed out changeset dc6460e0f336 (bug 1245153)
Backed out changeset 36526a2e8b00 (bug 1245153)

--HG--
rename : testing/marionette/event.js => testing/marionette/EventUtils.js
rename : testing/marionette/action.js => testing/marionette/actions.js
rename : testing/marionette/atom.js => testing/marionette/atoms/atoms.js
rename : testing/marionette/element.js => testing/marionette/elements.js
rename : testing/marionette/frame.js => testing/marionette/frame-manager.js
rename : testing/marionette/interaction.js => testing/marionette/interactions.js
2016-02-11 17:05:41 +01:00
Andreas Tolfsen
8601465556 Bug 1245153 - Rename interactions.js to interaction.js; r=automatedtester
MozReview-Commit-ID: F51ENbkcoR2

--HG--
rename : testing/marionette/interactions.js => testing/marionette/interaction.js
extra : commitid : BW8g2i1Wntt
extra : rebase_source : a8fcc42b45fb2edeeec4fbee97a472fe0300bc66
extra : source : c1e0abbfa66e6289b25e3c6d45867c3b627d33d8
extra : histedit_source : 7269fae81673ad9630ad26e4506f978401c28c3f
2016-02-03 19:15:54 +00:00
Carsten "Tomcat" Book
d07b3125f8 Backed out 16 changesets (bug 1245153) for mochitest test-bustage on a CLOSED TREE
Backed out changeset 30c8ec933737 (bug 1245153)
Backed out changeset 4c2b1902d7cd (bug 1245153)
Backed out changeset 1be5f60393a0 (bug 1245153)
Backed out changeset 22321e6b65e9 (bug 1245153)
Backed out changeset c1e0abbfa66e (bug 1245153)
Backed out changeset 80ae953819c8 (bug 1245153)
Backed out changeset 3edb67388ad6 (bug 1245153)
Backed out changeset 55f64197f6b5 (bug 1245153)
Backed out changeset 6bb93562a576 (bug 1245153)
Backed out changeset 5da7628c3767 (bug 1245153)
Backed out changeset bd41e4ab829d (bug 1245153)
Backed out changeset ee7ee24cc65e (bug 1245153)
Backed out changeset 4b2a5ee7199e (bug 1245153)
Backed out changeset d75ad1397656 (bug 1245153)
Backed out changeset 1f5e37f8e446 (bug 1245153)
Backed out changeset aec0a0166685 (bug 1245153)

--HG--
rename : testing/marionette/event.js => testing/marionette/EventUtils.js
rename : testing/marionette/action.js => testing/marionette/actions.js
rename : testing/marionette/atom.js => testing/marionette/atoms/atoms.js
rename : testing/marionette/element.js => testing/marionette/elements.js
rename : testing/marionette/frame.js => testing/marionette/frame-manager.js
rename : testing/marionette/interaction.js => testing/marionette/interactions.js
extra : rebase_source : 11bba1116e87ed79fa72f24ff41216a6e3fb00d6
2016-02-05 14:18:19 +01:00
Andreas Tolfsen
e08f76bd5b Bug 1245153 - Rename interactions.js to interaction.js; r=automatedtester
--HG--
rename : testing/marionette/interactions.js => testing/marionette/interaction.js
extra : commitid : BW8g2i1Wntt
extra : rebase_source : b9fb3a3f1cd9a9a1cd1e2ffd71d64bef5d2b3e52
extra : histedit_source : 7269fae81673ad9630ad26e4506f978401c28c3f
2016-02-03 19:15:54 +00:00