Skip to content

Commit

Permalink
[RFR] Verify application task by task kind (#1206)
Browse files Browse the repository at this point in the history
* Verify application task by task kind

Signed-off-by: Maayan Hadasi <[email protected]>

* Changes after review

Signed-off-by: Maayan Hadasi <[email protected]>

---------

Signed-off-by: Maayan Hadasi <[email protected]>
  • Loading branch information
mguetta1 authored Aug 28, 2024
1 parent f27de74 commit b69f307
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
17 changes: 12 additions & 5 deletions cypress/e2e/models/migration/task-manager/task-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ limitations under the License.
/// <reference types="cypress" />

import { clickByText, selectItemsPerPage, selectUserPerspective } from "../../../../utils/utils";
import { SEC, itemsPerPage, migration, tdTag, trTag } from "../../../types/constants";
import {
SEC,
TaskKind,
TaskStatus,
itemsPerPage,
migration,
trTag,
} from "../../../types/constants";
import { navMenu } from "../../../views/menu.view";
import { tasksStatusColumn } from "../../../views/taskmanager.view";

Expand All @@ -42,12 +49,12 @@ export class TaskManager {
selectItemsPerPage(itemsPerPage);
}

static verifyStatus(application: string, status: string): void {
static verifyTaskStatus(application: string, kind: TaskKind, status: TaskStatus): void {
TaskManager.open();
selectItemsPerPage(itemsPerPage);
cy.get(tdTag)
.contains(application)
.closest(trTag)
cy.get(trTag)
.filter(':contains("' + application + '")')
.filter(':contains("' + kind + '")')
.within(() => {
cy.get(tasksStatusColumn).contains(status, { timeout: 30 * SEC });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import { Analysis } from "../../../../models/migration/applicationinventory/anal
import { infoAlertMessage } from "../../../../views/common.view";
import { AppIssue } from "../../../../types/types";
import { Application } from "../../../../models/migration/applicationinventory/application";
import { succeeded } from "../../../../types/constants";
import { TaskManager } from "../../../../models/migration/task-manager/task-manager";
import { TaskKind, TaskStatus } from "../../../../types/constants";
let applicationsList: Array<Analysis> = [];
let application: Analysis;

Expand Down Expand Up @@ -71,7 +71,17 @@ describe(["@tier1"], "Source Analysis without credentials", () => {
});

it("Check the bookserver task status on task manager page", function () {
TaskManager.verifyStatus(application.name, succeeded);
TaskManager.verifyTaskStatus(application.name, TaskKind.analyzer, TaskStatus.succeeded);
TaskManager.verifyTaskStatus(
application.name,
TaskKind.techDiscovery,
TaskStatus.succeeded
);
TaskManager.verifyTaskStatus(
application.name,
TaskKind.languageDiscovery,
TaskStatus.succeeded
);
});

after("Perform test data clean up", function () {
Expand Down
11 changes: 10 additions & 1 deletion cypress/e2e/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,13 @@ export enum Languages {
}

export const itemsPerPage = 100;
export const succeeded = "Succeeded";

export enum TaskStatus {
succeeded = "Succeeded",
}

export enum TaskKind {
analyzer = "analyzer",
techDiscovery = "tech-discovery",
languageDiscovery = "language-discovery",
}

0 comments on commit b69f307

Please sign in to comment.