Skip to content
This repository was archived by the owner on Dec 24, 2023. It is now read-only.
This repository was archived by the owner on Dec 24, 2023. It is now read-only.

checkFullPageScreen method is not calculate correctly the scroll height #22

@amolinaalvarez

Description

@amolinaalvarez

Environment:

  • Node.js version: 8.12.0
  • NPM version: 6.4.1
  • Browser name and version: Chrome 72.0.3626.96
  • Platform name and version: Ubuntu 16.04
  • Framework name and version: Protractor 5.4.2
  • Plugin name and version: protractor-image-comparison 3.2.0
  • webdriver-image-comparison version: 0.5.0

Config of the automation framework + plugin
here a basic example of how my conf.js looks like:

exports.config = {
   framework: 'jasmine',
   multiCapabilities: env.multiCapabilities,
   baseUrl: env.baseUrl,
   specs: [
     'image-comparator.spec.js',
   ],
   SELENIUM_PROMISE_MANAGER: false,
   directConnect: true,
}

Describe the bug
Using the checkFullPageScreen method with a dialog which blocks the browser's scroll, I am getting a weird behavior as the way of calculating the scroll height is not working well.

To Reproduce
I created this simple example: https://angular-5sbdat.stackblitz.io/

and this is basic my test:

describe('compare example screen', () => {
  beforeEach(async () => {
    await browser.waitForAngularEnabled(false);
    await browser.get("https://angular-5sbdat.stackblitz.io/");
  });

  it('should compare login page with a baseline', async () => {
    await browser.sleep(3000);
    await element.all(by.css('button')).get(0).click();
    expect(await browser.imageComparison.checkFullPageScreen('test')).toEqual(0);
  });
});

Using the version 0.4.8 I am getting this result (the desired one):
test2--1855x1056

However using the version 0.5.0:
test--1855x1056

As you can see, using the version 0.5.0 checkFullPageScreen method is scrolling down but it does not make sense because the scroll is blocked by the dialog.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions