Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add incident report cypress test #444

Open
wants to merge 44 commits into
base: dev
Choose a base branch
from

Conversation

adamkelly03
Copy link

Cypress tests for Incident report workflow.

Not covered Fully is the file upload and map tabs will have to potentially be manually tested as they have been quick tricky

Spreadsheet attached

https://docs.google.com/spreadsheets/d/1C1ctkKZdIIUjVUsPxAQOL-HQN3VMxsLEquoysLvVKBk/edit?hl=en_GB&pli=1&gid=1878271857#gid=1878271857

Flag for enforcement branch will need to merge 1st (Andreas)

Also changes the url to the full localhost url. This is done so the tests can actually get to the point where they run as uncaught issues were otherwise blocking them before they even got started. We can debug this later
Ignores videos and screenshots generated from cypress studio
Also adds comments and sections off different tabs in the code
Also changes the url to the full localhost url. This is done so the tests can actually get to the point where they run as uncaught issues were otherwise blocking them before they even got started. We can debug this later
Ignores videos and screenshots generated from cypress studio
Also adds comments and sections off different tabs in the code
also renames tests to run in order
@adamkelly03 adamkelly03 self-assigned this Sep 6, 2024
@andrea-kyurchiev andrea-kyurchiev self-assigned this Sep 16, 2024
@andrea-kyurchiev
Copy link

I've also left some comments in the spreadsheet and marked everything that should've been included in this with orange. Some fields were marked green but aren't getting checked in the tests. Rich textboxes aren't tested whatsoever


// Record of the incident
cy.wait(4000)
cy.get('[aria-label="Name"]').click(); // Name textfield should be disabled and prefilled

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not test if the input is disabled. Also applies to other inputs that were tested for being disabled with a click. See https://docs.cypress.io/api/commands/should#Examples on how to properly test for disabled elements

cy.get('[style="display: flex"] > .fa').contains('Start New').click();

// Inital Step tab
cy.get('.tabbed-workflow-footer-button-container > .btn').contains('Next Step').click();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't check if the HA Number is actually populated


cy.get('.card_component.issue_identifier').contains('Add new Relationship').scrollIntoView().click() // Issue identified by dropdown
cy.wait(4000);
cy.get('.select2-results__option').first().click();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not use a random person but instead the one created by the tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies to all the relationships selects that use .first()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants