cypress-match-screenshot icon indicating copy to clipboard operation
cypress-match-screenshot copied to clipboard

use latest `cy.screenshot()`

Open RomanHotsiy opened this issue 6 years ago • 7 comments

Hey, nice work here! 👍

FYI, cy.screenshot() has been rewritten from the ground up in the 3.0.0 version of cypress which eliminates the need for sophisticated cropping code here. Check it out:

https://docs.cypress.io/guides/references/changelog.html#3-0-0

RomanHotsiy avatar Jun 18 '18 14:06 RomanHotsiy

Hey, that's great 👏 Will definitely have a look over the weekend and see how much I can simplify things with this :+1:

julianburr avatar Jun 21 '18 23:06 julianburr

just as a heads up: in 3.0.2, the file structure of saved screenshots changed, so cypress-match-screenshot is currently broken in the newest versions of cypress. (documentation is in the progres of being updated, see https://github.com/cypress-io/cypress/issues/2084 ) also, be aware of this bug if you want to implement the new behaviour: https://github.com/cypress-io/cypress/issues/2091

phryneas avatar Jul 03 '18 17:07 phryneas

yeah, sorry, I'm a bit busy atm, so I didn't get to have a look at this yet, but will definitely do as soon as I can :blush:

julianburr avatar Jul 04 '18 02:07 julianburr

no worries, just wanted to spare you some frustration when you get around to it ;)

phryneas avatar Jul 04 '18 06:07 phryneas

hey, I finally got to spend some time on this :smile:

I removed the cropping logic and adjusted the diffing functionality, so that the plugin works again with the latest cypress version (v3.0.2) ... check out v1.0.0 and let me know if there are still any issues :+1: (I don't know if its a breaking change tbh, I just treated it as one to be save 😅)

That being said, the new screenshot functionality in cypress seems to be a bit iffy still. When changing the window size of the test runner, cypress doesn't scale the app window to the defined dimensions, which means diffing will fail ... this was part of the cropping logic that I had in place previously (which was also very fragile), so I'll have to think about how to work around this.

julianburr avatar Jul 15 '18 03:07 julianburr

@julianburr nice! Thanks for your work!

When changing the window size of the test runner, cypress doesn't scale the app window to the defined dimensions, which means diffing will fail

Maybe it makes sense to open an issue in the cypress repo?

RomanHotsiy avatar Jul 15 '18 13:07 RomanHotsiy

cypress gives error unresolved function or method , how can i solve the issue has I have followed all the instructions in usage documentation, thanks in advance

ola5 avatar Sep 17 '18 10:09 ola5