Skip to content

Commit

Permalink
Merge pull request #733 from kpunwatk/stakeholder-fix
Browse files Browse the repository at this point in the history
[RFR][AF] Fix for stakeholder tests
  • Loading branch information
ibragins authored Oct 5, 2023
2 parents b163a38 + 41f3c21 commit f97ca6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
15 changes: 7 additions & 8 deletions cypress/e2e/tests/migration/controls/stakeholders/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import {
import {
stakeholderEmailInput,
stakeholderNameInput,
emailHelper,
displayNameHelper,
stakeholderHelper,
stakeHoldersTable,
} from "../../../../views/stakeholders.view";
import { Stakeholders } from "../../../../models/migration/controls/stakeholders";
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/views/common.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']";
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/views/stakeholders.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']";

0 comments on commit f97ca6f

Please sign in to comment.