Skip to content

Commit

Permalink
[WIP] Uplaod binary fix
Browse files Browse the repository at this point in the history
Signed-off-by: Karishma Punwatkar <[email protected]>

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts

	modified:   cypress/e2e/models/migration/applicationinventory/analysis.ts
	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts

	modified:   cypress/e2e/models/migration/applicationinventory/analysis.ts
	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts
	modified:   cypress/utils/utils.ts

	modified:   cypress/utils/utils.ts

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts

	modified:   cypress/utils/utils.ts
  • Loading branch information
kpunwatk committed Mar 4, 2024
1 parent c164b40 commit 7b26363
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export class Analysis extends Application {
}

protected uploadBinary() {
cy.wait(2 * SEC);
this.binary.forEach((binaryList) => {
uploadApplications(binaryList);
cy.get("span.pf-v5-c-progress__measure", { timeout: 5000 * SEC }).should(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
} from "../../../../../utils/utils";
import { Analysis } from "../../../../models/migration/applicationinventory/analysis";
import { Application } from "../../../../models/migration/applicationinventory/application";
import { AnalysisStatuses } from "../../../../types/constants";
import { AnalysisStatuses, SEC } from "../../../../types/constants";

const applicationsList: Analysis[] = [];
describe(["@tier1"], "Upload Binary Analysis", () => {
Expand All @@ -32,10 +32,10 @@ describe(["@tier1"], "Upload Binary Analysis", () => {
});

beforeEach("Load data", function () {
cy.fixture("application").then(function (appData) {
cy.fixture("application", { timeout: 90 * SEC }).then(function (appData) {
this.appData = appData;
});
cy.fixture("analysis").then(function (analysisData) {
cy.fixture("analysis", { timeout: 90 * SEC }).then(function (analysisData) {
this.analysisData = analysisData;
});

Expand Down
5 changes: 3 additions & 2 deletions cypress/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,12 @@ export function uploadXml(fileName: string, selector = 'input[type="file"]'): vo
}

export function uploadApplications(fileName: string): void {
cy.get('input[type="file"]', { timeout: 5 * SEC }).attachFile(
cy.wait(2 * SEC);
cy.get('input[type="file"]', { timeout: 10 * SEC }).attachFile(
{ filePath: fileName, encoding: "binary" },
{ subjectType: "drag-n-drop" }
);
cy.wait(2000);
cy.wait(20 * SEC);
}

export function uploadFile(fileName: string): void {
Expand Down

0 comments on commit 7b26363

Please sign in to comment.