From 6e83e770385aa1620859b08ce6ce10c891bafdc9 Mon Sep 17 00:00:00 2001 From: Maayan Hadasi Date: Sun, 12 Jan 2025 22:28:26 +0200 Subject: [PATCH] Check discovery tasks for app with source code and branch name Signed-off-by: Maayan Hadasi --- .../migration/task-manager/task-manager.ts | 5 +++-- .../task-manager/task_manager.test.ts | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/models/migration/task-manager/task-manager.ts b/cypress/e2e/models/migration/task-manager/task-manager.ts index 05dbb8dba..caa971888 100644 --- a/cypress/e2e/models/migration/task-manager/task-manager.ts +++ b/cypress/e2e/models/migration/task-manager/task-manager.ts @@ -83,8 +83,9 @@ export class TaskManager { public static verifyTaskStatus(application: string, kind: TaskKind, status: TaskStatus) { TaskManager.open(); TaskManager.getTaskRow(application, kind) - .find(tasksStatusColumn) - .contains(status, { timeout: 10 * MIN }); + // The assertion will automatically retry as long as the parent command respects the timeout + .find(tasksStatusColumn, { timeout: 10 * MIN }) + .should("contain.text", status); } public static applyFilter(filterType: TaskFilter, filterValue: string) { diff --git a/cypress/e2e/tests/migration/task-manager/task_manager.test.ts b/cypress/e2e/tests/migration/task-manager/task_manager.test.ts index 922074ab9..e09e86465 100644 --- a/cypress/e2e/tests/migration/task-manager/task_manager.test.ts +++ b/cypress/e2e/tests/migration/task-manager/task_manager.test.ts @@ -28,10 +28,10 @@ import { import { Analysis } from "../../../models/migration/applicationinventory/analysis"; import { Application } from "../../../models/migration/applicationinventory/application"; import { TaskManager } from "../../../models/migration/task-manager/task-manager"; -import { TaskKind, TaskStatus } from "../../../types/constants"; +import { SEC, TaskKind, TaskStatus } from "../../../types/constants"; import { TaskManagerColumns, tasksTable } from "../../../views/taskmanager.view"; -let applicationsList: Array = []; +let applicationsList: Array = []; let application: Analysis; describe(["@tier1"], "Task Manager", () => { @@ -81,6 +81,21 @@ describe(["@tier1"], "Task Manager", () => { clearAllFilters(); }); + it("Create an app with source code and branch name - discovery tasks should succeed", function () { + Application.open(); + const app = new Application( + getRandomApplicationData("", { + sourceData: this.appData["konveyor-exampleapp"], + }) + ); + app.create(); + cy.wait("@getApplication", { timeout: 2 * SEC }); + applicationsList.push(app); + TaskManager.open(); + TaskManager.verifyTaskStatus(app.name, TaskKind.languageDiscovery, TaskStatus.succeeded); + TaskManager.verifyTaskStatus(app.name, TaskKind.techDiscovery, TaskStatus.succeeded); + }); + it("Delete an application - related tasks are deleted", function () { // Remove the last element from applicationsList const app = applicationsList.pop();