From 975d09a5530820132e19e895cbe32a1513704c37 Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Tue, 6 Aug 2024 17:19:17 +0530 Subject: [PATCH] [WIP] Fix Source Analysis without credentials Signed-off-by: Karishma Punwatkar modified: cypress/e2e/models/migration/dynamic-report/issues/issues.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts modified: cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts --- .../migration/dynamic-report/issues/issues.ts | 18 ++++++++++++++++++ .../analysis/source_analysis.test.ts | 1 + 2 files changed, 19 insertions(+) diff --git a/cypress/e2e/models/migration/dynamic-report/issues/issues.ts b/cypress/e2e/models/migration/dynamic-report/issues/issues.ts index 4be25401d..d8e91a100 100644 --- a/cypress/e2e/models/migration/dynamic-report/issues/issues.ts +++ b/cypress/e2e/models/migration/dynamic-report/issues/issues.ts @@ -195,9 +195,27 @@ export class Issues { .within(() => { if (Array.isArray(content)) { content.forEach((item) => cy.contains(contentSelector, item)); + Issues.closeDropdownIfOpen(); } else { cy.contains(contentSelector, content); + Issues.closeDropdownIfOpen(); } }); } + private static closeDropdownIfOpen(): void { + cy.wait(2000); // Increase the wait time to ensure the element is present + cy.get("[id^='expandable']", { timeout: 30000 }).then(($item) => { + if ($item.length > 0) { + $item.each((index, item) => { + cy.wrap(item) + // .should('be.visible') + .click({ force: true }); + }); + } + + // if (!$item.hasClass("pf-m-expanded")) { + // $item.trigger("click"); + // } + }); + } } diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts index 864f75083..dce65bd0e 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts @@ -236,6 +236,7 @@ describe(["@tier1"], "Source Analysis", () => { }), getRandomAnalysisData(this.analysisData["analysis_on_example-1-app"]) ); + cy.wait(2 * SEC); Application.open(); application.create(); applicationsList.push(application);