Skip to content

Commit 4a7b581

Browse files
committed
(#75) Exported Button
1 parent 85ff7fd commit 4a7b581

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

index.e2e.spec.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
import { assert, centerOf, down, Key, keyboard, mouse, Region, right, screen, sleep, straightTo } from "./index";
1+
import {
2+
assert,
3+
Button,
4+
centerOf,
5+
down,
6+
Key,
7+
keyboard,
8+
mouse,
9+
Region,
10+
right,
11+
screen,
12+
sleep,
13+
straightTo
14+
} from "./index";
215

316
const openXfceMenu = async () => {
417
await mouse.move(straightTo(centerOf(screen.find("menu.png"))));
@@ -64,3 +77,15 @@ describe("E2E drag & drop demo", () => {
6477
expect(await screen.find("moved_trash.png")).toEqual(new Region(38, 585, 70, 86));
6578
});
6679
});
80+
81+
describe("E2E mouse button demo", () => {
82+
it("should run without throwing", async () => {
83+
jest.setTimeout(60000);
84+
screen.config.resourceDirectory = "./e2e/assets";
85+
for (const btn of [Button.RIGHT, Button.MIDDLE, Button.LEFT]) {
86+
await mouse.pressButton(btn);
87+
await sleep(10);
88+
await mouse.releaseButton(btn);
89+
}
90+
});
91+
});

index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export { jestMatchers } from "./lib/expect/jest.matcher.function";
1212
export { sleep } from "./lib/sleep.function";
1313
export { Image } from "./lib/image.class";
1414
export { Key } from "./lib/key.enum";
15+
export { Button } from "./lib/button.enum";
1516
export { centerOf, randomPointIn } from "./lib/location.function";
1617
export { LocationParameters } from "./lib/locationparameters.class";
1718
export { linear } from "./lib/movementtype.function";

0 commit comments

Comments
 (0)