Skip to content

Commit c5b12a7

Browse files
committed
Merge branch 'release/v1.2.1'
2 parents c333a7b + a6a837f commit c5b12a7

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
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";

package-lock.json

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nut-tree/nut-js",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"license": "Apache-2.0",
55
"main": "dist/index",
66
"typings": "dist/index",

0 commit comments

Comments
 (0)