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

[RFR] [JF] Fix application field validation #691

Merged
merged 14 commits into from
Aug 24, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import {
applicationBusinessServiceSelect,
applicationContributorsInput,
applicationOwnerInput,
applicationContributorsText,
applicationContributorsAction,
} from "../../../../views/applicationinventory.view";

import * as commonView from "../../../../views/common.view";
Expand Down Expand Up @@ -75,8 +77,7 @@ describe(["@tier2"], "Application validations", () => {
// Navigate to application inventory page and click "Create New" button
Assessment.open();
clickByText(button, createNewButton);

selectFormItems(applicationBusinessServiceSelect, businessservicesList[0].name);
selectFormItems(applicationBusinessServiceSelect, "Collins LLC");
nachandr marked this conversation as resolved.
Show resolved Hide resolved

// Name constraints
inputText(applicationNameInput, data.getRandomWord(2));
Expand All @@ -86,7 +87,7 @@ describe(["@tier2"], "Application validations", () => {

// Description constraint
inputText(applicationDescriptionInput, data.getRandomWords(90));
cy.get(commonView.descriptionHelper).should("contain", max250CharsMsg);
cy.get(commonView.nameHelper).should("contain", max250CharsMsg);
nachandr marked this conversation as resolved.
Show resolved Hide resolved
// Clear description field to make it valid input
cy.get(applicationDescriptionInput).clear();

Expand All @@ -105,7 +106,7 @@ describe(["@tier2"], "Application validations", () => {
});

cy.get(applicationOwnerInput)
.parent()
.closest("div")
.next("button")
.click()
.then(() => {
Expand All @@ -124,17 +125,18 @@ describe(["@tier2"], "Application validations", () => {
cy.get("button").contains(stakeHoldersList[1].name).click();

cy.get(applicationContributorsInput)
.parent()
.closest("div")
.should("contain", stakeHoldersList[0].name)
.and("contain", stakeHoldersList[1].name);

cy.get(applicationContributorsInput)
cy.get(applicationContributorsText)
.contains(stakeHoldersList[0].name)
.parent()
.contains("span", stakeHoldersList[0].name)
.next("button")
.next(applicationContributorsAction)
.click();

cy.get(applicationContributorsInput).parent().and("contain", stakeHoldersList[1].name);
cy.get(applicationContributorsInput)
.closest("div")
.should("contain", stakeHoldersList[1].name);

// Close the form
cy.get(commonView.closeButton).click();
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/views/applicationinventory.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const applicationDescriptionInput = "input[name=description]";
export const applicationBusinessServiceSelect = "[placeholder='Select a business service']";
export const applicationContributorsInput =
"#contributors-select-toggle-select-multi-typeahead-typeahead";
export const applicationContributorsText = ".pf-v5-c-chip__text";
export const applicationContributionAction = ".pf-v5-c-chip__actions";
export const applicationOwnerInput = "#owner-toggle-select-typeahead";
export const repoTypeSelect = "button[id='repo-type-toggle']";
export const applicationTagsSelect = "[placeholder='Select tags']";
Expand Down
Loading