Skip to content

Commit 4870135

Browse files
committed
(#70) Added e2e test for drag & drop
1 parent d1bb208 commit 4870135

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

index.e2e.spec.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert, centerOf, Key, keyboard, mouse, screen, sleep, straightTo } from "./index";
1+
import { assert, centerOf, down, Key, keyboard, mouse, Region, right, screen, sleep, straightTo } from "./index";
22

33
const openXfceMenu = async () => {
44
await mouse.move(straightTo(centerOf(screen.find("menu.png"))));
@@ -51,3 +51,16 @@ describe("E2E demo", () => {
5151
await close();
5252
});
5353
});
54+
55+
describe("E2E drag & drop demo", () => {
56+
it("should run without throwing", async () => {
57+
jest.setTimeout(60000);
58+
screen.config.resourceDirectory = "./e2e/assets";
59+
await assert.isVisible("trash.png");
60+
await mouse.move(straightTo(centerOf(screen.find("trash.png"))));
61+
await mouse.drag(down(500));
62+
await mouse.move(right(100));
63+
await mouse.leftClick();
64+
expect(await screen.find("moved_trash.png")).toEqual(new Region(38, 585, 70, 86));
65+
});
66+
});

0 commit comments

Comments
 (0)