Skip to content

Commit

Permalink
(NT-77) Adjust focus test
Browse files Browse the repository at this point in the history
  • Loading branch information
s1hofmann committed Mar 18, 2024
1 parent 3f7fc49 commit 6d62a99
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/window-integration-tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,18 @@ describe("focusWindow", () => {
// WHEN
const secondApp = await electron.launch({args: ['second.js']});
const secondPage = await secondApp.firstWindow({timeout: APP_TIMEOUT});
const handle = await secondApp.browserWindow(secondPage);
await secondPage.waitForLoadState("domcontentloaded");
await handle.evaluate((win) => {
win.minimize();
win.restore();
win.focus();
});

const result = libnut.focusWindow(openWindowHandle);

// THEN
await sleep(1500);
const activeWindowHandle = libnut.getActiveWindow();
const activeWindowName = libnut.getWindowTitle(activeWindowHandle);
expect(activeWindowName).toBe(TITLE);
Expand Down

0 comments on commit 6d62a99

Please sign in to comment.