phlask-map icon indicating copy to clipboard operation
phlask-map copied to clipboard

Functional Test: Desktop - Crowdsourcing Form Submission for Bathroom Site

Open gcardonag opened this issue 1 year ago • 2 comments

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

  1. Add a Cypress test that performs the following actions in cypress/e2e/desktop/crowdsourcing.cy.js
    1. Click on the "Add Site" button on the bottom toolbar
    2. Select the "Bathrooms" option
    3. Fill out the form, making sure to fill out all pages of the form
    4. Does NOT click the "Submit" button (to avoid adding junk data to our database)
  2. If necessary, add data-cy attributes 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 testing test in the cypress/e2e/desktop/crowdsourcing.cy.js file.
    • For an example of how components are updated to support the example above, see line 27 of the src/components/AddResourceModal/ChooseResource.jsx file.
  3. 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/videos folder.

Describe alternatives you've considered N/A

Additional context Add any other context or screenshots about the feature request here.

gcardonag avatar Jul 08 '24 19:07 gcardonag

@gcardonag are we asserting anything for this test?

icycoldveins avatar Sep 03 '25 11:09 icycoldveins

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.

gcardonag avatar Sep 10 '25 00:09 gcardonag