wswebcreation / webdriver-image-comparison

MIT License
43 stars 36 forks source link

Error: Unsupported image type #15

Closed JohnRobPeter closed 5 years ago

JohnRobPeter commented 5 years ago

Hi, is the element screen shot supported? I have this error each time I run the element comparison. *Note: it works fine for checkScreen

Config of the automation framework + plugin

plugins: [
        {
            // The module name
            package: 'protractor-image-comparison',
            // Some options, see the docs for more
            options: {
                baselineFolder: path.resolve(process.cwd(), './baseline/'),
                formatImageName: `{tag}-{browserName}-{width}x{height}`,
                screenshotPath: path.resolve(process.cwd(), './screenshots/'),
                savePerInstance: true,
                autoSaveBaseline: true,
                debug: true,
                // ... more options
            },
        },
    ],

Describe the bug AssertionError: expected promise to be fulfilled but it was rejected with 'Error: Unsupported image type' and the saved images is only 3bytes in size that is only header in there

To Reproduce

expect(await browser.imageComparison.checkElement(element(by.xpath('.//logo')), sourceName, { /* some options*/ })).toEqual(0)

Expected behavior An image should be saved the same way it is for checkScreen

Log Though the debug is enabled no real logs are shown in the console for this plugin

wswebcreation commented 5 years ago

Hi @JohnRobPeter

Thanks for filing an issue, can you please provide your complete config with the capabilities. Then I can debug it for you

stale[bot] commented 5 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.