Skip to content

Commit

Permalink
changing the test so it gets to the delete&edit buttns
Browse files Browse the repository at this point in the history
Signed-off-by: TalyaNaima <[email protected]>
  • Loading branch information
TalyaNaima authored and mguetta1 committed Jan 22, 2025
1 parent dc82c61 commit 81c0872
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
28 changes: 15 additions & 13 deletions cypress/e2e/models/migration/controls/tagcategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 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 @@ -35,6 +34,7 @@ import {
confirm,
expandRowDetails,
inputText,
performRowActionByIcon,
selectItemsPerPage,
selectUserPerspective,
submitForm,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 81c0872

Please sign in to comment.