mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
test(e2e): wait for the Run window to take focus before toggling it (#4900)
The tool-window shortcut hides a window only once it is active, and activation focuses it on the next frame; under load the test pressed Cmd+4 or Shift+Escape before that, so the window stayed open. The test now waits for focus inside the Run window first.
This commit is contained in:
@@ -71,12 +71,17 @@ test("⌘1 focuses, hides and re-shows the Project tool window", async ({ workbe
|
||||
|
||||
test("⌘4 toggles Run; Shift+Escape hides the active tool window", async ({ workbench: page }) => {
|
||||
const run = page.getByRole("region", { name: "Run" });
|
||||
// The shortcut hides the window only once it is active: activation focuses it a frame after it shows.
|
||||
const focusedInRun = () =>
|
||||
expect.poll(() => page.evaluate(() => !!document.activeElement?.closest('[data-toolwindow="run"]'))).toBe(true);
|
||||
await page.keyboard.press("Meta+4");
|
||||
await expect(run).toBeVisible();
|
||||
await focusedInRun();
|
||||
await page.keyboard.press("Meta+4");
|
||||
await expect(run).toBeHidden();
|
||||
await page.keyboard.press("Meta+4");
|
||||
await expect(run).toBeVisible();
|
||||
await focusedInRun();
|
||||
await page.keyboard.press("Shift+Escape");
|
||||
await expect(run).toBeHidden();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user