meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
489 stars 117 forks source link

Functionality of the plugin #206

Open juancoan opened 2 years ago

juancoan commented 2 years ago

hi Meinaart How are you? I hope doing well.

I wanted to contact you in regards to this plugin. I think it is great. However, I am not sure exactly if I understood the funcitonality. When I execute the code, I see it passes... but when check the results, that's where I am confused. This plug in is to get text from an HTML tag for example body and save it as an screenshot? or does it actually compares the taken screenshot to another one? for example when I see the test where is extracts content from the body html tag from "[data-test=test]" and then you call the .toMatchSnapshot() function. So what does it do? Does it only take an screenshot of the page? Or does it take the scrreenshot and then compares it to another thing? it('toMatchSnapshot - html', () => { cy.visit('/static/stub.html') .then(() => { cy.get('[data-test=test]').toMatchSnapshot(); }); });

I need to validate an scenario like this: Site A is being migrated to Site B Will this plugin work in a scenario where I take a text extract of a page on Site A and then compare it to that extract on page B?

Sorry to have opened an issue, but that's the only method I found to communicate with you... @meinaart