wswebcreation / protractor-image-comparison

npm-module to compare images with protractor
86 stars 38 forks source link

Weird image rendering #27

Closed knylx1 closed 7 years ago

knylx1 commented 7 years ago

"protractor-image-comparison": "^1.2.5"

I get this result (see image) as my diff file, pretty sure its not intended..

settings:

  browser.protractorImageComparison = new protractorImageComparison({
    autoSaveBaseline: true,
    formatImageName: '{tag}-{browserName}-{width}x{height}-dpr-{dpr}',
    baselineFolder: './test/baseline/',
    screenshotPath: './test/screenshots/',
    disableCSSAnimation: true,
    ignoreAntialiasing: true,
    ignoreColors: true
  });

test:

fdescribe('test', () => {
  beforeEach(() => {
    browser.driver.manage().window().maximize();
    browser.get('https://google.cn'); //compare to https://google.com
  });

  it('should match')', () => {
    expect(browser.protractorImageComparison.checkFullPageScreen('test')).toEqual(0);
  });
});

baseline: test-chrome-1920x1160-dpr-1

diff: test-chrome-1920x1160-dpr-1

wswebcreation commented 7 years ago

Hi there,

I just got 1 question, are the sizes equal (baseline / actual)? Because this happens when baseline actual height / width are not equal to the actual height / width

knylx1 commented 7 years ago

Baseline: 1872x1055 Actual: 1920x1055 Diff: 1872x1055

This is weird, since browser.driver.manage().window().maximize(); should use the same size all the time

wswebcreation commented 7 years ago

For image comparison you need consistency, so would nog suggest this approach.

For now I'm going to close this. If you have other questions / issues feel free to open a new ticket

Grtz wswebcreation

knylx1 commented 7 years ago

I just tested without browser.driver.manage().window().maximize(); and made sure I have a fixed size with browser.driver.manage().window().setSize(800, 600); and its still not working. I tested also without resizing the browser (default behavior) which was working fine on v1.2.4 and still no luck.

wswebcreation commented 7 years ago

Hmm, strange

Can you past the images and sizes in here? Will dive into it tonight

knylx1 commented 7 years ago

Tested on Chrome Version 58.0.3029.96 (64-bit), Windows, protractor-image-comparison v1.2.5 800x600 test:

    browser.driver.manage().window().setSize(800, 600);
    browser.get('https://google.com'); //compare to browser.get('https://google.cn');
    expect(browser.protractorImageComparison.checkFullPageScreen('test')).toEqual(0);

Baseline (true size: 784x539): test-chrome-800x600-dpr-1

Actual (true size: 736x480): test-chrome-800x600-dpr-1

Diff (true size: 736x480): test-chrome-800x600-dpr-1

Default size (worked fine in 1.2.4): test:

    browser.get('https://google.com'); //compare to browser.get('https://google.cn');
    expect(browser.protractorImageComparison.checkFullPageScreen('test')).toEqual(0);

Baseline (true size: 929x1025): test-chrome-945x1140-dpr-1

Actual (true size: 881x1008): test-chrome-945x1140-dpr-1

Diff (true size: 929x1025): test-chrome-945x1140-dpr-1

wswebcreation commented 7 years ago

Hi,

I've tested this and I don't see a "problem". Based on your provided screenshots there is still a difference in the width and height. That is causing the strange difference image.

I will think about something to make this more clear.

knylx1 commented 7 years ago

How should I control that difference, based on what I tried, its related to the update from 1.2.4 to 1.2.5?