Skip to content

Commit

Permalink
Revert ""PR 1326 Update Tag.edit()" (#1337)
Browse files Browse the repository at this point in the history
Signed-off-by: Nandini Chandra <[email protected]>
  • Loading branch information
nachandr authored Feb 7, 2025
1 parent 3a660fb commit 69383c5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
16 changes: 8 additions & 8 deletions cypress/e2e/models/migration/archetypes/archetype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
cancelForm,
click,
clickByText,
clickKebabMenuOptionNoID,
clickKebabMenuOptionArchetype,
confirm,
inputText,
performRowActionByIcon,
Expand Down Expand Up @@ -147,7 +147,7 @@ export class Archetype {

delete(cancel = false): void {
Archetype.open();
clickKebabMenuOptionNoID(this.name, "Delete");
clickKebabMenuOptionArchetype(this.name, "Delete");
if (cancel) {
cancelForm();
} else click(commonView.confirmButton);
Expand Down Expand Up @@ -216,7 +216,7 @@ export class Archetype {
saveAndReview = false
) {
Archetype.open();
clickKebabMenuOptionNoID(this.name, "Assess");
clickKebabMenuOptionArchetype(this.name, "Assess");
cy.wait(SEC);
Assessment.perform_assessment(
risk,
Expand All @@ -239,7 +239,7 @@ export class Archetype {

validateReviewDonutChart(): void {
Archetype.open();
clickKebabMenuOptionNoID(this.name, review);
clickKebabMenuOptionArchetype(this.name, review);
Assessment.validateReviewDonutChart();
}

Expand All @@ -252,7 +252,7 @@ export class Archetype {

perform_review(risk): void {
Archetype.open();
clickKebabMenuOptionNoID(this.name, "Review");
clickKebabMenuOptionArchetype(this.name, "Review");
cy.wait(8 * SEC);
Assessment.perform_review(risk);
}
Expand All @@ -277,7 +277,7 @@ export class Archetype {
comments?: string,
cancel = false
) {
clickKebabMenuOptionNoID(this.name, "Duplicate");
clickKebabMenuOptionArchetype(this.name, "Duplicate");

if (cancel) {
cancelForm();
Expand Down Expand Up @@ -346,13 +346,13 @@ export class Archetype {

discard(option: string) {
Archetype.open();
clickKebabMenuOptionNoID(this.name, option);
clickKebabMenuOptionArchetype(this.name, option);
confirm();
}

clickAssessButton() {
Archetype.open();
clickKebabMenuOptionNoID(this.name, "Assess");
clickKebabMenuOptionArchetype(this.name, "Assess");
}

deleteAssessments(): void {
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/models/migration/controls/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
button,
controls,
deleteAction,
editAction,
migration,
SEC,
tags,
Expand All @@ -31,11 +30,11 @@ import {
cancelForm,
click,
clickByText,
clickKebabMenuOptionNoID,
closeRowDetails,
confirm,
expandRowDetails,
inputText,
performRowActionByIcon,
selectItemsPerPage,
selectUserPerspective,
submitForm,
Expand Down Expand Up @@ -115,7 +114,7 @@ export class Tag {
edit(updatedValue: { name?: string; tagcategory?: string }, cancel = false): void {
Tag.openList();
expandRowDetails(this.tagCategory);
clickKebabMenuOptionNoID(this.name, editAction);
performRowActionByIcon(this.name, commonView.pencilIcon);
if (cancel) {
cancelForm();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
applySelectFilter,
clearAllFilters,
clickItemInKebabMenu,
clickKebabMenuOptionNoID,
clickKebabMenuOptionArchetype,
createMultipleApplications,
createMultipleArchetypes,
createMultipleStakeholders,
Expand Down Expand Up @@ -76,7 +76,7 @@ describe(["@tier3"], "Review Identified Risks filter validations for assessments
clickItemInKebabMenu(application.name, review);
commonActions();
Archetype.open();
clickKebabMenuOptionNoID(archetype.name, review);
clickKebabMenuOptionArchetype(archetype.name, review);
commonActions();
});
});
Expand Down
7 changes: 3 additions & 4 deletions cypress/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,9 @@ export function clickItemInKebabMenu(rowItem, itemName: string): void {
cy.get(actionMenuItem).contains(itemName).closest(button).first().click({ force: true });
}

export function clickKebabMenuOptionNoID(rowItem: string, itemName: string): void {
// The clickItemInKebabMenu() fn doesn't work in a few places. For eg: clickItemInKebabMenu()
// doesn't work on Tag kebab menu.So, try this function if clickItemInKebabMenu() doesn't work.
// Also, the kebab menu doesn't have an ID on these pages, hence the name.
export function clickKebabMenuOptionArchetype(rowItem: string, itemName: string): void {
// The clickItemInKebabMenu() fn can't be used on the Archetype page just yet because the
// the individual archetypes don't have an id for their kebab menu.
cy.contains(rowItem)
.closest(trTag)
.within(() => {
Expand Down

0 comments on commit 69383c5

Please sign in to comment.