-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from nut-tree/develop
release v0.1.0-beta.0
- Loading branch information
Showing
55 changed files
with
2,612 additions
and
2,657 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { assert, Key, keyboard, Location, mouse, movement, screen } from "./index"; | ||
|
||
const openXfceMenu = async () => { | ||
const menu = await screen.find("menu.png"); | ||
await mouse.move(await movement.straightTo(Location.centerOf(menu))); | ||
await mouse.leftClick(); | ||
await mouse.leftClick(); | ||
}; | ||
|
||
const run = async (cmd: string) => { | ||
await keyboard.type(Key.LeftAlt, Key.F2); | ||
await keyboard.type(cmd); | ||
await keyboard.type(Key.Enter); | ||
}; | ||
|
||
const calculate = async () => { | ||
const plus = await screen.find("plus.png"); | ||
await mouse.move(await movement.straightTo(Location.centerOf(plus))); | ||
await mouse.leftClick(); | ||
const one = await screen.find("one.png"); | ||
await mouse.move(await movement.straightTo(Location.centerOf(one))); | ||
await mouse.leftClick(); | ||
const zero = await screen.find("zero.png"); | ||
await mouse.move(await movement.straightTo(Location.centerOf(zero))); | ||
await mouse.leftClick(); | ||
await mouse.leftClick(); | ||
await keyboard.type(Key.Enter); | ||
}; | ||
|
||
const close = async () => { | ||
const x = await screen.find("close.png"); | ||
await mouse.move(await movement.straightTo(Location.centerOf(x))); | ||
await mouse.leftClick(); | ||
}; | ||
|
||
describe("E2E demo", () => { | ||
it("should run without throwing", async () => { | ||
jest.setTimeout(30000); | ||
screen.config.resourceDirectory = "./e2e/assets"; | ||
await assert.isVisible("mouse.png"); | ||
await assert.isVisible("desktop.png"); | ||
await openXfceMenu(); | ||
await run("gnome-calculator"); | ||
await assert.isVisible("calculator.png"); | ||
await keyboard.type("525"); | ||
await calculate(); | ||
await assert.isVisible("result.png"); | ||
await close(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.