Marionette screenshot is limited image size to viewport where we need a full canvas

RESOLVED FIXED in mozilla30

Status

--
major
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: automatedtester, Assigned: automatedtester)

Tracking

unspecified
mozilla30
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments, 3 obsolete attachments)

(Assignee)

Description

5 years ago
From the spec

This command will take a screenshot of the current window. Implementations of the remote end should capture the entire DOM, even if this would require a user to scroll the browser window. That is, the returned PNG should have the same width and height as returned by a call to getSize of the BODY element and must contain all visible content on the page, and this should be done without resizing the browser window. If the remote end is unable to capture the entire DOM, then the part of the DOM currently displayed in UI of the browser must be captured without additional chrome such as scrollbars and browser chrome.
Note

One way to think of capturing the entire DOM is that the user has an infinitely large monitor and has resized the window to allow all content to be visible. One of those monitors would be very cool.

Nested frames must be sized as if the user has resized the window to the dimensions of the PNG being returned. This often means that not all potentially visible content within the nested frames is captured.

Remote ends must not attempt to track changes in window size as the screenshot is being taken. In particular this means that in the case of a page that makes use of "infinite scrolling" (where an AJAX call is used to populate additional content as the user scrolls down) or in some other way resizes content as the window size is changed only the content that was originally contained in the DOM when the command is executed will be captured.
(Assignee)

Comment 1

5 years ago
Created attachment 752717 [details]
image as a data uri

Marionette currently only shows the view port instead of the entire canvas which is different behaviour from WebDriver currently
Duplicate of this bug: 883294

Comment 4

5 years ago
Now that Marionette has very high exposure amongst Gaia it would really help out with debugging to have the whole screen.
Severity: normal → major
(Assignee)

Updated

5 years ago
Assignee: nobody → dburns
(Assignee)

Comment 5

5 years ago
Created attachment 8368944 [details]
Example of new screenshot that is full canvas
(Assignee)

Comment 7

5 years ago
Created attachment 8368961 [details] [diff] [review]
Make sure that Marionette takes a screenshot of the the entire content canvas;
Attachment #8368961 - Flags: review?(mdas)
Comment on attachment 8368961 [details] [diff] [review]
Make sure that Marionette takes a screenshot of the the entire content canvas;

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

Cool, thanks! Just remove the pdb lines and rerun Mn on try to make sure it works.

::: testing/marionette/client/marionette/tests/unit/test_screenshot.py
@@ +19,5 @@
>  
>      def testWeCanTakeAScreenShotEntireCanvas(self):
>          test_url = self.marionette.absolute_url('html5Page.html')
> +        self.marionette.navigate('https://developer.mozilla.org/en-US/docs/Web/API/Element.scrollWidth')
> +        import pdb; pdb.set_trace()

remove pdb lines
Attachment #8368961 - Flags: review?(mdas) → review+
(Assignee)

Comment 10

5 years ago
Created attachment 8369439 [details] [diff] [review]
Make sure that Marionette takes a screenshot of the the entire content canvas;
(Assignee)

Updated

5 years ago
Attachment #8368961 - Attachment is obsolete: true
(Assignee)

Comment 12

5 years ago
Created attachment 8369445 [details] [diff] [review]
Make sure that Marionette takes a screenshot of the the entire content canvas;
(Assignee)

Updated

5 years ago
Attachment #8369439 - Attachment is obsolete: true
(Assignee)

Comment 14

5 years ago
Created attachment 8371024 [details] [diff] [review]
screenshot.patch

carrying r+ forward and making sure patch that landed is correct here
Attachment #8369445 - Attachment is obsolete: true
Attachment #8371024 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/21826d6c7d6e
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.