Skip to content

Cypress testing Documentation

Nisarg Vadgama edited this page Jul 17, 2024 · 18 revisions

Login page

Test Case Steps

  1. User can navigate to the Login page.
  2. User can navigate to the IDIR login page.
  3. User can navigate to the BCeID login page.
  4. User can login with BCeID/IDIR.

Dashboard page(/dashboard)

Test Case Steps

  1. User can navigate to the Dashboard page.
  2. User can see an empty favourite activities section.
  3. User can favourite Seedlots page which should be visible in the favorite activities section.
  4. User can highlight the favourite card.
  5. User can delete the Seedlots page favourite card which displays the empty favourite activities section.

Create A class Seedlot(/seedlots/register-a-class)

Test Case Steps

  1. User can register an A-Class Seedlot with different species like pli, cw, dr, ep, and fdc.
  2. Check Agency acronym.
  3. Enter Agency number.
  4. Enter Email id, check for invalid email entries.
  5. Enter Seedlot species.
  6. Check default radio inputs for the Specify A-class source.
  7. Check default radio inputs for the Tree Seed Centre.
  8. Check default radio inputs for the location within B.C.
  9. Change the above 3 radio input fields.
  10. Check for the success message when the Seedlot is registered.

Seedlot Dashboard page(/seedlots)

Test Case Steps

  1. Check that the correct title and subtitle are shown on the Seedlot Dashboard page.
  2. Check all the Seedlots are there in the table.

Seedlot Detail page(/seedlots/details)

Test Case Steps

  1. Check that the correct title and subtitle are shown on the Seedlot Detail page.
  2. User can see the registration process bar has all the correct steps.
  3. User should see Seedlot Summary section correctly.
  4. User should see Applicant and Seedlot Information section correctly.

Edit Applicant Seedlot Info(/seedlots/edit-a-class-application)

Test Case Steps

  1. User should be able to see and click the Edit Applicant button on the Seedlot Details page.
  2. User should be able to change the email id.
  3. User should be able to change A-class source radio input.
  4. User should be able to change Tree Seed Centre radio input.
  5. User should be able to change location within B.C. radio input.
  6. User should be able to click on Save edit button.
  7. Verify all the changed information is displayed on the Seedlot Details page.

My Seedlots(/seedlots/my-seedlots)

316183404-fa4c6947-9d94-42b7-bcaa-4593973b0d90

Test Case Steps

  1. User can see the table of My Seedlots.
  2. User clicks on any seedlot row.
  3. User can sort the table by clicking on any of the columns.
  4. User can use the search bar.
  5. Total number of seedlots are shown at the bottom of the table.
  6. User can decide how many rows of seedlots are shown on one page.
  7. User clicks on the next page.
  8. User can click on Register a new seedlot button.
  9. Seedlot number sorting.
  10. Seedlot species sorting.
  11. Seedlot status sorting.
  12. Updated and Created date sorting.

Test Case Expected Results

After step 2: It sends the user to that seedlot's page.

After step 3: The user clicks on Seedlot number column and the table is rearranged in ascending order of Seedlot numbers.

After step 4: Typing a particular seedlot number returns that seedlot's row.

After step 6: The user clicks the dropdown menu at the bottom of the table and chooses 10 instead of 20, only 10 rows are shown on the current page.

After step 7: Next page of rows are shown.

After step 8: It redirects to seedlots/register-a-class page.

Step 9 detail:

Sorting test plan for seedlot_number (lowSeedlotNumber)

  1. Press the Seedlot number column one time (ASC)
  2. Get the first row's seedlot number and store it
  3. Compare the first row's seedlot number to second row's
  4. Press the Seedlot number column again (DESC)
  5. Get the first row's seedlot number and store it (name it something else e.g. highSeedlotNumber)
  6. Compare the first row's seedlot number to second row's
  7. Compare lowSeedlotNumber and highSeedlotNumber

Step 10 detail:

  1. Click on the column one time
  2. Record the first row's species (lowSpecies)
  3. Click on the column again
  4. Record the first row's species (highSpecies)
  5. Compare the first char of lowSpecies and highSpecies
  6. lowSpecies.charAt(0) <= highSpecies.charAt(0) e.g. cy.expect(lowSpecies.charCodeAt(0)).to.be.at.most(highSpecies.charCodeAt(0))

Step 11 detail:

Similar to species

Step 12 detail:

Similar to the above tests...

  1. Get the two extreme values by clicking on the column 2 times.
  2. Compare these two extreme values, where the lowest should be lower or equal to the highest in Cypress word, the lowest should be at.most(of the highest)

Collection and Interim Cypress Test

Test Case Steps

  1. Create a fixture to store static values like headings, subtitles etc.
  2. Check the correct title and subtitle on the Collection(Step 1) page.
  3. The Collector agency checkbox should be checked.
  4. Check the default values of Cone Collector agency and Cone Collector location code.
  5. User should be able to uncheck the Collector agency checkbox.
  6. User should be able to change the values of Cone Collector agency and Cone Collector location code.
  7. Check the error message for invalid inputs of Cone Collector agency and Cone Collector location code.
  8. User should be able to click the Client search modal.
  9. User should be able to change the Collection information date and other inputs.
  10. User should be able to check any checkbox in Collection methods.
  11. User should be able to write in the Comments text field.
  12. User can press the Next button and render Step 2 page.
  13. User can see the complete checkmark SVG in Step 1.
  14. Check the correct title and subtitle on the Interim(Step 3) page.
  15. Check the linkage between Step 1 and Step 3.
  16. User should be able to uncheck the Interim storage agency checkbox.
  17. User should be able to change the values of Interim agency and Interim agency location code.
  18. Check the error message for invalid inputs of Interim agency and Interim agency location code.
  19. User should be able to click the Client search modal.
  20. User should be able to change the Interim agency date inputs.
  21. User should be able to change the radio inputs of Storage facility type from OCV to OTH.
  22. User should see a textbox under the Storage facility and write a comment.
  23. User can press the Next button and render Step 4 page.
  24. User can see the complete checkmark SVG in Step 3.

Test Case Expected Results

Step 8 and Step 19 detail:

  • Change from Full name to Acronym.
  • Enter the test Acronym for eg. MOF.
  • Click Search button.
  • Select the first option.
  • Close the popup.
  • Check the same value is there in the Acronym(Cone Collector agency or Interim agency acronym) as selected in the popup.

Step 9 details:

  • Check validation errors for Number of Containers, Volume per Containers (HI) and Volume of Cones (HI).
  • Check the logic for these fields follows this formula -

    Number of Containers * Volume per Containers (HI) = Volume of Cones (HI).


Ownership Cypress Test

Test Case Steps

  1. Create a fixture to store static values like headings, subtitles etc.
  2. User can see correct information on Ownership(heading, subtitle).
  3. User can hide the owner agency section by clicking on the up arrow button.
  4. The owner agency section has the same title as the Owner agency and the subtitle is the same as Owner portion(%) which is 100% by default.
  5. User can uncheck the checkbox and change the Owner agency and Owner location code.
  6. User can change Reserved (%) and Surplus (%).
  7. User can enter Owner agency by clicking open the client search modal.
  8. User can enter Funding source and Method of payment from the dropdown menu.
  9. User can click on Add owner button and a new owner agency section is added to the page.
  10. User can delete the owner agency section by clicking Delete owner button.
  11. User can change the Owner portion(%) the new owner agency section.
  12. User can click on Next button.

Test Case Expected Results

Step 2: Create a test that imports fixture to check the title and subtitle.

Step 5: Check for error msg when it is invalid Owner agency and Owner location code.

After Step 6: The total of Reserved (%) and Surplus (%) should be equal to Owner portion(%)

After Step 7: Check the Owner agency and Owner location code are the same in the owner agency section as the one selected in open the client search modal.

Step 11: Check for error msg if both the owner agency section should be more than 100% or less than 100%.

After Step 12: User is on the Interim storage step and the SVG on Step 2 with the right tick is visible(that means completed).


Orchard Cypress Test

Test Case Steps

  1. Create a fixture to store static values like headings, subtitles etc.
  2. User can see correct information on Orchard(heading, subtitle).
  3. User can select any value from the Orchard dropdown option.
  4. User can see various Parent tree numbers of that Orchard in the Cone and pollen count section of Step 5.
  5. Check the functionality for additional Orchard selection and Parent tree numbers in Step 5.
  6. Check default gamete information.
  7. User can select a Female gametic and Male gametic option from the dropdown.
  8. User can change the radio buttons of gamete.
  9. Check default pollen information.
  10. User can change the radio buttons of pollen information.
  11. User can change the Contaminant pollen breeding percentage by clicking on - and + buttons or entering into the text field.
  12. User can press the Next button and render Step 5 page.
  13. User can see the complete checkmark SVG in Step 5.

Extraction Cypress Test

Test Case Steps

  1. Create a fixture to store static values like headings, subtitles etc.
  2. User can see correct information on Extraction(heading, subtitle).
  3. Check the default values of the Extraction agency.
  4. Check the default values of the Storage agency.
  5. User can uncheck the Tree Seed Center checkbox for the Extraction agency.
  6. User can type the Extractory agency acronym and the Extractory agency location code.
  7. User can enter the Extraction start date and Extraction end date.
  8. User can uncheck the Tree Seed Center checkbox for the Storage agency.
  9. User can type the Seed storage agency acronym and the Seed storage agency location code.
  10. User can enter the Storage start date and Storage end date.
  11. User can click on the Client search modal for the Extraction and Storage agency.

Test Case Expected Results

Step 6 and Step 9: Check for error messages for invalid acronym and location code.

Step 7 and Step 10: Check for error messages for invalid start and end dates.

Step 11:

  • Change from Full name to Acronym.
  • Enter the test Acronym for eg. MOF.
  • Click Search button.
  • Select the first option.
  • Close the popup.
  • Check the same value is there in the Acronym(Extractory agency or Seed storage agency) as selected in the popup.
Clone this wiki locally