-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poc/#130 - e2e testing implementation #132
base: master
Are you sure you want to change the base?
Conversation
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.
I think this approach looks fine, and in terms of actually integrating this into our CI/CD workflow - we have a super basic workflow so I think we should be able to add cypress to our tests in GitHub.
Not approving because I want to defer to @gvan12 on some naming stuff, and also because the build preview didn't work for some reason I'm probably not going to have a chance to dig into today.
}); | ||
|
||
describe('[Make Masks] CTAs', () => { | ||
const mapPatternRoutes = { |
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.
I believe the pattern pages should be defined via the CMS. I'm not immediately sure how this could be done, but it would be nice if the pattern tests would update automatically rather than being hard-coded.
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.
Yep, totally!
One option could be checking/getting the href and then asserting that it goes there, but if there's a way to get al the registered page templates in the cms that would be amazing
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.
I'll look more deeply at this later today/tonight - great start on testing and thanks for the work!
getByTestId(landing.sections.afterSignUp.makeMasks[pattern]) | ||
).click(); | ||
|
||
// Adding this for testing on local; as opening /patterns/[xyz] causes the website to crash so the test fails |
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.
You may need to check out the how-to docs for integrating cypress with gatsby here: https://www.gatsbyjs.org/docs/end-to-end-testing/
It may make the test run when navigating to /patterns/[xyz] work correctly.
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.
…ation that we should fix our mobile nav to not be so janky.
I get similar errors when trying to visit the donate page even on master locally. I think there's probably a package dep issue but haven't determined which yet. |
Initial implementation of e2e-testing functionality #130
What's new:
This PR introduces:
cypress
for e2e-testing automationshared
for all things that both the the web app and the tests use. For instance, selectorsThe structure for testing is correctly approached as:
integration
should either be flows, like thedonation flow
, or a concrete route functionality such as/
,/volunteer
... etc.Important things to consider:
If this needs to be added to the CI/CD process we would need to start the dev server with
yarn develop
and while that's started, runyarn cy:test
. Optionally, we can always use contcurrently. Could really use your input here @jcooter as I'm sure you're more familiar than me with DevOps practices 😁Looking forward to hearing your thoughts on this, as there's quite a bit of work to be done for this but it will definitely pay off!