zinserjan / wdio-screenshot

A WebdriverIO plugin. Additional commands for taking screenshots with WebdriverIO.
MIT License
109 stars 43 forks source link

Adding support for Android devices #79

Open jcneally opened 7 years ago

jcneally commented 7 years ago

Background

wdio-screenshot currently supports iOS devices but it doesn't seem like a big jump to also start supporting Android as well. This adds image normalizing support for android devices as well.

Note: I was only able to test this on Android Simulator for 4.4 and 5.1 through SauceLabs and it was working fine for me. It's possible that other versions may not be supported, but limited is better than nothing :man_shrugging:

Changes

zinserjan commented 7 years ago

Awesome! Thanks for working on this.

wdio-screenshot currently supports iOS devices but it doesn't seem like a big jump to also start supporting Android as well. This adds image normalizing support for android devices as well.

Android devices are already supported ;) Android devices with chrome (which is default since 4.4) don't need any further changes in wdio-screenshot. That's why we need to make sure that this PR doesn't break them.

May need some help since the blank screenshots in the repo were a bit confusing

The blank or very yellow screenshots are just some simple screenshots to test the cropping. I used just a single background color to avoid any cropping mistakes due to antialiasing or other possible error sources. I'm not even sure if this could happen and just wanted to eliminate this kind of error...

jcneally commented 7 years ago

Thanks for following up! Wasn't sure if I would get a response 😄

Android devices are already supported ;) Android devices with chrome (which is default since 4.4) don't need any further changes in wdio-screenshot. That's why we need to make sure that this PR doesn't break them.

Hmm, what kind of android support exists already? I do testing through Saucelabs Simulator/Emulator, and this didn't work out of the box. The header on android gets stitched onto each screenshot and looks quite a mess. Perhaps this isn't an issue for real devices? But happens on emulator and it's unusable.

zinserjan commented 7 years ago

Hmm, what kind of android support exists already?

Every android with chrome should work in theory. We tried some Nexus & Samsung devices.

But I think that simulators never have chrome, just the old android browser. Give the real devices from saucelabs a try ;)