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

👻 Update tests to reflect new UI changes #1091

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions cypress/e2e/models/migration/applicationinventory/assessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ import {
assessmentColumnSelector,
questionBlock,
radioInput,
stakeholdergroupsSelect,
stakeholderSelect,
stack,
assessmentBlock,
victoryContainer,
donutChart,
donutChartImage,
stakeholdersAndGroupsSelect,
ibolton336 marked this conversation as resolved.
Show resolved Hide resolved
} from "../../../views/assessment.view";
import {
criticalityInput,
Expand All @@ -57,15 +56,15 @@ import { notYetReviewed, reviewItems } from "../../../views/archetype.view";
import { plainButton, tableRowActions, splitItem } from "../../../views/common.view";

export class Assessment {
public static selectStakeholders(stakeholders: Stakeholders[]): void {
stakeholders.forEach(function (stakeholder) {
selectFormItems(stakeholderSelect, stakeholder.name);
public static selectStakeholdersAndGroups(
stakeholders?: Stakeholders[],
stakeholderGroups?: Stakeholdergroups[]
): void {
stakeholders?.forEach(function (stakeholder) {
selectFormItems(stakeholdersAndGroupsSelect, stakeholder.name);
});
}

public static selectStakeholderGroups(stakeholderGroups: Stakeholdergroups[]): void {
stakeholderGroups.forEach(function (stakeholderGroup) {
selectFormItems(stakeholdergroupsSelect, stakeholderGroup.name);
stakeholderGroups?.forEach(function (stakeholderGroup) {
selectFormItems(stakeholdersAndGroupsSelect, stakeholderGroup.name);
});
}

Expand Down Expand Up @@ -215,8 +214,8 @@ export class Assessment {
stakeholderGroups?: Stakeholdergroups[],
saveAndReview = false
): void {
if (stakeholders) this.selectStakeholders(stakeholders);
if (stakeholderGroups) this.selectStakeholderGroups(stakeholderGroups);
if (stakeholders || stakeholderGroups)
this.selectStakeholdersAndGroups(stakeholders, stakeholderGroups);
clickJs(commonView.nextButton);
cy.wait(SEC);
this.selectAnswers(risk, saveAndReview);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ import {
selectItemsPerPage,
} from "../../../../../utils/utils";
import { businessColumnSelector } from "../../../../views/applicationinventory.view";
import {
continueButton,
stakeholdergroupsSelect,
stakeholderSelect,
} from "../../../../views/assessment.view";
import { continueButton, stakeholdersAndGroupsSelect } from "../../../../views/assessment.view";
import { navMenu } from "../../../../views/menu.view";
import { Stakeholders } from "../../../../models/migration/controls/stakeholders";
import { Stakeholdergroups } from "../../../../models/migration/controls/stakeholdergroups";
Expand Down Expand Up @@ -150,8 +146,7 @@ describe(["@tier3"], "Applications interlinked to tags and business service", ()
clickByText(button, "Retake");

//Verify that values show blank
cy.get(stakeholderSelect).should("have.value", "");
cy.get(stakeholdergroupsSelect).should("have.value", "");
cy.get(stakeholdersAndGroupsSelect).should("have.value", "");
clickByText(button, "Cancel");
cy.get(continueButton).click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/views/assessment.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export const stakeholderSelect = "input[aria-label='stakeholder-select-toggle']";
export const stakeholdergroupsSelect = "input[aria-label='stakeholder-groups-select-toggle']";
export const stakeholdersAndGroupsSelect =
"input[aria-label='stakeholders-and-groups-select-toggle']";
export const questionBlock = "div[cy-data='question']";
export const assessmentBlock = "li.pf-v5-c-wizard__nav-item";
export const radioInput = "input[type='radio']";
Expand Down
Loading