Replies: 2 comments 5 replies
-
You can pass a file name to
Bit puzzled on your approach here. The snapshot that is checked in is how it should look. In my experience the snapshot images should be reviewed as part of the change request, and this serves as a referece to other engineers how it should look Then any failures are scrutinised |
Beta Was this translation helpful? Give feedback.
-
I would also recommend against this. As seen in the Cypress best practices document you should avoid writing unit style tests. In specs that I work on it's common to have multiple calls to
Combining |
Beta Was this translation helpful? Give feedback.
-
Hi,
we are using snapshots a lot as we have an interactive canvas based chart. We currently have round about 50 snapshot images that we test.
It gets increasingly difficult to manage that in comparison to unit or e2e tests so I wanted to ask if others have developed some best practices maintaining a bigger number of snapshots.
Here are a couple it issues and how we solved them
it
block.#XY
to the describe and it block to have an ordered list of images in the snapshots directory. This has the downside that when inserting new tests, we have to rename the others to keep the numberingit('should highlight the temperature curve in blue when hovered over the second item and hide the pressure curve')
. This is very verbose but we couldn't find a better way. This is also used to identify the should behavior when a new feature breaks all existing tests and we need to re-evaulate if it is breaking because of a regression bug or because it is supposed to be changed due to the new feature.I would appreciate some insights on how other are dealing with that.
Beta Was this translation helpful? Give feedback.
All reactions