Skip to content

Commit aa09ce0

Browse files
authored
Merge pull request #72 from nut-tree/bugfix/70/drag_drop
Bugfix/70/drag drop
2 parents ac50f8a + 2a214c4 commit aa09ce0

File tree

5 files changed

+291
-287
lines changed

5 files changed

+291
-287
lines changed

e2e/assets/moved_trash.png

5.67 KB
Loading

e2e/assets/trash.png

4.12 KB
Loading

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)