Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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/linuxUI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
sleep 3

- name: Set up JDK 21
Expand Down
19 changes: 19 additions & 0 deletions test/ui/command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ describe("Command Tests", function() {
await openProject(mavenProjectPath);
await openFile(mavenJavaFilePath);
await waitForLanguageServerReady();
// Close any lingering hover popup (e.g. language status) that could overlay the sidebar
await VSBrowser.instance.driver.actions().sendKeys(seleniumWebdriver.Key.ESCAPE).perform();
await clearNotificationsIfPresent();
});

after(async function() {
Expand Down Expand Up @@ -175,6 +178,8 @@ describe("Command Tests", function() {
});

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

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

async function clearNotificationsIfPresent() {
try {
const center = await new Workbench().openNotificationsCenter();
await center.clearAllNotifications();
await center.close();
} catch (_e) {
// No notifications or center not available — nothing to clear
}
}

async function waitForTreeItem(section: ViewSection, label: string, timeoutMs = 15000): Promise<TreeItem | undefined> {
const start = Date.now();
while (Date.now() - start < timeoutMs) {
Expand Down
Loading