wswebcreation / webdriver-image-comparison

MIT License
43 stars 36 forks source link

How to test multiple viewports? #51

Closed LukeLeber closed 4 years ago

LukeLeber commented 4 years ago

I think that a suggested / recommended strategy for testing multiple viewports should be documented.

For example, are individual tests required to explicitly set the viewport dimensions prior to capturing a screenshot, or is there a more global option available that can assist in setting up global viewport dimensions?

Great job on this by the way!

wswebcreation commented 4 years ago

Hi @LukeLeber

Thanks for filing an issue and asking for some more explanation. What this specific module does (and also the modules that use this comparison core) is take a screenshot of the current state of the screen/device. This means that if you want to take screenshots of different viewports, you need to adjust this before a screenshot is taken, meaning not by this module.

I also don't know where this should be documented because this module is only a core to do the comparison. Do you have a suggestion?

LukeLeber commented 4 years ago

Hi, I originally found this project via a blog post (https://webdriver.io/blog/2019/05/18/visual-regression-for-v5.html). I'm thinking that any recommendations might make more sense to add to https://github.com/wswebcreation/wdio-image-comparison-service instead of this repository.

Perhaps the documentation for this repository could include a short blurb explaining the scope of what the core functionality covers. I think that your quote above sums it up very nicely.

...if you want to take screenshots of different viewports, you need to adjust this before a screenshot is taken, meaning not by this module.

wswebcreation commented 4 years ago

OK, thanks. I'll add that on my todo list

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.