Skip to content

Add Cypress Tests for Suggestion Submission Flow #652

@marcbachan

Description

@marcbachan

Description

End-to-end tests confirming user can open form, fill it, and submit successfully.

NOTE: If working on this before #648 and #649 are completed, it is acceptable that the test will not pass. It will still help us do quick validation once they are completed by targeting the newly created resources.

  1. Add a Cypress test that performs the following actions in cypress/e2e/desktop/suggestion.cy.js
    1. Clicks on any tap on the page
    2. Clicks on the "Edit" button on the modal that appears
    3. Fills out the form, making sure to fill out all pages of the form (See: https://github.com/phlask/phlask-map/blob/develop/cypress/e2e/desktop/crowdsourcing.cy.js for a reference implementation of that)
    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.

Complexity

~100 LOC test file; integration + mock API

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions