Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Geb html/screenshots in test report #464

Closed
eaglet3d opened this issue Jan 7, 2017 · 5 comments
Closed

Integrate Geb html/screenshots in test report #464

eaglet3d opened this issue Jan 7, 2017 · 5 comments

Comments

@eaglet3d
Copy link

eaglet3d commented Jan 7, 2017

Problem

When running Geb tests from Jenkins, it is difficult to get to snapshots generated by the geb reporting mechanism. The Jenkins HTML publisher plugin is not able to publish a list of report artifact files (i.e. snapshots and page source files). It would be useful if the artifact files were accessible from the geb reports pages.

POC

As a workaround, I have created a reports artifact gradle task (reportSnaps) that creates a reportArtifacts.html by parsing the build/reports directory and creating links to the report artifact files. You can see an example of the additional report generated by clicking on the reportsArtifact tab in this Jenkins build that uses the HTML publisher plugin or just click on this direct link to the reportsArtifacts.html.

Suggested Contribution

I would like to implement a similar page of reportArtifacts that is linked to by the Geb reports. The page would have the same look-and-feel as the Geb reports page.

Benefit

The added Geb report page would allow easy access to screenshots and html source files right from the Geb reports page.

@erdi
Copy link
Member

erdi commented Jan 7, 2017

Thanks for your suggestion, @eaglet3d.

It looks like you have it implemented as part of your Gradle build so it seems like a good candidate for extracting into a Gradle plugin. Thanks to Gradle Plugin Portal in connection with GitHub it's now fairly simple to open source Gradle plugins and make them easily available to wider audience.

While I'd be very happy to mention your plugin in the manual so that it's better discoverable for Geb users, I'd rather not pull it into core codebase as there is nothing stopping it from being totally independent and it could incur a future maintenance burden on me, especially as I don't fully understand your requirements.

Hopefully my suggestion works for you. Looking forward to hearing what you think about it.

@erdi
Copy link
Member

erdi commented Jan 7, 2017

I'm not a Jenkins user myself, but maybe the solution mentioned in #184 would make your plugin unnecessary?

@eaglet3d
Copy link
Author

eaglet3d commented Jan 7, 2017

Hi @erdi,

I took a look at #184. The feature works by registering a listener on the reporter that gets notified when a report is taken. An extension would then need to be written that provides a reports artifacts page. If the Geb Report included all of the files that it creates in the html report page, then a separate plugin or extension would not be necessary.

My point is that Geb generates screenshots and html files automatically. However, one has to have access to the folder of these files in order to access them. Enterprise systems run Jenkins either in Docker containers or virtual machines. Access to the file system on the Jenkins machine would require special permissions that an Enterprise would not want to grant to the entire automation team. It would be helpful to have Geb's report include links to all of the report files that it generates (i.e. screenshots and html files) so that anyone hitting the Geb reports page could still access those files.

Let me know if you have any questions about these requirements.

With your guidance, I'd be glad to take ownership of implementing and maintaining this additional reports feature.

@erdi
Copy link
Member

erdi commented Jan 8, 2017

I took a look at #184. The feature works by registering a listener on the reporter that gets notified when a report is taken. An extension would then need to be written that provides a reports artifacts page.

Why would an extension be needed? Would it not be necessary anymore if you used the feature mentioned in #184 together with Jenkin's JUnit Attachments Plugin? Maybe I'm missing something here...

It would be helpful to have Geb's report include links to all of the report files that it generates (i.e. screenshots and html files) so that anyone hitting the Geb reports page could still access those files.

While I agree I also don't believe that it should be added to core. There is a couple of reasons:

  • IMHO, generation of such summary report is a build concern and not a browser automation toolkit concern,
  • Geb lacks the lifecycle necessary to start collecting all the reports written and then write the report linking to all the other reports (Geb has no concept of a "run")

So if there is still a reason why linking from each test to it's reports using JUnit Attachments Plugin is not sufficient for you then I'd suggest creating a Gradle plugin that does what you are proposing as suggested before.

@erdi
Copy link
Member

erdi commented Jun 13, 2018

Closing due to no response to my last comment from the OP, @eaglet3d. Please feel free to reopen and/or comment if you wish to continue discussing this.

@erdi erdi closed this as completed Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants