wswebcreation / webdriver-image-comparison

MIT License
43 stars 36 forks source link

Is it possible to remove warning message on console? #46

Closed WarleyGabriel closed 4 years ago

WarleyGabriel commented 4 years ago

Hi,

I would like to know if it is possible to not have the console log:

#####################################################################################
 WARNING:
 There was a difference. Saved the difference to
 /home/chk_user/code/test-report/screenshots/diff/desktop_chrome/dois-campos-adicionais-nao-informados-cadastro-de-usuario--1919x1079.png
#####################################################################################

I created a method to validate the image, and try it again with WebdriverIO waitUntil. So, I don't need the console log on my screen.

visualRegressionElement(element, arquivo) {
        element.waitForDisplayed();
        element.scrollIntoView();
        browser.waitForDisplayedInViewport(element);
        browser.waitUntil(
            () => {
                const diff = browser.checkElement(element, arquivo);
                return diff < 0.15;
            },
            null,
            `Elemento com seletor: '${element.selector}' não está conforme imagem de referência: ${arquivo}`,
        );
    },
wswebcreation commented 4 years ago

Hi @WarleyGabriel

Thanks for submitting an issue. Just to give you some insights:

Grtz

WarleyGabriel commented 4 years ago

Hi @wswebcreation

Thanks for answered.

What do you think about save the log in file, with the wdio logs? Maybe we can use the outputDir from wdio.

Or, print the logs only when debug param is true?

wswebcreation commented 4 years ago

Thanks for the PR, I've release https://github.com/wswebcreation/webdriver-image-comparison/releases/tag/v0.11.0 and will release a new version of wdio-image-comparison-service in a few minutes

WarleyGabriel commented 4 years ago

@wswebcreation Thank you! 👍