screenshot() method should save JPEG images and offer tests details about the taken image

RESOLVED FIXED

Status

Testing Graveyard
Mozmill
RESOLVED FIXED
6 years ago
a year ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

Details

Attachments

(3 attachments)

(Assignee)

Description

6 years ago
Created attachment 629980 [details]
example screenshot (level: 0.3)

Right now we store screenshots as PNG files which are quite large. With bug 564388 fixed in Firefox 7 we can now even store JPEG files. I have checked different levels of quality and 0.3 is probably a good fit between quality and size. I will attach an example image to this bug. With that change we drop the image size from 74kb to 32kb.

Further we should return details of the image to the callee of screenshot so it can be even re-used in tests.
(Assignee)

Comment 1

6 years ago
Created attachment 629981 [details]
example screenshot (level: 0.4)

Just for reference one more image with level 0.4 which is 35kb in size. What do you think is the level we should use? My upcoming patch will use 0.3 for the first round.
(Assignee)

Comment 2

6 years ago
Created attachment 629993 [details]
Patch v1

Pointer to Github pull-request
(Assignee)

Updated

6 years ago
Attachment #629993 - Attachment description: Pointer to Github pull request: https://github.com/mozautomation/mozmill/pull/37 → Patch v1
Attachment #629993 - Flags: review?(ctalbert)
(Assignee)

Updated

6 years ago
Attachment #629993 - Flags: review?(ctalbert) → review?(jhammel)

Comment 3

6 years ago
Comment on attachment 629993 [details]
Patch v1

This is probably fine.  Note that since jpeg is lossy compression and png is not, if we're ever doing pixel by pixel comparisons, jpeg will probably not suffice.  We currently do not
Attachment #629993 - Flags: review?(jhammel) → review+
(Assignee)

Comment 4

6 years ago
Comment on attachment 629993 [details]
Patch v1

We never intended to use Mozmill as an image comparison tool. If that's the case in the future we can add an option which allows to specify the type and compression of images.

So I have checked the test and figured that more stuff has to be tested. While implementing those changes the test failed because the current save action leaves the file open and the test can't delete it. So I have changed all to the new NetUtils async copy action which is more safe as the WebBrowserPersist one.

Further I did:
* Renaming the screenShot -> screenshot method
* Make the utils.takeScreenshot() method independent so it doesn't implicitly saves the screenshot to disk. This looked way broken.
Attachment #629993 - Flags: review+ → review?
(Assignee)

Updated

6 years ago
Attachment #629993 - Flags: review? → review?(jhammel)

Comment 5

6 years ago
Comment on attachment 629993 [details]
Patch v1

looks fine
Attachment #629993 - Flags: review?(jhammel) → review+
(Assignee)

Comment 6

6 years ago
Pushed:
https://github.com/mozautomation/mozmill/commit/eefed2195ef72d229c4253680c9e08c176ae5e0e
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
Depends on: 783223
Blocks: 795243
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.