Closed Bug 810259 Opened 7 years ago Closed 7 years ago

Add screenshot support to Marionette

Categories

(Testing :: Marionette, defect)

defect
Not set

Tracking

(firefox18 fixed, firefox19 fixed, firefox20 fixed)

RESOLVED FIXED
mozilla20
Tracking Status
firefox18 --- fixed
firefox19 --- fixed
firefox20 --- fixed

People

(Reporter: davehunt, Assigned: automatedtester)

Details

Attachments

(1 file, 2 obsolete files)

I order to aid debugging of test failures, it would be very helpful to be able to take screenshots using Marionette.
I'll take this and do it now as it can help with trying to do stability work later
Assignee: nobody → dburns
Attached patch screenshooting elements (obsolete) — Splinter Review
Attachment #684155 - Flags: review?(mdas)
Comment on attachment 684155 [details] [diff] [review]
screenshooting elements

Review of attachment 684155 [details] [diff] [review]:
-----------------------------------------------------------------

Very cool, but r- for now, since the test_screenshot.py test is missing from the patch!

::: testing/marionette/marionette-listener.js
@@ +1090,5 @@
> + * Saves a screenshot and returns a Base64 string
> + */
> +function screenShot(msg) {
> +  let node = null;
> +  if (msg.json.element) { 

extra whitespace at the end

@@ +1098,5 @@
> +    catch (e) {
> +      sendResponse(e.message, e.code, e.stack);
> +      return;
> +    }
> +  } 

same here

@@ +1107,5 @@
> +
> +  var document = curWindow.document;
> +  var rect, win, width, height, left, top, needsOffset;
> +  // node can be either a window or an arbitrary DOM node
> +  try {

instead of using try/catch, can you just do if (node == curWindow) {...} else{...}? It's safer and clearer than just catching any error and trying the node as a window
Attachment #684155 - Flags: review?(mdas) → review-
Try run for 73d27cc37de3 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=73d27cc37de3
Results (out of 13 total builds):
    success: 12
    warnings: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dburns@mozilla.com-73d27cc37de3
Attachment #684155 - Attachment is obsolete: true
Attachment #687128 - Flags: review?(mdas)
Forgot about one of the comments so adding it it now.
Attachment #687128 - Attachment is obsolete: true
Attachment #687128 - Flags: review?(mdas)
Attachment #687213 - Flags: review?
Attachment #687213 - Flags: review? → review?(mdas)
Attachment #687213 - Flags: review?(mdas) → review+
https://hg.mozilla.org/mozilla-central/rev/78eee87ba496
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Whiteboard: [automation-needed-in-aurora]
Whiteboard: [automation-needed-in-beta]
Whiteboard: [automation-needed-in-beta]
Try run for 73d27cc37de3 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=73d27cc37de3
Results (out of 14 total builds):
    success: 12
    warnings: 1
    failure: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dburns@mozilla.com-73d27cc37de3
You need to log in before you can comment on or make changes to this bug.