toast-alerts popping up due to unrelated error can break e2e tests #98
Labels
bug:test
Defect causing our test suite to fail, although no functional error is occurring.
_flag:stale
[BOT ONLY] Flag issue that hasn't been updated in a while and needs to be triaged again
type:bug
Defects in shipped code and fixes for those defects
This is a bit of an odd one that points to a bigger problem with the tests:
If I run an e2e test like https://github.com/neurobagel/query-tool/blob/c890a4a5a2c221993b8240ff106b44847df4ba2c/cypress/e2e/Alert.cy.ts
and don't mock all the required remote data (as we currently do), and some of the required remote data fails (e.g. is unavailable or in the wrong form), then I will get the pretty error toasts like so:
If they happen to cover up an element that I expect to be able to interact with, then cypress will cleverly error out.
That's the fyi part. The "what now" part is: we should not rely on any running remote API being available to ensure our e2e tests pass. We don't yet have any real cross-app integration e2e tests. And changing the response model like we do in #60 is a good example where this reliance on a production API really comes to bite us.
So the short answer is: no more requests to prod APIs in e2e tests. Short term: mock it all. Longer term: have a dedicated test stack of all the services our app requires to talk to
The text was updated successfully, but these errors were encountered: