Skip to content

Sketch: e2e rspec tests #549

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

jeffcatania-usds
Copy link
Contributor

@jeffcatania-usds jeffcatania-usds commented Apr 9, 2025

Ticket

Resolves FFS-2687

TODOS

  • switching the driver to selenium_chrome_headless changed the nature of the puffing billy mocks required to simulate moving through the flow. That will require tweaking so it passes locally and in rspec CI.
  • the help specs need to be rewritten in the VCR/puffing billy format so they can pass as well.
  • the remainder of the e2e flow for pinwheel needs to be fleshed out (generating a pdf, simulating webhooks for all events)
  • for the simulation of webhooks, there might be a way to fake encrypt the message so it can be decrypted by the webhooks controller. at worst case, refactoring so the simulation doesn't drift would be desirable.
  • once the flow is fleshed out for pinwheel, a followup story to do the same for argyle also should happen.

Changes

Context for reviewers

To re-record mocks, flip RECORD_OPTION in app/spec/e2e/cbv_flow_spec.rb to "all" if you need to record a new interaction
to run these tests with record: :all, make sure you have a .env.test.local with PINWHEEL_API_TOKEN_SANDBOX, then you can run this test via running
to run these tests at all, explicitly via rubymine, or RUN_E2E_TESTS=1 bundle exec rspec spec/e2e/cbb_flow_spec.rb.

Acceptance testing

  • No acceptance testing needed
    • This change will not affect the user experience (bugfix, dependency updates, etc.)
  • Acceptance testing prior to merge
    • This change can be verified visually via screenshots attached below or by sending a link to a local development environment to the acceptance tester
    • Acceptance testing should be done by design for visual changes, product for behavior/logic changes, or both for changes that impact both.
  • Acceptance testing after merge
    • This change is hard to test locally, so we'll test it in the demo environment (deployed automatically after merge.)
    • Make sure to notify the team once this PR is merged so we don't inadvertently deploy the unaccepted change to production. (e.g. :alert: Deploy block! @ffs-eng I just merged PR [#123] and will be doing acceptance testing in demo - please don't deploy until I'm finished!)

@jeffcatania-usds jeffcatania-usds changed the title Jeffcatania usds/e2e rspec tests e2e rspec tests Apr 9, 2025
@jeffcatania-usds jeffcatania-usds changed the title e2e rspec tests Sketch: e2e rspec tests Apr 9, 2025
@iannorriscms
Copy link
Contributor

Outstanding work left:

  • switching the driver to selenium_chrome_headless changed the nature of the puffing billy mocks required to simulate moving through the flow. That will require tweaking so it passes locally and in rspec CI.
  • the help specs need to be rewritten in the VCR/puffing billy format so they can pass as well.
  • the remainder of the e2e flow for pinwheel needs to be fleshed out (generating a pdf, simulating webhooks for all events)
  • for the simulation of webhooks, there might be a way to fake encrypt the message so it can be decrypted by the webhooks controller. at worst case, refactoring so the simulation doesn't drift would be desirable.
  • once the flow is fleshed out for pinwheel, a followup story to do the same for argyle also should happen.

iannorriscms and others added 13 commits April 16, 2025 12:27
the e2e folder doesnt run anywhere so TODO but to start cleaning up cbv flow test to actually pass.

shared examples are mostly an antipattern when it comes to debugging, we should DRY another way if we want. that being said, starting with not thinking about internalization seemed like the stronger start here.
this attempts to simulate a full end to end test suite with as much simulation as possible.

two annoying bits of simulation
1) webhooks are not easily simulateable due to the authorization signing key. Debating whether a refactor of webhooks controller or an attempt to better simulate the signing a wiser attempt.
2) puffing billy does not play nice with the fact all the step javascript calls are timestamped. to get around this, we have to be a bit more manual in our puffing billy simulation.
@iannorriswork iannorriswork force-pushed the jeffcatania-usds/e2e-rspec-tests branch from 6b9c3dd to 531e794 Compare April 16, 2025 19:27
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.

2 participants