mlison / protractor-jasmine2-screenshot-reporter

Protractor screenshot reporter for Jasmine2
https://www.npmjs.com/package/protractor-jasmine2-screenshot-reporter
MIT License
81 stars 79 forks source link

Client Logging Data Available in Report #60

Open mattc41190 opened 8 years ago

mattc41190 commented 8 years ago

I'm not sure if this is the right place to put this, and more over, I am unsure if this is something that belongs within the scope of this project, but it is something I would find useful and something I am sure others would find useful as well.

I would like to be able to see the narrative of steps taken in a particular test case, similar to the way RobotFramework reports show it, I have looked briefly into the way you get data in your reporter. Specifically using Jasmine's baked in result object that has access only to the following properties.

result = {
      id: this.id,
      description: this.description,
      fullName: this.getFullName(),
      failedExpectations: [],
      passedExpectations: [],
      pendingReason: ''
    }; 

This is useful, but for selenium reporting there is a lot more involved than simple expectations i.e. A shit ton of navigation and configuration. If you added a "client" logger in the capabilities object you have access to logs that look like:

Executing: [add cookie: hp=990f61ff-6005-4522-8b97-080773dedd2c; path=/])
Done: [add cookie: hp=990f61ff-6005-4522-8b97-080773dedd2c; path=/]
Executing: [set window size])
Done: [set window size]

What I would like is a way to have access to loggers that were declared in the capabilities object.

I have jimmy rigged your framework to send my desired data to your reporter, but I was wondering what your thoughts on this were and if you had any plans on going in this direction.

mlison commented 8 years ago

It doesn't sound like a bad idea at a first glance, looks like useful information when debugging the test (although as a personal preference it probably wouldn't be my first pick). I'll have to look into these loggers first and see if / what would be a sensible way to incorporate them into the reporting mechanism.