From 0cf2f43e7ab7bf0438d525ceddeb7ff7563aa429 Mon Sep 17 00:00:00 2001 From: Scott J Dickerson Date: Fri, 28 Jun 2024 16:28:16 -0400 Subject: [PATCH] [RFR] Fix selecting language on analysis wizard, targets step Follow-up to #1136 To make sure the test does not unselected the desired target language that is automatically selected from the application's tags (language-discovery automatically adds tags when the application is created), switch from a `click` action to a `check` action. A bit more code is used to get to the input checkbox so the `check()` will work. Signed-off-by: Scott J Dickerson --- .../migration/applicationinventory/analysis.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/models/migration/applicationinventory/analysis.ts b/cypress/e2e/models/migration/applicationinventory/analysis.ts index f70162757..939187ece 100644 --- a/cypress/e2e/models/migration/applicationinventory/analysis.ts +++ b/cypress/e2e/models/migration/applicationinventory/analysis.ts @@ -163,10 +163,21 @@ export class Analysis extends Application { selectFormItems(sourceDropdown, source); } + /** + * Make sure our language is selected. It may already be selected if language-discovery + * added it, or if it was added manually. + */ public static selectLanguage(language: Languages) { cy.wait(2 * SEC); click(actionSelectToggle); - clickByText("div", language); + + // find the language's input checkbox and make sure it is checked + cy.get(`${actionSelectToggle} + .pf-v5-c-menu`) + .contains(language) + .closest(".pf-v5-c-menu__list-item") + .find("input[type=checkbox]") + .check(); + click(actionSelectToggle); } @@ -286,6 +297,8 @@ export class Analysis extends Application { return; } + console.log("starting analysis with", this); + this.startAnalysis(); }