Just with Chrome. I'm working on transitioning regression scripts from
Selenium, so I really only need one browser. A teammate is helping
investigate running it on my company's SauceLabs instance. If that pans
out, I'll try throwing a few other browsers at it and see how AShot works.

On Thu, Dec 10, 2020, 8:58 PM Alexander Kriegisch <[email protected]>
wrote:

> Ben, this would be a great addition to a hypothetical Geb FAQ or
> knowledge base. I remember that 1-2 years ago I played around with AShot
> for half a day or so in order to answer a similar question, maybe on
> StackOverflow, I do not quite remember. But I seem to recall that I had
> some cross-browser issues with AShot. How broadly did you test your
> reporter in that regard? Just being curious.
>
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Ben Frey schrieb am 10.12.2020 22:07 (GMT +07:00):
> >
> > I can't create a gist on GitHub from work, so I'll have to share the code
> > here, which totally borks formatting; sorry in advance.
> >
> >
> > class ScreenshotReporter extends ReporterSupport implements Reporter {
> > private def aShot = new AShot()
> >
> > @Override
> > void writeReport(ReportState reportState) {
> > def screenshot =
> > aShot.shootingStrategy(ShootingStrategies.viewportPasting(100))
> > .takeScreenshot(reportState.browser.driver)
> >
> > def outputStream = new ByteArrayOutputStream()
> > ImageIO.write(screenshot.getImage(), 'png', outputStream)
> >
> > saveScreenshotPngBytes(reportState.outputDir, reportState.label,
> > outputStream.toByteArray())
> > }
> >
> > @Override
> > void addListener(ReportingListener listener) {
> > // No need to have listeners
> > }
> >
> > protected void saveScreenshotPngBytes(File outputDir, String label,
> byte[]
> > bytes) {
> > def file = getFile(outputDir, label, 'png')
> > file.withOutputStream { it << bytes }
> > }
> > }
> >
> >
> > On Thursday, December 10, 2020 at 9:42:16 AM UTC-5 jc wrote:
> >
> >> Hey Ben,
> >> I'd be interested to see how you implemented this if you would be
> willing
> >> to share some of the code?
> >>
> >>
> >> On Thursday, December 10, 2020 at 8:38:16 AM UTC-6 Ben Frey wrote:
> >>
> >>> Ahh, apparently it's as easy as adding a line to GebConfig.groovy:
> >>> reporter = new ScreenshotReporter()
> >>>
> >>>
> >>> On Thursday, December 10, 2020 at 8:16:45 AM UTC-5 Ben Frey wrote:
> >>>
> >>>> Alright, I think I can figure out how to implement the Reporter
> >>>> interface, but I don't know how to register that reporter with the
> >>>> browser/driver so that the report command uses that Reporter. How is
> >>>> that done?
> >>>>
> >>>>
> >>>> On Wednesday, December 9, 2020 at 4:04:21 PM UTC-5 Ben Frey wrote:
> >>>>
> >>>>> Thanks, I'll see if AShot is an option.
> >>>>>
> >>>>>
> >>>>> On Wednesday, December 9, 2020 at 4:00:08 PM UTC-5
> >>>>> [email protected] wrote:
> >>>>>
> >>>>>>
> >>>>>> I believe this is WebDriver implementation specific. I know that
> >>>>>> Firefox, at least at some point in the past, would take screenshots
> >>>>>> of the whole page and not just the viewport and that's what would
> end
> >>>>>> up in Geb reports when using Firefox as the browser. If you would
> >>>>>> like a cross browser solution for that then you need to write a
> >>>>>> custom reporter which would employ something like
> >>>>>> AShot(https://github.com/pazone/ashot). This section
> >>>>>> of their docs might be helpful:
> >>>>>> https://github.com/pazone/ashot#capturing-the-entire-page.
> >>>>>>
> >>>>>>
> >>>>>> On Wed, Dec 9, 2020 at 2:22 PM Ben Frey <[email protected]>
> wrote:
> >>>>>>
> >>>>>>
> >>>>>>> Currently, when using the default reporter, the report command
> >>>>>>> results in a screenshot of the current viewport. Is there a way to
> >>>>>>> capture the entire rendered page without manual scrolling?
> >>>>>>
> >>>>>>
> >>>>>>> --
> >>>>>>> You received this message because you are subscribed to the Google
> >>>>>>> Groups "Geb User Mailing List" group.
> >>>>>>> To unsubscribe from this group and stop receiving emails from it,
> >>>>>>> send an email to [email protected].
> >>>>>>> To view this discussion on the web visit
> >>>>>>>
> https://groups.google.com/d/msgid/geb-user/a303727c-5c40-448d-b194-579feaf4a436n%40googlegroups.com
> >>>>>>> <
> https://groups.google.com/d/msgid/geb-user/a303727c-5c40-448d-b194-579feaf4a436n%40googlegroups.com?utm_medium=email&utm_source=footer
> >
> >>>>>>> .
> >>>>>>
> >>>>>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Geb User Mailing List" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to [email protected]
> > <mailto:[email protected]> .
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/geb-user/1ca8028d-d2d6-4551-9b7e-fea95c434397n%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/geb-user/1ca8028d-d2d6-4551-9b7e-fea95c434397n%40googlegroups.com?utm_medium=email&utm_source=footer
> >
> > .
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Geb User Mailing List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/geb-user/HHcecs4twpw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/20201211015837.AAB5E3380730%40dd39516.kasserver.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CAG7nOphz8GjSKC%3DAzohN3cqL7Ydq-3V2RheWnGvxBFmLX3uxAQ%40mail.gmail.com.

Reply via email to