phlask / phlask-map

Code behind the Phlask Web Map
https://beta.phlask.me
34 stars 36 forks source link

Functional Test: Mobile - Search Functionality #497

Open gcardonag opened 4 months ago

gcardonag commented 4 months ago

Is your feature request related to a problem? Please describe. As a PHLASK developer, I would like to have automated testing of displaying Food 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/mobile/search.cy.js
    1. Click on the search button on the top toolbar
    2. Enter the name for a search destination
      1. For a possible test case, use: "30th Street Station, Market Street, Philadelphia, PA, USA"
    3. Select one of the search results displayed
    4. Confirm that the map is now centered at the resulting destination
      1. For an example on how to validate this see the equivalent test at cypress/e2e/desktop/search.cy.js
  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.