Skip to content

Commit 1309463

Browse files
committed
Added small timeouts to account for possibly slow window movement
1 parent c5db847 commit 1309463

File tree

1 file changed

+4
-0
lines changed
  • e2e/tests/packages/window-integration-tests

1 file changed

+4
-0
lines changed

e2e/tests/packages/window-integration-tests/test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {sleep} from "../../../../lib/sleep.function";
2+
13
const Application = require("spectron").Application;
24
const electronPath = require("electron");
35
const {getActiveWindow, getWindows} = require("@nut-tree/nut-js");
@@ -65,6 +67,7 @@ describe("getActiveWindow", () => {
6567
const xPosition = 42;
6668
const yPosition = 23;
6769
await app.browserWindow.setPosition(xPosition, yPosition);
70+
await sleep(1000);
6871

6972
// WHEN
7073
const foregroundWindow = await getActiveWindow();
@@ -80,6 +83,7 @@ describe("getActiveWindow", () => {
8083
const newWidth = 400;
8184
const newHeight = 350;
8285
await app.browserWindow.setSize(newWidth, newHeight);
86+
await sleep(1000);
8387

8488
// WHEN
8589
const foregroundWindow = await getActiveWindow();

0 commit comments

Comments
 (0)