Skip to content

Enhancement/update critical flows with e2e test coverage #87

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

Merged

Conversation

MaxwellGarceau
Copy link
Collaborator

@MaxwellGarceau MaxwellGarceau commented Dec 23, 2024

Description of the Change

Update E2E Cypress tests to cover all critical testing flows.

Enhancement/add mailchimp api client - #99

  • Add a FE Mailchimp client to Cypress tests to verify Mailchimp account interactions. Ensures successful form submission and full integration testing.
  • Use .env.test for env variables
  • Add health check for tests if Mailchimp client is unable to make requests
  • Modularize Cypress commands

‼️ Environment changes needed ‼️

  • Need to generate an API key for the test Mailchimp user in the CI/CD pipeline.
  • Need to attach that API key to CYPRESS_MAILCHIMP_API_KEY as a Github secret
  • Need to attach the server prefix to CYPRESS_MAILCHIMP_API_SERVER_PREFIX as a Github secret

Closes #61
Closes #86

How to test the Change

Follow the E2E testing instructions in the readme to run the Cypress tests. In addition, these tests should run automatically as part of the projects CI/CD flow.

Changelog Entry

Added - New tests to cover E2E critical flows
Changed - Existing tests to more robustly cover E2E critical flows. Modularized reusable testing code.

Credits

Props @MaxwellGarceau

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Sorry, something went wrong.

max and others added 9 commits December 21, 2024 12:37

Verified

This commit was signed with the committer’s verified signature.
v1v Victor Martinez

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Allow settings.test.js (and other test files) to be run independently of connect.test.js. This fixes an error where test cases would fail due to the user not being logged into their Mailchimp account.
@github-actions github-actions bot added this to the 1.7.0 milestone Dec 23, 2024
Highlights
- Add a FE Mailchimp client to Cypress tests to verify Mailchimp account interactions. Ensures successful form submission and full integration testing.
- Use .env.test for env variables
- Add health check for tests if Mailchimp client is unable to make requests
- Modularize Cypress commands

‼️ Environment changes needed ‼️
- Need to generate an API key for the test Mailchimp user in the CI/CD pipeline.
- Need to attach that API key to CYPRESS_MAILCHIMP_API_KEY as a Github secret
- Need to attach the server prefix to CYPRESS_MAILCHIMP_API_SERVER_PREFIX as a Github secret

Commits

* Add Mailchimp API package

* Add cypress-dotenv

* Add Mailchimp API client to Cypress

Necessary to interact with the test user account to verify contacts, make deletions, etc.

* Update documentation for env setup

* Remove outdated E2E notes

* Remove log to fix bug. Skip unfinished tests.

* Remove outdated readme note

* Add test to verify lists in WP admin match lists in Mailchimp account

* Add assertion that contacts in Mailchimp account match email submitted

* Simplify mailchimp commands

* Add mailchimp commands to command folder

* Organize commands into modular files

* Rename mailchimpApiConfig to more clearly state purpose

* Fix grammar mistake

* Add scaffolding for gmail api

* Switch to gabi-script for FE requests

* Update .env.test.sample with example of google creds

* Remove gmail api client

Too complicated to set up for our purposes. We're better off with Mailhog

* Remove gapi-script
Caused an error that caused session data to malfunction and fail every other test next in the cycle
MaxwellGarceau and others added 4 commits January 22, 2025 20:45
Co-authored-by: Darin Kotter <[email protected]>
Co-authored-by: Darin Kotter <[email protected]>
Co-authored-by: Darin Kotter <[email protected]>
Co-authored-by: Darin Kotter <[email protected]>
@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Jan 28, 2025
@MaxwellGarceau
Copy link
Collaborator Author

Quick note regarding merge conflicts on this ticket. I recommend waiting until the rest of the open PRs are merged into develop before addressing the merge conflicts on this ticket to avoid having to fix small merge conflicts more than once.

Since the changes are almost entirely within the Cypress E2E test suite I estimate that there will only be small conflicts.

CC: @vikrampm1 @iamdharmesh

…ment/update-critical-flows-with-e2e-test-coverage
@github-actions github-actions bot removed the needs:refresh This requires a refreshed PR to resolve. label Feb 25, 2025
@iamdharmesh
Copy link
Collaborator

@dkotter This is ready for the next steps.

image

Notes:

  • A few tests are skipped due to blocked functionality.
  • E2E tests are failing in the GH action due to 2FA being enabled on our account. We need to configure a different account to make this work.

Thanks
cc: @vikrampm1

@iamdharmesh iamdharmesh self-assigned this Feb 27, 2025
@iamdharmesh iamdharmesh requested a review from dkotter February 27, 2025 10:17
@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Apr 7, 2025
…ment/update-critical-flows-with-e2e-test-coverage
@github-actions github-actions bot removed the needs:refresh This requires a refreshed PR to resolve. label Apr 7, 2025
@vikrampm1 vikrampm1 merged commit a491ad1 into develop Apr 7, 2025
7 of 10 checks passed
@vikrampm1 vikrampm1 mentioned this pull request Apr 7, 2025
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
4 participants