From 1a86025687f3546cfab464cc436046e333b564d3 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 | 19 ++++++------------- cypress/e2e/models/migration/controls/tags.ts | 5 +++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/models/migration/controls/tagcategory.ts b/cypress/e2e/models/migration/controls/tagcategory.ts index b2b64f598..ff3b7b78b 100644 --- a/cypress/e2e/models/migration/controls/tagcategory.ts +++ b/cypress/e2e/models/migration/controls/tagcategory.ts @@ -18,14 +18,16 @@ import { cancelForm, click, clickByText, + clickItemInKebabMenu, confirm, inputText, + performRowActionByIcon, selectItemsPerPage, selectUserPerspective, submitForm, } from "../../../../utils/utils"; import { navMenu, navTab } from "../../../views/menu.view"; -import { button, controls, migration, SEC, tags, tdTag, trTag } from "../../../types/constants"; +import { button, controls, deleteAction, migration, SEC, tags, tdTag, trTag } from "../../../types/constants"; import { createTagCategoryButton, rankInput } from "../../../views/tags.view"; import * as commonView from "../../../views/common.view"; import { clickTags, fillName } from "./tags"; @@ -90,12 +92,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 +115,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 72be93ab5..b71622003 100644 --- a/cypress/e2e/models/migration/controls/tags.ts +++ b/cypress/e2e/models/migration/controls/tags.ts @@ -38,6 +38,7 @@ import { applyAction, confirm, click, + performRowActionByIcon, } from "../../../../utils/utils"; import { dropdownMenuToggle, @@ -61,7 +62,7 @@ export class Tag { tagCategory: string; constructor(name: string, tagCategory: string) { - this.name = name; + this.name = name this.tagCategory = tagCategory; } @@ -114,7 +115,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 {