Commit Graph
35 Commits
Author SHA1 Message Date
Andreas Tolfsen 7aeed18293 Bug 1394849 - Export pprint separately. r=automatedtester
pprint is currently exposed twice: once on the error namespace and once
separately.  We only want to expose it once, and since there are only a
handful "error.pprint" usages left, we can go ahead and make this change.

When we move transition to use "require" in the future, like devtools
does, it will be possible to use both "error.pprint" and "pprint" styles
without export duplication.

MozReview-Commit-ID: CAnPDWn9Vr7
2017-08-29 17:33:38 +01:00
Andreas Tolfsen b10438b2d3 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 f52986781a 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
2017-07-26 13:11:53 +01:00
Andreas Tolfsen 521870d93c Bug 1376128 - Lint testing/marionette; r=automatedtester
MozReview-Commit-ID: DY4yCSBEZrN
2017-06-29 16:40:24 -07:00
Andreas Tolfsen d81d7b9dad 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
2017-06-28 11:01:49 -07:00
Andreas Tolfsen e04ebea203 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
2017-06-12 18:02:39 +01:00
Henrik Skupin 4dc68ecf81 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
2017-06-13 18:08:22 +02:00
Henrik Skupin e2b4d84969 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
2017-05-31 16:44:49 +02:00
Henrik Skupin 1d4ac0eb59 Bug 1318351 - Remove B2G related assertions. r=ato
MozReview-Commit-ID: Iy0wYJoodvO
2017-05-03 16:40:37 +02:00
Andreas Tolfsen 7e0a9391a6 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
2017-04-20 18:00:46 +01:00
Henrik Skupin d99dfff76e 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
2017-03-28 21:10:06 +02:00
Andreas Tolfsen 989595c71a Bug 1337743 - Document misuse of instanceof in Marionette; r=whimboo
MozReview-Commit-ID: IbUyQd0xCAI
2017-02-14 16:48:14 +00:00
Andreas Tolfsen eb0d003cc0 Bug 1337743 - Add assert.callable for checking callbacks; r=maja_zf
MozReview-Commit-ID: 2bJbi4iEGlZ
2017-02-10 19:28:51 +00:00
Andreas Tolfsen c2272e7daa Bug 1337743 - Count nsJSIID objects as objects; r=whimboo
MozReview-Commit-ID: IKzgAYEgAJe
2017-02-09 16:35:07 +00:00
Henrik Skupin 43b6e30fc7 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
2017-03-20 15:13:32 +01:00
Sebastian Hengst 23c4996922 Backed out changeset 2da5d0c57ecd (bug 1322383) 2017-03-21 19:05:56 +01:00
Henrik Skupin 1a9fd90e97 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
2017-03-20 15:13:32 +01:00
Carsten "Tomcat" Book ccbc46e79b Backed out changeset 74b0c928a23e (bug 1322383) for frequent failure rate in marionette tests 2017-03-01 12:49:21 +01:00
Henrik Skupin 42783c1efc Bug 1322383 - Add missing checks for valid window r=ato+446296
MozReview-Commit-ID: Ad67SPx8vBx
2017-02-03 17:49:38 +01:00
Maja Frydrychowicz 77d26033aa Bug 1337133 - Add number check to assert.js; r=ato+446296
MozReview-Commit-ID: 9BVna5jO49b
2017-02-20 10:38:05 -05:00
Andreas Tolfsen aa93eaee12 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
2017-02-10 18:36:52 +00:00
Sebastian Hengst da3695dd95 Backed out changeset deb5b08545fd (bug 1322383) for frequently failing to find windows in wpt tests on Windows. r=backout 2017-02-09 18:13:02 +01:00
Henrik Skupin f83176154c Bug 1322383 - Add missing checks for valid window r=ato
MozReview-Commit-ID: Ad67SPx8vBx
2017-02-03 17:49:38 +01:00
Andreas Tolfsen 4a96e5632e Bug 1336124 - Add assert.session for checking if session is active; r=maja_zf
MozReview-Commit-ID: CmHFag2q1V2
2017-02-02 16:09:14 +00:00
Maja Frydrychowicz 9a45d4c774 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
2017-01-04 17:48:11 -05:00
Wes Kocher ffad4365f4 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 492d6004ae 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
2017-01-04 17:48:11 -05:00
Wes Kocher 4279fe52cf 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 32c2533394 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
2017-01-04 17:48:11 -05:00
Andreas Tolfsen f7d6d4a748 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
2016-12-30 11:39:22 +00:00
Andreas Tolfsen 565ff529dd 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
2016-12-30 11:21:27 +00:00
Henrik Skupin 0e5d1c9feb 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
2016-12-29 14:04:16 +01:00
Maja Frydrychowicz b4e4753790 Bug 1320389 - Implement dispatch of key actions in content context; r=ato
MozReview-Commit-ID: AxHTFdDtXJN
2016-12-13 18:29:48 -05:00
Thomas Charles b57e64d886 Bug 1316975 - Correct function definition style in Marionette components; r=ato
No functional changes.

MozReview-Commit-ID: 25cWAnpRB9H
2016-12-04 12:42:52 +01:00
Andreas Tolfsen 47d9068910 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
2016-10-31 22:00:21 +00:00