From 58dccc21c3b2df79292226e0c335451f4f5d7f66 Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Tue, 12 Aug 2025 18:41:00 +0300 Subject: [PATCH 1/4] Fix the title of Workspace Recommendations section in RecommendedExtensions test Signed-off-by: Dmytro Nochevnov --- .../dashboard-samples/RecommendedExtensions.spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts index 6010b59dc01..eb6b652f6bf 100644 --- a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts +++ b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts @@ -78,7 +78,7 @@ function getSectionForCategory(title: string): string { case '@outdated': return 'Outdated'; case '@recommended': - return 'Other Recommendations'; + return 'WORKSPACE RECOMMENDATIONS'; default: return 'Marketplace'; } @@ -120,6 +120,15 @@ async function findItem(extSection: ExtensionsViewSection, title: string): Promi const sections: WebElement[] = await enclosingItem.findElements((extSection as any).constructor.locators.ViewContent.section); Logger.debug(`Found ${sections.length} sections`); + // Debug: Log all available section titles + const availableSections: string[] = []; + for (const sec of sections) { + const titleElement: WebElement = await sec.findElement((extSection as any).constructor.locators.ViewSection.title); + const sectionTitleText: string = await titleElement.getText(); + availableSections.push(sectionTitleText); + } + Logger.debug(`Available sections: ${availableSections.join(', ')}`); + let targetSection: WebElement | undefined; for (const sec of sections) { const titleElement: WebElement = await sec.findElement((extSection as any).constructor.locators.ViewSection.title); @@ -132,7 +141,7 @@ async function findItem(extSection: ExtensionsViewSection, title: string): Promi } if (!targetSection) { - Logger.debug(`Section "${sectionTitle}" not found`); + Logger.debug(`Section "${sectionTitle}" not found. Available sections: ${availableSections.join(', ')}`); return undefined; } From ddba6f5ef3de50efe7f1f6d5198c991c5b33ed06 Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Fri, 15 Aug 2025 01:21:08 +0300 Subject: [PATCH 2/4] add debug information --- .../RecommendedExtensions.spec.ts | 49 +++++++++++++++---- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts index eb6b652f6bf..df7cbbf2500 100644 --- a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts +++ b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts @@ -120,7 +120,7 @@ async function findItem(extSection: ExtensionsViewSection, title: string): Promi const sections: WebElement[] = await enclosingItem.findElements((extSection as any).constructor.locators.ViewContent.section); Logger.debug(`Found ${sections.length} sections`); - // Debug: Log all available section titles + // debug: Log all available section titles const availableSections: string[] = []; for (const sec of sections) { const titleElement: WebElement = await sec.findElement((extSection as any).constructor.locators.ViewSection.title); @@ -189,15 +189,36 @@ async function getVisibleFilteredItemsAndCompareWithRecommended(recommendations: } } Logger.debug('marketplaceSection.getVisibleItems()'); - const allFoundRecommendedItems: ExtensionsViewItem[] = await marketplaceSection.getVisibleItems(); - const allFoundRecommendedAuthors: string[] = await Promise.all( - allFoundRecommendedItems.map(async (item: ExtensionsViewItem): Promise => await item.getAuthor()) - ); + // debug: Log all found recommended items + try { + const allFoundRecommendedItems: ExtensionsViewItem[] = await marketplaceSection.getVisibleItems(); + const itemTitles: string[] = await Promise.all( + allFoundRecommendedItems.map(async (item: ExtensionsViewItem): Promise => await item.getTitle()) + ); - const allFoundAuthorsAsSortedString: string = allFoundRecommendedAuthors.sort().toString(); - const allPublisherNamesAsSortedString: string = recommendations.sort().toString(); - return allFoundAuthorsAsSortedString === allPublisherNamesAsSortedString; + const allFoundRecommendedAuthors: string[] = await Promise.all( + allFoundRecommendedItems.map(async (item: ExtensionsViewItem): Promise => await item.getAuthor()) + ); + + Logger.debug(`Found ${allFoundRecommendedItems.length} recommended items: ${itemTitles.join(', ')}`); + Logger.debug(`Found authors: ${allFoundRecommendedAuthors.join(', ')}`); + Logger.debug(`Expected authors: ${recommendations.join(', ')}`); + + const allFoundAuthorsAsSortedString: string = allFoundRecommendedAuthors.sort().toString(); + const allPublisherNamesAsSortedString: string = recommendations.sort().toString(); + + Logger.debug(`Sorted found authors: ${allFoundAuthorsAsSortedString}`); + Logger.debug(`Sorted expected authors: ${allPublisherNamesAsSortedString}`); + + const result: boolean = allFoundAuthorsAsSortedString === allPublisherNamesAsSortedString; + Logger.debug(`Authors match: ${result}`); + + return result; + } catch (error) { + Logger.error(`Error getting item titles: ${error}`); + return false; + } } // get visible items from Extension view, transform this from array to sorted string and compares it with existed installed extensions @@ -398,8 +419,16 @@ for (const sample of samples) { } Logger.debug('extensionSection.findItem by @recommended filter'); - expect(await getVisibleFilteredItemsAndCompareWithRecommended(publisherNames)).to.be.true; - Logger.debug(`All recommended extensions were found by @recommended filter: ---- ${publisherNames} ----`); + try { + Logger.debug(`Expected publisher names: ${publisherNames.join(', ')}`); + const comparisonResult: boolean = await getVisibleFilteredItemsAndCompareWithRecommended(publisherNames); + Logger.debug(`Comparison result: ${comparisonResult}`); + expect(comparisonResult).to.be.true; + Logger.debug(`All recommended extensions were found by @recommended filter: ---- ${publisherNames} ----`); + } catch (error) { + Logger.error(`Error in getVisibleFilteredItemsAndCompareWithRecommended: ${error}`); + throw error; + } Logger.debug('extensionSection.findItem by @installed filter'); try { From 2611920086f683f34337f4856846a2c9b94e6421 Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Fri, 15 Aug 2025 12:53:38 +0300 Subject: [PATCH 3/4] Skip redhat.fabric8-analytics extension in DS 3.22.0 and higher Signed-off-by: Dmytro Nochevnov --- .../e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts index df7cbbf2500..c9bf5a88b23 100644 --- a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts +++ b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts @@ -328,10 +328,10 @@ for (const sample of samples) { Logger.debug('recommendedExtensions.recommendations: Get recommendations clear names using map().'); - // skip the test if only redhat.fabric8-analytics extension is found in Dev Spaces 3.22.x (issue CRW-9186) + // skip redhat.fabric8-analytics extension in Dev Spaces 3.22+ (issue CRW-9186) if ( BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME() === 'devspaces' && - BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION.startsWith('3.22') + BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION >= '3.22' ) { const dependencyAnalyticsExtensionName: string = 'redhat.fabric8-analytics'; if ( From a700f9c8a1486cac33eababe5509a9161963e5c0 Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Fri, 15 Aug 2025 17:33:55 +0300 Subject: [PATCH 4/4] Skip steps in 'Node.js Express' ReconnededExtension tests without failing the test suite --- .../dashboard-samples/RecommendedExtensions.spec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts index c9bf5a88b23..1dc228cc81a 100644 --- a/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts +++ b/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts @@ -253,6 +253,7 @@ for (const sample of samples) { let extensionSection: ExtensionsViewSection; let extensionsView: SideBarView | undefined; let publisherNames: string[]; + let skipSuite: boolean = false; const [pathToExtensionsListFileName, extensionsListFileName]: string[] = ['.vscode', 'extensions.json']; @@ -267,6 +268,12 @@ for (const sample of samples) { await loginTests.loginIntoChe(); }); + setup('Skip follow-up tests if flagged', function (): void { + if (skipSuite) { + this.skip(); + } + }); + test(`Create and open new workspace, stack:${sample}`, async function (): Promise { await workspaceHandlingTests.createAndOpenWorkspace(sample); }); @@ -338,9 +345,11 @@ for (const sample of samples) { recommendedExtensions.recommendations.includes(dependencyAnalyticsExtensionName) && recommendedExtensions.recommendations.length === 1 ) { - throw new Error( + Logger.info( `Only '${dependencyAnalyticsExtensionName}' extension found. This extension will not be installed because of known issue https://issues.redhat.com/browse/CRW-9186` ); + skipSuite = true; + this.skip(); } else { recommendedExtensions.recommendations = recommendedExtensions.recommendations.filter( (rec: string): boolean => !rec.includes(dependencyAnalyticsExtensionName)