Skip to content

Commit

Permalink
Task Manager: navigation from apps inventory (#1221)
Browse files Browse the repository at this point in the history
Signed-off-by: Maayan Hadasi <[email protected]>
  • Loading branch information
mguetta1 authored Sep 17, 2024
1 parent c1a615f commit 418bebb
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -914,4 +914,11 @@ export class Application {
this.clickAssessButton();
Assessment.deleteAssessments();
}

// Opens the task manager page from application inventory page
openAllTasksLink(): void {
Application.open();
cy.get(tdTag).contains(this.name).trigger("mouseenter").wait(4000);
cy.contains("View all tasks for the application").click({ force: true });
}
}
87 changes: 87 additions & 0 deletions cypress/e2e/tests/migration/task-manager/task_manager.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
Copyright © 2021 the Konveyor Contributors (https://konveyor.io/)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/// <reference types="cypress" />

import {
clearAllFilters,
deleteApplicationTableRows,
deleteByList,
getRandomAnalysisData,
getRandomApplicationData,
login,
validateTextPresence,
} from "../../../../utils/utils";
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 { TaskManagerColumns } from "../../../views/taskmanager.view";

let applicationsList: Array<Analysis> = [];
let application: Analysis;

describe(["@tier1"], "Task Manager", () => {
before("Login", function () {
login();
deleteApplicationTableRows();
});
beforeEach("Load data", function () {
cy.fixture("application").then(function (appData) {
this.appData = appData;
});
cy.fixture("analysis").then(function (analysisData) {
this.analysisData = analysisData;
});

// Interceptors
cy.intercept("POST", "/hub/application*").as("postApplication");
cy.intercept("GET", "/hub/application*").as("getApplication");
});

it("Navigation to the task manager page is allowed from the left navigation menu", function () {
for (let i = 0; i < 2; i++) {
application = new Analysis(
getRandomApplicationData("", {
sourceData: this.appData["bookserver-app"],
}),
getRandomAnalysisData(this.analysisData["source_analysis_on_bookserverapp"])
);
application.create();
cy.wait("@getApplication");
cy.wait(2000);
applicationsList.push(application);
}

TaskManager.open();
validateTextPresence(TaskManagerColumns.application, applicationsList[0].name);
validateTextPresence(TaskManagerColumns.application, applicationsList[1].name);
});

it("Navigation to the task manager page is allowed from the application table", function () {
applicationsList[0].openAllTasksLink();
validateTextPresence(TaskManagerColumns.application, applicationsList[0].name);
validateTextPresence(TaskManagerColumns.application, applicationsList[1].name, false);
validateTextPresence(TaskManagerColumns.kind, TaskKind.languageDiscovery);
validateTextPresence(TaskManagerColumns.kind, TaskKind.techDiscovery);
clearAllFilters();
});

after("Perform test data clean up", function () {
cy.wait(2000);
Application.open(true);
deleteByList(applicationsList);
});
});

0 comments on commit 418bebb

Please sign in to comment.