Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to test maps but have uggly cut offs. #212

Closed
tester-at-bmi opened this issue Mar 15, 2024 · 1 comment
Closed

Trying to test maps but have uggly cut offs. #212

tester-at-bmi opened this issue Mar 15, 2024 · 1 comment

Comments

@tester-at-bmi
Copy link

tester-at-bmi commented Mar 15, 2024

So i'm trying to test and make a screenshot of the map as shown below.

image

I have the following config:

const config = {
    ROOT_DIR: 'src/tests/e2e/cypress/test-results',
    CYPRESS_SCREENSHOT_OPTIONS: {
        capture: 'fullPage'
    }
};

module.exports = config;

The result of the screenshot/comparison as follows

image

Test case:

it('Snapshot', () => {
  cy.scrollTo('bottom');
  cy.get('div[data-testid="entities-map"]')
    .should('be.visible')
    .then(() => {
      cy.wait(1000);
      cy.get('div[data-testid="entities-map"]').compareSnapshot({
         name: 'map',
	 testThreshold: 0.2,
      });
   });
});
image-diff-test.mp4

Does anyone has a clue why this is happening and if this somehow can be sorted?

edit: So the screenshot functionality always seems to make a screenshort of the viewport above the fold. Even when you want to take a screenshot of a page that have been scrolled down.

@tester-at-bmi
Copy link
Author

I found a solution for my problem and now it seems to be working as expected and would leave it here if more people walk into this.

cypress-io/cypress#2681 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant