From c5e65a764014500224c94655a51887538bb2c0bd Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Fri, 1 Mar 2024 17:28:01 +0530 Subject: [PATCH] [WIP] Uplaod binary fix Signed-off-by: Karishma Punwatkar 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 modified: cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts --- .../e2e/models/migration/applicationinventory/analysis.ts | 1 + .../analysis/upload_binary_analysis.test.ts | 3 ++- cypress/utils/utils.ts | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/models/migration/applicationinventory/analysis.ts b/cypress/e2e/models/migration/applicationinventory/analysis.ts index 1fb6f16f9..cc5ec36b5 100644 --- a/cypress/e2e/models/migration/applicationinventory/analysis.ts +++ b/cypress/e2e/models/migration/applicationinventory/analysis.ts @@ -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( diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts index aea202222..60ca891b3 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts @@ -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", () => { @@ -128,6 +128,7 @@ describe(["@tier1"], "Upload Binary Analysis", () => { afterEach("Persist session", function () { Application.open(true); + cy.wait(10*SEC); }); after("Perform test data clean up", function () { diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 9d1f58081..b8b80496c 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -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 {