Skip to content

Commit

Permalink
Improve task verification in application tasks tab test based on PR f…
Browse files Browse the repository at this point in the history
…eedback.

Signed-off-by: EstyBiton <[email protected]>
  • Loading branch information
EstyBiton committed Oct 26, 2024
1 parent e96b75d commit 348ae7d
Showing 1 changed file with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
Copyright © 2021 the Konveyor Contributors (https://konveyor.io/)
Expand All @@ -19,13 +18,11 @@ import {
login,
getRandomApplicationData,
sidedrawerTab,
deleteByList,
getRandomAnalysisData,
} from "../../../../utils/utils";
import { Application } from "../../../../e2e/models/migration/applicationinventory/application";
import { Analysis } from "../../../models/migration/applicationinventory/analysis";

let applicationsList: Array<Analysis> = [];

let application: Analysis;

describe(["@tier2"], "Open Tasks Tab and Verify Tasks", () => {
Expand All @@ -42,33 +39,31 @@ describe(["@tier2"], "Open Tasks Tab and Verify Tasks", () => {
});
cy.intercept("GET", "/api/applications/*").as("getApplication");
});
it(`Open 'Tasks' tab in the application drawer and verify task kinds `, function () {

it("Open 'Tasks' tab in the application drawer and verify task kinds", function () {
application = new Analysis(
getRandomApplicationData("bookserverApp", {
sourceData: this.appData["bookserver-app"],
}),
getRandomAnalysisData(this.analysisData["source_analysis_on_bookserverapp"])
);
application.create();
applicationsList.push(application);
cy.wait("@getApplication");
cy.wait("@getApplication");
cy.wait(2000);
application.analyze();
application.verifyAnalysisStatus("Completed");
sidedrawerTab(application.name, "Tasks");

cy.get("[data-label='Task Kind']").should((tasks) => {
const taskKinds = tasks.toArray().map(task => task.innerText);
const taskKinds = tasks.toArray().map(task => task.innerText);
expect(taskKinds).to.include.members(["language-discovery", "tech-discovery", "analyzer"]);
});
});

});
afterEach("Persist session", function () {
Application.open(true);
});

after("Perform test data clean up", function () {
deleteByList(applicationsList);
});
});

afterEach("Clear state", function () {
Application.open(true);
});

after("Perform test data clean up", function () {
application.delete();
});
});

0 comments on commit 348ae7d

Please sign in to comment.