wswebcreation / webdriver-image-comparison

MIT License
43 stars 35 forks source link

fix: this fixes issue12 #34

Closed wswebcreation closed 5 years ago

wswebcreation commented 5 years ago

This PR will fix https://github.com/wswebcreation/webdriver-image-comparison/issues/12. I tried to solve it at the core but I got some troubles with the types. I also didn't create 2 extra unit tests for it because of the types.

@Wexx , @treyturner, @MortenGregersen or @anto-ac , any help would be appreciated.

Basically the type can be or HTMLElement[] or[HTMLElement[]] for hide and remove. The problem is that this doesn't work hide: HTMLElement[] | [HTMLElement[]]

To see that it works: https://app.eu-central-1.saucelabs.com/tests/3f810ad330b1465f8da3429c466d3825

I produces this image when I use this test

        fit('should save a fullpage screenshot', () => {
            const tag = 'fullPage';
            const imageData = browser.saveFullPageScreen(tag, { fullPageScrollTimeout: '1500',
            hideElements: [$$('h1')]});
            const filePath = `${ imageData.path }/${ tag }-${ logName }-${ resolution }.png`;

            expect(fileExists(filePath)).toBe(true, `File : "${ filePath }" could not be found`);
        });

fullPage-chrome-latest-1366x768

anto-ac commented 5 years ago

I’m on holiday. Not sue when I could review this one!

wswebcreation commented 5 years ago

Enjoy your holiday!