diff --git a/cypress/e2e/tests/migration/controls/stakeholders/create.test.ts b/cypress/e2e/tests/migration/controls/stakeholders/create.test.ts index 1ec3d4368..681b2a7b1 100644 --- a/cypress/e2e/tests/migration/controls/stakeholders/create.test.ts +++ b/cypress/e2e/tests/migration/controls/stakeholders/create.test.ts @@ -34,8 +34,7 @@ import { import { stakeholderEmailInput, stakeholderNameInput, - emailHelper, - displayNameHelper, + stakeholderHelper, stakeHoldersTable, } from "../../../../views/stakeholders.view"; import { Stakeholders } from "../../../../models/migration/controls/stakeholders"; @@ -63,17 +62,17 @@ describe(["@tier2"], "Stakeholder validations", () => { // Email constraints inputText(stakeholderEmailInput, data.getRandomWord(2)); - cy.get(emailHelper).should("contain", minCharsMsg); + cy.get(stakeholderHelper).should("contain", minCharsMsg); inputText(stakeholderEmailInput, data.getRandomWords(45)); - cy.get(emailHelper).should("contain", max120CharsMsg); + cy.get(stakeholderHelper).should("contain", max120CharsMsg); inputText(stakeholderEmailInput, data.getRandomWord(10)); - cy.get(emailHelper).should("contain", invalidEmailMsg); + cy.get(stakeholderHelper).should("contain", invalidEmailMsg); // Name constraints inputText(stakeholderNameInput, data.getRandomWord(2)); - cy.get(displayNameHelper).should("contain", minCharsMsg); + cy.get(stakeholderHelper).should("contain", minCharsMsg); inputText(stakeholderNameInput, data.getRandomWords(90)); - cy.get(displayNameHelper).should("contain", max120CharsMsg); + cy.get(stakeholderHelper).should("contain", max120CharsMsg); // Validate the create button is enabled with valid inputs inputText(stakeholderEmailInput, data.getEmail()); @@ -123,7 +122,7 @@ describe(["@tier2"], "Stakeholder validations", () => { // Check email duplication inputText(stakeholderEmailInput, stakeholder.email); inputText(stakeholderNameInput, data.getFullName()); - cy.get(commonView.emailHelper).should("contain.text", duplicateEmail); + cy.get(stakeholderHelper).should("contain.text", duplicateEmail); // Delete created stakeholder cy.get(commonView.closeButton).click(); diff --git a/cypress/e2e/views/common.view.ts b/cypress/e2e/views/common.view.ts index f70722a80..9d5091479 100644 --- a/cypress/e2e/views/common.view.ts +++ b/cypress/e2e/views/common.view.ts @@ -34,7 +34,6 @@ export const appTable = ".pf-v5-c-table"; export const expandableRow = ".pf-c-expandable-row"; export const nameHelper = "span.pf-v5-c-helper-text__item-text"; export const descriptionHelper = "div[id=description-helper]"; -export const emailHelper = "div[id=email-helper]"; export const filterToggleButton = "div.pf-c-dropdown > button.pf-c-dropdown__toggle"; export const filterInput = "input[type='search']"; export const searchButton = "button[aria-label='search button for search input']"; diff --git a/cypress/e2e/views/stakeholders.view.ts b/cypress/e2e/views/stakeholders.view.ts index 56df2026e..2595d7d3a 100644 --- a/cypress/e2e/views/stakeholders.view.ts +++ b/cypress/e2e/views/stakeholders.view.ts @@ -18,9 +18,6 @@ export const stakeholderNameInput = "input[name=name]"; export const jobfunctionInput = "#job-function-toggle-select-typeahead"; export const groupInput = "#stakeholder-groups-toggle-select-multi-typeahead-typeahead"; export const groupsCount = "td[data-label='Group count']"; -export const emailHelper = "div[id=email-helper]"; -export const displayNameHelper = "div[id=name-helper]"; -export const fieldHeader = ".pf-c-table__button"; -export const groupCountHeader = "thead > tr > :nth-child(5)"; +export const stakeholderHelper = "div.pf-v5-c-helper-text"; export const removeJobFunction = ".pf-v5-c-select__toggle-clear"; export const stakeHoldersTable = "table[aria-label='Stakeholders table']";