Skip to content

Commit

Permalink
Cypress SS-HH Fix 2 (#2073)
Browse files Browse the repository at this point in the history
  • Loading branch information
ailZhou authored Feb 28, 2024
1 parent 9b7c3bf commit 9b122b4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ const _detailedDescription =
Cypress.Commands.add(
"addStateSpecificMeasure",
(description = _description, detailedDescription = _detailedDescription) => {
//possible fix, cypress sometimes says the add button is disabled, and that usually happens when 5 ss has been added.
cy.get('[data-cy="add-ssm-button"]').then(($btn) => {
//if button turns out to be disable, try deleting a SS before proceeding
if ($btn.is(":disabled")) {
cy.get('tr [data-cy="undefined-kebab-menu"]').last().click();
cy.get('[data-cy="Delete"]').last().click();
cy.get('[data-cy="delete-table-item-input"]').type("DELETE{enter}");
}
});
cy.get('[data-cy="add-ssm-button"]').click();
cy.get('[data-cy="add-ssm.0.description"]').type(description);
cy.get('[data-cy="add-ssm.0.detailedDescription"]').type(
Expand Down

0 comments on commit 9b122b4

Please sign in to comment.