-
Notifications
You must be signed in to change notification settings - Fork 0
test(STADTPULS-622): add basic Cypress testing #261
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/technologiestiftung/stadtpuls-frontend/5DAcRA7fHBHyMorxgXYrndUEqwgt |
Awesome. Love it. Is it mandatory that the cypress files are called _spec? I would vote for .test as well. What do you think? |
You need to make sure jest ignores the cypress folder |
Yep, Jest already doesn't care about it |
Trying to avoid to build steps
We don't need this build because we later build the project anyway via cypress-io/github-action@v2, in preparation for the integration tests. Should that build fail, we have a failing CI run as well.
@ff6347, I added the Cypress tests to a I also suspect that soon we'll have integration tests that need a lot of time, specifically the ones that access pages with long loading times such as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition @dnsos
I actually use `*ByRole` intentionally since this way we test against the accessibility tree and not just for users who access Stadtpuls visually. I'm aware that we are far from being accessibility-friendly, but it's good to approach this direction. Btw, this is the [recommended query priority by Testing Library itself](https://testing-library.com/docs/queries/about#priority).
Ah. Okay. Cool. Didn’t know that.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great additions indeed! Well done!
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This PR adds Cypress for integration testing. This includes the configuration of TypeScript and ESLint to work with Cypress.
Some basic test stubs were added as examples.
This article may be a good resource to start with testing
canvas
elements for our maps. EDIT: The article suggests usingcypress-plugin-snapshots
which may be an unmaintained project.