geckodriver sends capabilities as a JSON Object in the body of the
command, like this:
[0,1,"newSession",{"acceptInsecureCerts":true}]
With https://bugzil.la/1387380 we wanted the Marionette Python client
to match this behaviour, however the patch overlooked the fact that
the server reads cmd.parameters.capabilities, meaning it looks for a
"capabilities" field on this object instead of treating the object as
the dictionary of capabilities.
As a follow-up to that bug, this patch removes the ability to override
the session ID by specifying a "sessionId" field. This functionality
was only used for in-app restart tests. When Firefox restarts, the
Marionette session is arguably not the same, and sessions should not
live on between restarts.
This patch will fix capabilities passed from geckodriver and align the
Marionette Python client.
For backwards compatibility reasons, it needs to be possible to use the
Python client with older Firefoxen that reads cmd.parameters.capabilities
instead of cmd.parameters. This is why we duplicate the capabilities
object, like geckodriver does.
MozReview-Commit-ID: DCpaxl9hOLe
geckodriver sends capabilities as a JSON Object in the body of the
command, like this:
[0,1,"newSession",{"acceptInsecureCerts":true}]
With https://bugzil.la/1387380 we wanted the Marionette Python client
to match this behaviour, however the patch overlooked the fact that
the server reads cmd.parameters.capabilities, meaning it looks for a
"capabilities" field on this object instead of treating the object as
the dictionary of capabilities.
As a follow-up to that bug, this patch removes the ability to override
the session ID by specifying a "sessionId" field. This functionality
was only used for in-app restart tests. When Firefox restarts, the
Marionette session is arguably not the same, and sessions should not
live on between restarts.
This patch will fix capabilities passed from geckodriver and align the
Marionette Python client.
For backwards compatibility reasons, it needs to be possible to use the
Python client with older Firefoxen that reads cmd.parameters.capabilities
instead of cmd.parameters. This is why we duplicate the capabilities
object, like geckodriver does.
MozReview-Commit-ID: DCpaxl9hOLe
--HG--
extra : rebase_source : 4464d9510ec8cc8a36a834d5b4b1178752dd488b
Given that both 'close' and 'close_chrome_window' wait for the underlying
tab or window to be closed, there is not need to explicitely wait in tests.
MozReview-Commit-ID: HOGgqzkNE9d
--HG--
extra : rebase_source : 0a1b197d499c9c2528e67e61172d90579f7ad696
In case of websites manipulating the browser's history via history.pushState
there will be no usual page load events fired. Instead listeners for popstate
events have to be used.
When such an event occurs we can directly return because the browser will
not load the underlying page. This only happens when navigating to another
page first, or restarting Firefox.
MozReview-Commit-ID: 3PceeYK9Co7
--HG--
extra : rebase_source : 30c162f72279712920a96ebc2076db27d01c41b6
The geckodriver HTTPD proxy implements WebDriver conforming capabilities
negotation and it is unnecessary to do this in the Marionette WebDriver
service. The capabilities matching that Marionette implements is also
not as good as the implementation found in geckodriver.
The WebDriver:NewSession command will still accept a JSON Object of
"configuration" capabilities that carry the pre-matched capabilities from
geckodriver. These will be used as configuration options for the session.
Type- and bounds checks will still be performed on this input.
MozReview-Commit-ID: CROjgGuTXOG
--HG--
extra : rebase_source : eb7e9f69fe3b23b77ea497d758fe30ac93d6373c
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.
MozReview-Commit-ID: 4ecl3RZhOwC
--HG--
extra : rebase_source : 412880ea27766118c38498d021331a3df6bccc70
The WebDriver service in the remote protocol accepts sessionId and
session_id and we only need on. All known consumers are using sessionId,
and we can drop the session_id fallback.
MozReview-Commit-ID: 6fa5Lgkzwfu
The element click functions in testing/marionette/interaction.js are
generator functions using "yield". This patch converts them to async
functions.
MozReview-Commit-ID: 4A4cTaY619w
The element click functions in testing/marionette/interaction.js are
generator functions using "yield". This patch converts them to async
functions.
MozReview-Commit-ID: 4A4cTaY619w
--HG--
extra : rebase_source : 1b6f1b545f438ae253fd4024500bf41536d976aa
With a WebDriver-conforming Element Click implementation, the element
click intercepted error is returned when an element with pointer-events:
"none" causes the click to hit the underlying element.
This patch does not functionally change anything yet about the
accessibility tests, but splits disabled_accessibility_elementIDs into
two lists, aria_disabled_elements and pointer_events_none_elements, in
anticipation of moving Marionette to use a different click implementation.
In the future, the ARIA tests will fail with "element not accessible"
errors as they do now, but the pointer-events tests will fail with
"element click intercepted" instead.
MozReview-Commit-ID: Ks1hyUVyLK7
--HG--
extra : rebase_source : 20dbcc228955626cd2d1617aa055f29f4e5928a4
Because the sizemodechange event is not synchronous on all platforms,
we additionally need to await the window's dimensions to change.
However, if the window manager does not have a notion of a maximised
state, this operation too could time out. However, it is believed
that the additional wait will allow for the window to transition to the
required state in this scenario.
MozReview-Commit-ID: KeHJMKSJfjQ
--HG--
extra : rebase_source : 797b3be8f6adb027f15dd638f22afa6efd0f0432
This introduces a specialisation of the well-known Promise that can
time out after a set limit, causing the promises' "reject" callback to
be invoked.
The TimedPromise object represents the timed, eventual completion
(or failure) of an asynchronous operation, and its resulting value.
In contrast to a regular Promise, it times out after a set timeframe.
MozReview-Commit-ID: Rb3POsPYeT
--HG--
extra : rebase_source : cdff792dfa43af3cff1b20b3e81edb1a826e561e
The condition can be used for other things than poll-waiting.
MozReview-Commit-ID: 1sudv5JuEQT
--HG--
extra : rebase_source : ff58917f6fc0a860e149805ad838816541091705
The dictionary from Marionette#window_size is a subset of what is returned
from Marionette#window_rect, causing the self.assertEqual to complain
that they are not equal. We want to compare the same types.
MozReview-Commit-ID: L4XTlgtUYKW
--HG--
extra : rebase_source : c3adf89777ac589cab2fb84fe3e543f22d9895fc
The "delta" in the second assertion was not deducted from the height.
The patch also improves the error message.
MozReview-Commit-ID: 8u8UhKg3Q62
--HG--
extra : rebase_source : a3771620fc15225ac6932c718515b8dfcf2fdab0
The window state was included for only some of the commands' responses
earlier.
MozReview-Commit-ID: DdNyR7vdgtY
--HG--
extra : rebase_source : b7c3c7376f8affff673c903ba2c90e2cee93878a
These pass now (on my machine) after filling in look & feel values for headless
mode.
MozReview-Commit-ID: DpT74JbcMoF
--HG--
extra : rebase_source : b65dc65b23c6fc27d318c49a0a0349071125b104
When the MOZ_HEADLESS output variable is set in the environment,
--headless will be implied when using the Marionette harness. This will
cause test rules and ignores to be picked up with MOZ_HEADLESS as they
are with --headless.
MozReview-Commit-ID: 8L7J4asQXyF
--HG--
extra : rebase_source : 0d4a41d028752c806fab94a5d0d0bb2802134b81
Marionette deselects <option>s if they are already selected in <select
multiple>, but it should not deselect them if they are in a dropdown
<select>.
MozReview-Commit-ID: 9CHfYrGn7xR
--HG--
extra : rebase_source : f2357c8b111a0296844b8eb594cfb13e8799c3a0
Marionette throws a TypeError when the element is not an <option>,
and we should use the same error type when a XUL element is passed.
MozReview-Commit-ID: 3p3wPcW621f
--HG--
extra : rebase_source : dd5147d98ce68e664d0782949a760f499f3fe24a
Throw a better error message when the wrong element type is passed to
interaction.selectOption.
MozReview-Commit-ID: G1NIZ25umm2
--HG--
extra : rebase_source : 55389d965c253dc3f1718e627f5c3a0c4f16fb84
Under testing/marionette, we always use semicolons for consistency and we
never initialise scoped variables to undefined becuase it is the default
value. We also indent continued call expressions by four characters.
Disallowed:
let foo = undefined;
return foo
Allowed:
const foo = undefined;
let bar;
return bar;
MozReview-Commit-ID: LgVPMqnFqNk