Functional Test: Desktop - Crowdsourcing Form Submission for Bathroom Site
Is your feature request related to a problem? Please describe. As a PHLASK developer, I would like to have automated testing of form submissions for Bathroom sites so that this functionality works consistently throughout any future site development.
Describe the solution you'd like
- Add a Cypress test that performs the following actions in
cypress/e2e/desktop/crowdsourcing.cy.js- Click on the "Add Site" button on the bottom toolbar
- Select the "Bathrooms" option
- Fill out the form, making sure to fill out all pages of the form
- Does NOT click the "Submit" button (to avoid adding junk data to our database)
- If necessary, add
data-cyattributes to resources in order to allow Cypress to target them for clicking/writing/etc.- For an example of how to target elements, see the the
should successfully submit a water site for testingtest in thecypress/e2e/desktop/crowdsourcing.cy.jsfile. - For an example of how components are updated to support the example above, see line 27 of the
src/components/AddResourceModal/ChooseResource.jsxfile.
- For an example of how to target elements, see the the
- When opening a Pull Request for this story, make sure to include a video recording of the completed test to help reviewers.
- When you run tests locally, a video of the test should automatically be recorded in the
cypress/videosfolder.
- When you run tests locally, a video of the test should automatically be recorded in the
Describe alternatives you've considered N/A
Additional context Add any other context or screenshots about the feature request here.
@gcardonag are we asserting anything for this test?
In a sense, we're asserting that the form can be completed by reaching the end state where all pages of the form are interacted with and all relevant data fields can have text input for them.
That said, a stretch goal we could apply to this test is to somehow have our "yarn start:cypress" command change our submission process to load data into a local file instead of Supabase. Then we could validate that the inputs during the test process were properly captured after the "Submit" button is clicked.