Skip to content
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

Refactored form tester page hooks to support post-hooks #13740

Merged
merged 8 commits into from Aug 10, 2020

Conversation

U-DON
Copy link
Contributor

@U-DON U-DON commented Aug 5, 2020

Description

Background

Previously, page hooks would cause the secondary aXe check on pages to run at the wrong time.

Since page hooks needed to explicitly click the "Continue" button to move to the next page, and that secondary aXe check was set to automatically run after page hooks, the check would incorrectly run on the next page.

Solution

This refactor fixes that bug, but also reduces the amount of boilerplate needed in page hooks and allows for a way to override the default behavior.

  • The aXe checks will still automatically run, but the "Continue" button will also automatically be clicked, so that should no longer be included in page hooks.
  • To override that automatic click, there willl now be a context object provided as the first argument to page hooks. It contains an afterHook helper function that takes a function and runs that instead of the default behavior of clicking "Continue".
  • Docs have been updated (with examples) to explain how to use the override.

Testing done

Tests are still passing. Observed the Cypress test runner log to verify that aXe checks are happening in the right place.

Acceptance criteria

  • The form tester should run an aXe check at the beginning and end of processing a form page.
  • The form tester should provide helpful default behavior for processing a form page and also a mechanism to override the defaults.

Definition of done

  • Events are logged appropriately
  • Documentation has been updated, if applicable
  • A link has been provided to the originating GitHub issue (or connected to it via ZenHub)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs

@va-vfs-bot va-vfs-bot temporarily deployed to master/form-tester-posthook-refactor August 5, 2020 21:26 Inactive
@U-DON U-DON marked this pull request as ready for review August 5, 2020 21:37
@U-DON U-DON requested review from a team August 5, 2020 21:37
@U-DON U-DON requested review from a team as code owners August 5, 2020 21:37
@va-vfs-bot va-vfs-bot temporarily deployed to master/form-tester-posthook-refactor August 5, 2020 22:08 Inactive
Copy link
Contributor

@Mottie Mottie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@va-vfs-bot va-vfs-bot temporarily deployed to master/form-tester-posthook-refactor August 6, 2020 01:29 Inactive
@U-DON
Copy link
Contributor Author

U-DON commented Aug 7, 2020

Could I get reviews from the following? 🙏

  • @department-of-veterans-affairs/vsa-ebenefits-frontend
  • @department-of-veterans-affairs/vsa-bam-2-frontend
  • @department-of-veterans-affairs/vsa-caregiver-frontend

It should be quick; the changes to your tests are minimal.


// Check the privacy agreement box if it exists.
if (!pathname.endsWith('/confirmation')) {
cy.location('pathname', NO_LOG_OPTION)
Copy link
Contributor Author

@U-DON U-DON Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible the submission timeout could still happen, but it's rare. Going to keep on eye on tests and re-introduce the extended timeout if it reappears.

@U-DON U-DON mentioned this pull request Aug 7, 2020
5 tasks
Copy link
Contributor

@Clark-W-Griswold Clark-W-Griswold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@U-DON U-DON merged commit 96cced6 into master Aug 10, 2020
@U-DON U-DON deleted the form-tester-posthook-refactor branch August 10, 2020 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants