Skip to content

Commit 3770438

Browse files
committed
test: fix ui test case on linux
1 parent 6fcc4ed commit 3770438

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/linuxUI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
sudo apt-get update
2020
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
21-
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
21+
sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
2222
sleep 3
2323
2424
- name: Set up JDK 21

test/ui/command.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ describe("Command Tests", function() {
8383
await openProject(mavenProjectPath);
8484
await openFile(mavenJavaFilePath);
8585
await waitForLanguageServerReady();
86+
// Close any lingering hover popup (e.g. language status) that could overlay the sidebar
87+
await VSBrowser.instance.driver.actions().sendKeys(seleniumWebdriver.Key.ESCAPE).perform();
88+
await clearNotificationsIfPresent();
8689
});
8790

8891
after(async function() {
@@ -175,6 +178,8 @@ describe("Command Tests", function() {
175178
});
176179

177180
(platform() === "darwin" ? it.skip : it)("Test java.view.package.revealInProjectExplorer", async function() {
181+
await dismissModalDialogIfPresent();
182+
await clearNotificationsIfPresent();
178183
// Make sure App.java is not currently revealed in Java Projects
179184
const section = await new SideBarView().getContent().getSection("Java Projects");
180185
const item = await section.findItem("my-app") as TreeItem;
@@ -334,6 +339,8 @@ async function collapseFileSection() {
334339
}
335340

336341
async function expandMainCodeInJavaProjects() {
342+
await dismissModalDialogIfPresent();
343+
await clearNotificationsIfPresent();
337344
const section = await new SideBarView().getContent().getSection("Java Projects");
338345
await section.click();
339346
const appNode = await section.findItem("my-app") as TreeItem;
@@ -348,6 +355,8 @@ async function expandMainCodeInJavaProjects() {
348355
async function expandInJavaProjects(label: string, ...otherLabels: string[]): Promise<[TreeItem, ViewSection]> {
349356
// Dismiss any lingering modal dialog that could block sidebar clicks
350357
await dismissModalDialogIfPresent();
358+
// Clear notification toasts that could overlay sidebar elements
359+
await clearNotificationsIfPresent();
351360
// Collapse file section to make sure that the AppToRename tree item fits in the current viewport.
352361
// .findItem will only find tree items in the current viewport.
353362
await collapseFileSection();
@@ -427,6 +436,16 @@ async function dismissModalDialogIfPresent() {
427436
}
428437
}
429438

439+
async function clearNotificationsIfPresent() {
440+
try {
441+
const center = await new Workbench().openNotificationsCenter();
442+
await center.clearAllNotifications();
443+
await center.close();
444+
} catch (_e) {
445+
// No notifications or center not available — nothing to clear
446+
}
447+
}
448+
430449
async function waitForTreeItem(section: ViewSection, label: string, timeoutMs = 15000): Promise<TreeItem | undefined> {
431450
const start = Date.now();
432451
while (Date.now() - start < timeoutMs) {

0 commit comments

Comments
 (0)