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

[RFR][JF] Fixed task manager filtering test #1265

Merged
merged 2 commits into from
Nov 14, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
getRandomAnalysisData,
getRandomApplicationData,
login,
notExists,
validateNumberPresence,
validatePagination,
validateSortBy,
Expand All @@ -31,7 +32,7 @@ import {
import { Analysis } from "../../../models/migration/applicationinventory/analysis";
import { TaskManager } from "../../../models/migration/task-manager/task-manager";
import { TaskFilter, TaskKind, TaskStatus, trTag } from "../../../types/constants";
import { TaskManagerColumns } from "../../../views/taskmanager.view";
import { TaskManagerColumns, tasksTable } from "../../../views/taskmanager.view";

describe(["@tier3"], "Filtering, sorting and pagination in Task Manager Page", function () {
const applicationsList: Analysis[] = [];
Expand Down Expand Up @@ -70,6 +71,9 @@ describe(["@tier3"], "Filtering, sorting and pagination in Task Manager Page", f

Analysis.analyzeAll(dayTraderApp);
TaskManager.open();

cy.intercept("GET", "/hub/tasks*").as("getTasks");

// Filter by status
TaskManager.applyFilter(TaskFilter.status, TaskStatus.pending);
validateTextPresence(TaskManagerColumns.status, TaskStatus.pending);
Expand All @@ -88,12 +92,15 @@ describe(["@tier3"], "Filtering, sorting and pagination in Task Manager Page", f
clearAllFilters();

// Filter by ID
TaskManager.applyFilter(TaskFilter.id, "1");
validateNumberPresence(TaskManagerColumns.id, 1);
clearAllFilters();
TaskManager.applyFilter(TaskFilter.id, "2");
validateNumberPresence(TaskManagerColumns.id, 2);
clearAllFilters();
cy.wait("@getTasks")
.its("response.body")
.should("have.length.gte", 2) // Make sure there are at least two items
.then((responseBody) => {
TaskManager.applyFilter(TaskFilter.id, responseBody[0].id.toString());
validateNumberPresence(TaskManagerColumns.id, responseBody[0].id);
notExists(responseBody[1].id.toString(), tasksTable);
clearAllFilters();
});

// Filter by Applications
TaskManager.applyFilter(TaskFilter.applicationName, applicationsList[0].name);
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/views/taskmanager.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export enum TaskManagerColumns {
preemption = 'td[data-label="Preemption"]',
createdBy = 'td[data-label="Created By"]',
}
export const tasksTable = "table[aria-label='Tasks table']";
Loading