zinserjan / wdio-screenshot

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

WIP: Migration to WebdriverIO 5 #93

Open mjdch opened 5 years ago

mjdch commented 5 years ago

Working properly migration to WebdriverIO version 5.

emilyrohrbough commented 5 years ago

This will be a MVB. Has any of the issues logged been considered for other breaking changes in this tool?

mjdch commented 5 years ago

I am refactoring test now, but there is major issue with that: In old webdriverIO 4 we had browser.setViewportSize() function which setup viewport size of browser so all reference screenshots was valid for tests, now we have browser.setWindowSize() which setups i belive windo size and viewport is different for each browser i.e data from comparison in tests:

[0-0] { isSameDimensions: false, dimensionDifference: { width: 0, height: 19 }, misMatchPercentage: '0.00', analysisTime: 33, getDiffImage: [Function] } [1-0] { isSameDimensions: false, dimensionDifference: { width: 0, height: 14 }, misMatchPercentage: '0.00', analysisTime: 33, getDiffImage: [Function] } [0-0] { isSameDimensions: false, dimensionDifference: { width: 0, height: -1 }, misMatchPercentage: '0.00', analysisTime: 111, getDiffImage: [Function] } 2019-03-26T15:22:31.674Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1 [1-0] { isSameDimensions: false, dimensionDifference: { width: 0, height: -6 }, misMatchPercentage: '0.00', analysisTime: 144, getDiffImage: [Function] }

Check dimension difference, two different browsers for runs for two different viewport dimensions, every time we had different output.

mjdch commented 5 years ago

Update: All unit tests passing on CI tools as well on local, integration test are failing. The only problem now is different implementation/logic in method browser.setVieport (WDIO4) vs browser.setWindowSize() (WDIO5). Will prepare workaround for that, it will extend integration test time a little bit.

The only option is changing windowsize untill we achieve proper viewport.

dpoetzsch commented 4 years ago

I created a port of the old wdio4 browser.setViewport functionality: https://github.com/mondata-dev/wdio-viewport-size, maybe this helps in driving this forward?

What is the state of this PR, do you have a working version for wdio 5?