Skip to content

Commit

Permalink
[RFR] Tasks: download task details (#1302)
Browse files Browse the repository at this point in the history
* Explicitly import constants from common.view

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

* Download and verify task details

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

---------

Signed-off-by: Maayan Hadasi <[email protected]>
  • Loading branch information
mguetta1 authored Jan 13, 2025
1 parent 1267706 commit 8d40755
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 71 deletions.
7 changes: 2 additions & 5 deletions cypress/e2e/models/migration/task-manager/task-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ import {
kebabActionButton,
searchButton,
searchInput,
taskDetailsEditor,
} from "../../../views/common.view";
import { navMenu } from "../../../views/menu.view";
import {
taskDetailsEditor,
TaskManagerColumns,
tasksStatusColumn,
} from "../../../views/taskmanager.view";
import { TaskManagerColumns, tasksStatusColumn } from "../../../views/taskmanager.view";

export class TaskManager {
static fullUrl = Cypress.env("tackleUrl") + "/tasks";
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/tests/migration/task-manager/task_details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ limitations under the License.
/// <reference types="cypress" />

import {
cleanupDownloads,
deleteApplicationTableRows,
downloadTaskDetails,
getRandomAnalysisData,
getRandomApplicationData,
login,
} from "../../../../utils/utils";
import { Analysis } from "../../../models/migration/applicationinventory/analysis";
import { TaskManager } from "../../../models/migration/task-manager/task-manager";
import { TaskKind } from "../../../types/constants";
import { downloadFormatDetails } from "../../../views/common.view";

describe(["@tier3"], "Task details validation", function () {
let application: Analysis;
Expand Down Expand Up @@ -61,7 +64,16 @@ describe(["@tier3"], "Task details validation", function () {
TaskManager.openTaskDetailsByStatus(application.name, TaskKind.techDiscovery);
});

it("Download task details in yaml format", function () {
downloadTaskDetails();
});

it("Download task details in json format", function () {
downloadTaskDetails(downloadFormatDetails.json);
});

after("Perform test data clean up", function () {
deleteApplicationTableRows();
cleanupDownloads();
});
});
17 changes: 15 additions & 2 deletions cypress/e2e/views/common.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const modal = "[id^=pf-modal-part-]";
export const navLink = ".pf-v5-c-nav__link";
export const closeSuccessNotification = "button[aria-label^='Close Success alert:']";
export const divHeader = "[id^=pf-random-id-]";
export const selectFilter = "div.pf-m-toggle-group.pf-m-filter-group.pf-m-show";
export const itemsSelectInsideDialog =
"div[role='dialog'] button[class='pf-v5-c-menu-toggle__button']";
export const helperBusiness = 'span[class*="helper-text__item"]';
Expand Down Expand Up @@ -97,5 +96,19 @@ export enum sideDrawer {
listText = "span.pf-v5-c-description-list__text",
labelText = "span.pf-v5-c-label__text",
}
export const closeAbout = "button[aria-label='Close Dialog'";
export const closeAbout = "button[aria-label='Close Dialog']";
export const pencilIcon = "#pencil-action";

// Task details page
export const taskDetailsEditor = "div[class='pf-v5-c-code-editor__code']";
export const downloadFormatDetails = {
yaml: {
key: "yaml",
button: "button[id='code-language-select-yaml']",
},
json: {
key: "json",
button: "button[id='code-language-select-json']",
},
};
export const downloadTaskButton = "button[aria-label='Download code']";
1 change: 0 additions & 1 deletion cypress/e2e/views/taskmanager.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ export enum TaskManagerColumns {
createdBy = 'td[data-label="Created By"]',
}
export const tasksTable = "table[aria-label='Tasks table']";
export const taskDetailsEditor = "div[class='pf-v5-c-code-editor__code']";
Loading

0 comments on commit 8d40755

Please sign in to comment.