Skip to content

Commit

Permalink
Check discovery tasks for app with source code and branch name (#1303)
Browse files Browse the repository at this point in the history
Signed-off-by: Maayan Hadasi <[email protected]>
  • Loading branch information
mguetta1 authored Jan 13, 2025
1 parent f49b8e0 commit 1267706
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cypress/e2e/models/migration/task-manager/task-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
19 changes: 17 additions & 2 deletions cypress/e2e/tests/migration/task-manager/task_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Analysis> = [];
let applicationsList: Array<Application> = [];
let application: Analysis;

describe(["@tier1"], "Task Manager", () => {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1267706

Please sign in to comment.