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

Add screenshots in XML and HTML reports #23

Closed
4 tasks done
Galad opened this issue Apr 30, 2018 · 0 comments
Closed
4 tasks done

Add screenshots in XML and HTML reports #23

Galad opened this issue Apr 30, 2018 · 0 comments

Comments

@Galad
Copy link
Owner

Galad commented Apr 30, 2018

Screenshots should be added in the XML and the HTML reports.
For that, we need to extend the current XmlReportingObserver in order to add custom value in the current action (because the ScreenshotInfo class is in the Tranquire.Selenium project).

We can make XmlReportObserver implement the interface IObservable<ActionAttachment> in order to add the ability to add attachment to the each action or question.
Then we can create an adapter to transform the result of IObserver<ScreenshotInfo> into ActionAttachment.

The composition will look like this:

var xmlDocumentReporting = new XmlDocumentObserver();
var directory = Path.Combine(GetTestDirectory(), "Screenshots");
_observer = new SaveScreenshotsToFileOnComplete(directory);
var screenshotObserver = new CompositeObserver<ScreenshotInfo>(
                                              _observer,
                                              new ScreenshotInfoToActionAttachmentObserver(
                                                  directory,
                                                  xmlDocumentReporting
                                              )
                                          );
var actor = new Actor("John")
               .WithReporting(xmlDocumentReporting)
               .TakeScreenshots(screenshotName, screenshotObserver)

Steps:

  • Implement IObservable<ActionAttachment> in XmlDocumentObserver in order to add attachments. in the XML document. Attachments should be a single element attachments containing 0 or many attachment elements. It should have the properties:
    • filepath
    • description
  • Create ScreenshotInfoToActionAttachmentObserver
  • Render screenshots in the HTML report
  • Create CompositeObserver<T>
Galad added a commit that referenced this issue May 8, 2018
Galad added a commit that referenced this issue May 8, 2018
@Galad Galad closed this as completed in 751dbf2 May 9, 2018
@Galad Galad added this to the v0.2.69-alpha milestone May 9, 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

1 participant