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

Element screenshot not working #15

Closed
cangoektas opened this issue Jul 17, 2018 · 1 comment
Closed

Element screenshot not working #15

cangoektas opened this issue Jul 17, 2018 · 1 comment

Comments

@cangoektas
Copy link

cangoektas commented Jul 17, 2018

Hey!

First of all, thanks a lot for this project! ❤️ I'm very new to cypress so maybe I missed something but I think element snapshots are broken with the latest version.

I quickly made some changes to the example folder to illustrate what I mean (I can also submit a PR if you like):

With the following element in App.js:

<div
  style={{ display: 'inline-block', backgroundColor: 'orange' }}
  data-cy="foo"
>
  Hello, world!
</div>

and the following test file:

describe('App', () => {
  it('should visit the app', () => {
    cy.visit('http://localhost:3000');

    cy.get("[data-cy='foo']").screenshot();

    cy.get("[data-cy='foo']").matchImageSnapshot();
  });
});

the call to .screenshot() produces this image:

app -- should visit the app

but .matchImageSnapshot() produces this:

should-visit-the-app

Is this intended behavior?

@jackjocross
Copy link
Collaborator

Thanks for bringing this up and providing a clear example! This is definitely not working as intended. I opened #16 to fix the issue, let me know if you run into anything else.

jackjocross added a commit that referenced this issue Jul 17, 2018
Fix matchImageSnapshot command to take screenshot of chained element (closes #15)
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

2 participants