From 81c08724a741f248ee65ba123be2e2c9790461e3 Mon Sep 17 00:00:00 2001 From: TalyaNaima Date: Tue, 8 Oct 2024 14:15:45 +0300 Subject: [PATCH] changing the test so it gets to the delete&edit buttns Signed-off-by: TalyaNaima --- .../models/migration/controls/tagcategory.ts | 28 ++++++++++--------- cypress/e2e/models/migration/controls/tags.ts | 4 +-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/models/migration/controls/tagcategory.ts b/cypress/e2e/models/migration/controls/tagcategory.ts index 2ec473463..9e91992c9 100644 --- a/cypress/e2e/models/migration/controls/tagcategory.ts +++ b/cypress/e2e/models/migration/controls/tagcategory.ts @@ -18,13 +18,24 @@ import { cancelForm, click, clickByText, + clickItemInKebabMenu, confirm, inputText, + performRowActionByIcon, selectItemsPerPage, selectUserPerspective, submitForm, } from "../../../../utils/utils"; -import { button, controls, migration, SEC, tags, tdTag, trTag } from "../../../types/constants"; +import { + button, + controls, + deleteAction, + migration, + SEC, + tags, + tdTag, + trTag, +} from "../../../types/constants"; import * as commonView from "../../../views/common.view"; import { navMenu, navTab } from "../../../views/menu.view"; import { createTagCategoryButton, rankInput } from "../../../views/tags.view"; @@ -90,12 +101,7 @@ export class TagCategory { edit(updatedValue: { name?: string; rank?: number; color?: string }, cancel = false): void { TagCategory.openList(); - cy.get(tdTag) - .contains(this.name) - .parent(trTag) - .within(() => { - click(commonView.editButton); - }); + performRowActionByIcon(this.name, commonView.pencilIcon); if (cancel) { cancelForm(); } else { @@ -118,12 +124,8 @@ export class TagCategory { delete(cancel = false): void { // Opening tags list only if another tab is opened TagCategory.openList(); - cy.get(tdTag, { timeout: 2 * SEC }) - .contains(this.name) - .parent(trTag) - .within(() => { - click(commonView.deleteButton); - }); + + clickItemInKebabMenu(this.name, deleteAction); if (cancel) { click(commonView.confirmCancelButton); } else { diff --git a/cypress/e2e/models/migration/controls/tags.ts b/cypress/e2e/models/migration/controls/tags.ts index f249dec2c..04166c666 100644 --- a/cypress/e2e/models/migration/controls/tags.ts +++ b/cypress/e2e/models/migration/controls/tags.ts @@ -17,7 +17,6 @@ import { button, controls, deleteAction, - editAction, migration, SEC, tags, @@ -35,6 +34,7 @@ import { confirm, expandRowDetails, inputText, + performRowActionByIcon, selectItemsPerPage, selectUserPerspective, submitForm, @@ -114,7 +114,7 @@ export class Tag { edit(updatedValue: { name?: string; tagcategory?: string }, cancel = false): void { Tag.openList(); expandRowDetails(this.tagCategory); - this.clickTagAction(editAction); + performRowActionByIcon(this.name, commonView.pencilIcon); if (cancel) { cancelForm(); } else {