Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
runtime: [ linux, mac ]
# Removing windows as a standard run flavor runtime: [ linux, mac, windows ]
targetVSCode: [previous, latest ]
targetVSCode: [latest]
buildTool: [maven, gradle]
# As Vscode 1.79 and 1.78 are the only support version for current release, running test with only latest,previous
#Enable it in future for multiple releases as applicable targetVSCode: [ previousMinusOne, previous, latest ]
Expand Down
2 changes: 1 addition & 1 deletion src/test/Gradle9TestDevModeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('Gradle 9-specific devmode action tests', () => {
* Closing the workspace ensures the next test file starts with a clean slate.
*/
after(async function() {
this.timeout(10000);
this.timeout(45000);
await utils.closeWorkspace();
});
});
2 changes: 1 addition & 1 deletion src/test/GradleTestDevModeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('Gradle-specific devmode action tests', () => {
* Closing the workspace ensures the next test file starts with a clean slate.
*/
after(async function() {
this.timeout(10000);
this.timeout(45000);
await utils.closeWorkspace();
});
});
2 changes: 1 addition & 1 deletion src/test/MavenTestDevModeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('Maven-specific devmode action tests', () => {
* The following after hook closes the workspace so the next test file starts with a clean slate.
*/
after(async function() {
this.timeout(10000);
this.timeout(45000);
await utils.closeWorkspace();
});
});
4 changes: 2 additions & 2 deletions src/test/shared/devModeTestSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
describe(`Devmode action tests for ${config.buildTool} Project`, () => {

before(async function() {
this.timeout(30000);
this.timeout(60000);

await VSBrowser.instance.openResources(config.getProjectPath());
await VSBrowser.instance.waitForWorkbench();
Expand All @@ -33,7 +33,7 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
});

afterEach(async function() {
this.timeout(10000); // Increase timeout for cleanup operations
this.timeout(30000);
// Close any open editors after each test
if (this.currentTest?.state === 'failed') {
await VSBrowser.instance.driver.takeScreenshot();
Expand Down
39 changes: 26 additions & 13 deletions src/test/utils/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright IBM Corp. 2023, 2026
*/
import path = require('path');
import { Workbench, InputBox, DefaultTreeItem, ModalDialog, VSBrowser, WaitHelper, BottomBarPanel, OutputView, DebugToolbar } from 'vscode-extension-tester';
import { Workbench, InputBox, DefaultTreeItem, ModalDialog, VSBrowser, WaitHelper, BottomBarPanel, OutputView, DebugToolbar, SideBarView } from 'vscode-extension-tester';
import * as fs from 'fs';
import { STOP_DASHBOARD_MAC_ACTION } from '../definitions/constants';
import { MapContextMenuforMac } from './macUtils';
Expand Down Expand Up @@ -198,20 +198,33 @@ export function getGradle9ProjectPath(): string {

export async function getDashboardSection(sidebar: any): Promise<any> {
logger.info("Getting Liberty Tools section");
return await waitForCondition(async () => {
// Get fresh content on each iteration to avoid stale references
const contentPart = sidebar.getContent();
const sections = await contentPart.getSections();

// Find the Liberty Tools section
for (const sec of sections) {
const title = await sec.getTitle();
if (title === 'Liberty Tools') {
return sec;
const wait = getWaitHelper();
return await wait.forCondition(async () => {
try {
// Re-create SideBarView on every iteration — the captured sidebar
// reference goes stale on workspace transitions and getSections()
// throws on every call, bypassing the retry loop.
const freshSidebar = new SideBarView();
const sections = await freshSidebar.getContent().getSections();
for (const sec of sections) {
const title = await sec.getTitle();
if (title === 'Liberty Tools') {
return sec;
}
}
} catch (error: any) {
if (error.name === 'StaleElementReferenceError' ||
error.name === 'ElementNotInteractableError') {
return;
}
throw error;
}
return;
}, 30);
}, {
timeout: 30000,
pollInterval: 3000,
message: 'Liberty Tools section was not found in sidebar within 30 seconds'
});
}

export async function getDashboardItem(section: any, projectName: string): Promise<DefaultTreeItem> {
Expand Down Expand Up @@ -489,7 +502,7 @@ export async function waitForDashboardToLoad(section: any): Promise<void> {
}
return;
}, {
timeout: 120000, // 2 minutes max
timeout: 180000, // 3 minutes max
Comment thread
siddhusaladi marked this conversation as resolved.
Outdated
pollInterval: 5000, // check every 5 seconds
message: 'Dashboard items did not load'
});
Expand Down
Loading