Commit Graph

34 Commits

Author SHA1 Message Date
Andreas Tolfsen
da6629ba61 Bug 1387559 - Drop session_id fallback for WebDriver:NewSession. r=automatedtester
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
2017-08-05 17:35:54 +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
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
d26d0d6594 Bug 1371733 - Propagate error message of assert.object; r=whimboo
The err argument to assert.object is currently being dropped, which
means we loose the specialised and the custom error message.

This patch propagates the error message like we do for all other
assertions in this module.

MozReview-Commit-ID: GwuBSbqKfk1

--HG--
extra : rebase_source : 86c57aaaf60526eaf65345b9d5e38378920419e3
2017-06-12 18:02:39 +01:00
Henrik Skupin
c0479d07f7 Bug 1368965 - assert.contentBrowser has to check for closed chrome window. r=ato
Due to the current caching of this.tab in browser.js the assertion
for the contentBrowser would fail. As such additionally assert that
the currently selected chrome window has not been closed yet.

Also assert.window should better check the 'closed' property instead
of handling a possible TypeError.

MozReview-Commit-ID: B79czg3dsux

--HG--
extra : rebase_source : 31bf31d2151e4b461574101ce7770d38fb92bd5c
2017-06-13 18:08:22 +02:00
Henrik Skupin
8907d0b29a Bug 1368492 - Add assert.browsingContext for parent process. r=ato
When accessing a property of the current content browser from
the parent process, the current top-level browsing context has
to be valid.

MozReview-Commit-ID: BZHJTk1j5Nj

--HG--
extra : rebase_source : 7e44fc6e05d7fb1429fb3e36e897cf51b3d9142f
2017-05-31 16:44:49 +02:00
Henrik Skupin
16a144567e Bug 1318351 - Remove B2G related assertions. r=ato
MozReview-Commit-ID: Iy0wYJoodvO

--HG--
extra : rebase_source : 3bd93ecc4ef24df3db6846d7db2a314c183128aa
2017-05-03 16:40:37 +02:00
Andreas Tolfsen
9d9b0dba43 Bug 1359004 - Add preliminary support for unexpected alerts r=whimboo
Add preliminary support for returning unexpected alert open errors when
calling commands that require it according to the WebDriver standard.

Also fixes a faulty test that seems to believe it is fine to click an
element whilst an alert is present.

Further work needs to be done on user prompts, asserts, and the handler
for user prompts in https://bugzilla.mozilla.org/show_bug.cgi?id=1264259.

MozReview-Commit-ID: BiWURoQECji

--HG--
extra : rebase_source : caa1506a0e972c7ad0da2d31993fb0b8ecc1ee17
2017-04-20 18:00:46 +01:00
Henrik Skupin
8f09dfa944 Bug 1299626 - Fix "TypeError: can't access dead object" in assert.window(). r=ato
The assertion method is used to check for a valid window. But it can fail
itself when already accessing the ChromeWindow. To fix that we have to
catch a possible TypeError and let the method throw a NoSuchWindowError
instead.

MozReview-Commit-ID: 3Uaio4a3HtA

--HG--
extra : rebase_source : 5c672e441789e45b4972b0f8fde8471b4998394d
2017-03-28 21:10:06 +02:00
Andreas Tolfsen
18c977b6ec Bug 1337743 - Document misuse of instanceof in Marionette; r=whimboo
MozReview-Commit-ID: IbUyQd0xCAI

--HG--
extra : rebase_source : 5f4298e2951d9a606ad85e145771570b84b2e3d7
2017-02-14 16:48:14 +00:00
Andreas Tolfsen
90398e4cd5 Bug 1337743 - Add assert.callable for checking callbacks; r=maja_zf
MozReview-Commit-ID: 2bJbi4iEGlZ

--HG--
extra : rebase_source : 2a16d909389df554eb719f574d655ee96694e0ad
2017-02-10 19:28:51 +00:00
Andreas Tolfsen
0a3aacab95 Bug 1337743 - Count nsJSIID objects as objects; r=whimboo
MozReview-Commit-ID: IKzgAYEgAJe

--HG--
extra : rebase_source : 643d38527e7707b8398477ecbc5f9a57f010eacd
2017-02-09 16:35:07 +00:00
Henrik Skupin
9b63422f73 Bug 1322383 - Add missing checks for valid chrome window. r=ato
Update necessary commands in driver.js to conform with webdriver spec by checking for a valid chrome window,
before executing the actual command.

MozReview-Commit-ID: Ad67SPx8vBx

--HG--
extra : rebase_source : 560b0807c72efb513027abcde3bf7af38aca602a
2017-03-20 15:13:32 +01:00
Sebastian Hengst
ce42d563b4 Backed out changeset 2da5d0c57ecd (bug 1322383) 2017-03-21 19:05:56 +01:00
Henrik Skupin
53fb89a6a6 Bug 1322383 - Add missing checks for valid chrome window. r=ato
Update necessary commands in driver.js to conform with webdriver spec by checking for a valid chrome window,
before executing the actual command.

MozReview-Commit-ID: Ad67SPx8vBx

--HG--
extra : rebase_source : 356f6aadad8e8a8cb53578bf1c194a3a26fb2e45
2017-03-20 15:13:32 +01:00
Carsten "Tomcat" Book
1f281c3405 Backed out changeset 74b0c928a23e (bug 1322383) for frequent failure rate in marionette tests
--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_type_chrome.py => testing/marionette/harness/marionette_harness/tests/unit/test_window_type.py
2017-03-01 12:49:21 +01:00
Henrik Skupin
adf2cd32d2 Bug 1322383 - Add missing checks for valid window r=ato+446296
MozReview-Commit-ID: Ad67SPx8vBx

--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_type.py => testing/marionette/harness/marionette_harness/tests/unit/test_window_type_chrome.py
extra : rebase_source : f799c6b272a48654dff8cbbb7df7fe8fbb05bc22
2017-02-03 17:49:38 +01:00
Maja Frydrychowicz
a0e09e3402 Bug 1337133 - Add number check to assert.js; r=ato+446296
MozReview-Commit-ID: 9BVna5jO49b

--HG--
extra : rebase_source : d3f0342adaaa872496bc6eb16ce40fb990311aab
2017-02-20 10:38:05 -05:00
Andreas Tolfsen
69d406c698 Bug 1336214 - Preserve stacktraces in Marionette errors; r=maja_zf
Since bug 1326534 we have discarded the original stacktrace from errors
originating inside Marionette.  This was due to faulty logic when
attempting to generate a new stacktrace when it was missing from a
propagated error.

This change simplifies WebDriver errors by making use of Error
inheritance.  The WebDriver error specific functions error.toJson and
error.fromJson has additionally been moved to WebDriverError.

MozReview-Commit-ID: C3Ns0H01LyG

--HG--
extra : rebase_source : 0c705054dae8c0647500bb90e9b970cc57e712c4
2017-02-10 18:36:52 +00:00
Sebastian Hengst
94a3198643 Backed out changeset deb5b08545fd (bug 1322383) for frequently failing to find windows in wpt tests on Windows. r=backout
--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_type_chrome.py => testing/marionette/harness/marionette_harness/tests/unit/test_window_type.py
2017-02-09 18:13:02 +01:00
Henrik Skupin
f681f14f4f Bug 1322383 - Add missing checks for valid window r=ato
MozReview-Commit-ID: Ad67SPx8vBx

--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_window_type.py => testing/marionette/harness/marionette_harness/tests/unit/test_window_type_chrome.py
extra : rebase_source : 16bcd69d1906d8f2a544fd441cac2ff59634a5a1
2017-02-03 17:49:38 +01:00
Andreas Tolfsen
73f85ac684 Bug 1336124 - Add assert.session for checking if session is active; r=maja_zf
MozReview-Commit-ID: CmHFag2q1V2

--HG--
extra : rebase_source : 526e01466ce4a00a091dd88cb060d166c6ac4245
2017-02-02 16:09:14 +00:00
Maja Frydrychowicz
259f6b6eda Bug 1328726 - Style fix ups in Marionette key actions implementation; r=ato
These are leftover from review of Bug 1320389. I must have forgotten to
re-push to MozReview.

MozReview-Commit-ID: ENTFdmCsv6I

--HG--
extra : rebase_source : 3c6961fb1826cb7cc00d1bd6048ed2c94c9a2f1a
2017-01-04 17:48:11 -05:00
Wes Kocher
abd222ddc9 Backed out 8 changesets (bug 1328726) for webdriver bustage a=backout CLOSED TREE
Backed out changeset 1039c2ca90ee (bug 1328726)
Backed out changeset de5830f1b8ab (bug 1328726)
Backed out changeset c039479ce446 (bug 1328726)
Backed out changeset 6d9673eedd91 (bug 1328726)
Backed out changeset be79eb6f9d64 (bug 1328726)
Backed out changeset 6be0203f1a26 (bug 1328726)
Backed out changeset 4430151d0cb4 (bug 1328726)
Backed out changeset 2143f1aa8087 (bug 1328726)

MozReview-Commit-ID: GrWBTO2rhXm
2017-01-25 10:51:08 -08:00
Maja Frydrychowicz
a09882ecfa Bug 1328726 - Style fix ups in Marionette key actions implementation; r=ato
These are leftover from review of Bug 1320389. I must have forgotten to
re-push to MozReview.

MozReview-Commit-ID: ENTFdmCsv6I

--HG--
extra : rebase_source : 3c6961fb1826cb7cc00d1bd6048ed2c94c9a2f1a
2017-01-04 17:48:11 -05:00
Wes Kocher
26b0e2ee32 Backed out 7 changesets (bug 1328726) for lint failures a=backout
Backed out changeset 93218dc2249f (bug 1328726)
Backed out changeset 0e6e8d3fccec (bug 1328726)
Backed out changeset 5606cc9b0654 (bug 1328726)
Backed out changeset 40fceb2644d7 (bug 1328726)
Backed out changeset 0c10680f0705 (bug 1328726)
Backed out changeset a2520d52c7cc (bug 1328726)
Backed out changeset ec1a2cd38ffe (bug 1328726)

MozReview-Commit-ID: KnktbcccJoR
2017-01-24 13:55:07 -08:00
Maja Frydrychowicz
fea0cb5625 Bug 1328726 - Style fix ups in Marionette key actions implementation; r=ato
These are leftover from review of Bug 1320389. I must have forgotten to
re-push to MozReview.

MozReview-Commit-ID: ENTFdmCsv6I

--HG--
extra : rebase_source : 3c6961fb1826cb7cc00d1bd6048ed2c94c9a2f1a
2017-01-04 17:48:11 -05:00
Andreas Tolfsen
52426eb1ab Bug 1326534 - Add assert.in for own properties; r=automatedtester
The implementation of the new library function `assert.in` is analogous
to Python's `unittest.TestCase.assertIn`.

MozReview-Commit-ID: 1pjS9ttPXgo

--HG--
extra : rebase_source : 3f4121226d65f127fdf0c990915483659f3a7f93
2016-12-30 11:39:22 +00:00
Andreas Tolfsen
de884b68a6 Bug 1326534 - Exclude array and null from being counted as objects; r=automatedtester
Calling `typeof` on arrays or null in JavaScript returns `"object"`,
and a safer check is to rely on `Object.prototype.toString`.

MozReview-Commit-ID: 5VxXf2ByoEx

--HG--
extra : rebase_source : 4d1fe95a75343964836e670d0ceffa6ce680e390
2016-12-30 11:21:27 +00:00
Henrik Skupin
29c4ebd2b3 Bug 1326174 - For unsupported commands in chrome context throw UnsupportedOperationError r=ato
Commands which are not (yet) supported in chrome context have to throw an
UnsupportedOperationError to indicate that they cannot be used instead of
silently eating failures.

MozReview-Commit-ID: 2eFYAfKaQpD

--HG--
extra : rebase_source : e84c0cde92075a1a5fd91b7e75f0e8c1cace00fa
2016-12-29 14:04:16 +01:00
Maja Frydrychowicz
5095f8b5b8 Bug 1320389 - Implement dispatch of key actions in content context; r=ato
MozReview-Commit-ID: AxHTFdDtXJN

--HG--
extra : rebase_source : 0d12a5f56bcd05d0eccb8aa794779002f555e62d
2016-12-13 18:29:48 -05: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
e5010028a2 Bug 1313865 - Centralise common Marionette assertions; r=automatedtester,maja_zf
Many tests that result in throwing errors, amongst those many type-
and platform checks, are repeated throughout the Marionette code base.
This patch centralises the most common of these, typically reducing
consumer calls from three to one line.

Example usage:

	assert.defined(cmd.parameters.value);
	assert.postiveInteger(cmd.parameters.value,
	    error.pprint`Expected 'value' (${value}) to be a signed integer`);
	// InvalidArgumentError: Expected 'value' ([object Object] {"foo": "bar"}) to be a positive integer

MozReview-Commit-ID: BHOaDazeGer

--HG--
extra : rebase_source : 1d35c10e29d4fd536829e9714ae65bcd14ad21f8
2016-10-31 22:00:21 +00:00