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

Screenshot on a different tab? #105

Closed a-inglese closed 7 years ago

a-inglese commented 7 years ago

Hi there!

I'm performing e2e tests for a webapp that opens a new tab every time I click on a specific link. I have some expected conditions on my new tab, but when some of those fails, the screenshot is taken for the first tab.

I was wondering if there was an option in order to always use the active tab to take screenshots, or if this is indeed a bug. In that case, has someone thought of some workaround?

Thank you all! Regards.

mlison commented 7 years ago

I think that should be possible, if you can get a reference to that new tab/window somehow. You basically need to "register" this new instance into forkedInstances and the reporter will take a screenshot of it (read more about forked browser instances).

This is just a theory - I haven't actually tested this, though.