2019-03-05 20:04:36 +01:00
2018-11-08 21:56:38 +01:00
2019-03-05 20:04:36 +01:00
2019-03-05 19:29:01 +01:00
2018-12-08 11:07:45 +01:00
2018-11-08 11:09:05 +01:00
2018-11-08 21:56:38 +01:00
2019-03-05 11:56:08 +01:00
2019-03-05 19:29:01 +01:00
2019-03-05 10:50:26 +01:00
2018-11-10 23:47:15 +01:00
2019-02-20 01:50:25 +01:00
2019-02-20 01:50:25 +01:00
2019-02-18 21:44:07 +01:00
2019-02-19 09:57:22 +01:00
2018-12-07 10:18:02 +01:00

nut.js (Native UI Toolkit) Build Status Greenkeeper badge SonarCloud badge SonarCloud Coverage

Native UI testing / controlling with node.js


Built with Robot Built with opencv4nodejs

About

logo

This is a WIP implementation for a cross-platform native UI testing tool. It allows for native UI interactions via keyboard and / or mouse, but additionally gives you the possibility to navigate the screen based on image matching.

Sample

The following snippet shows a valid NUT example (on macOS)

"use strict";

const { keyboard, Key, mouse, movement } = require("@nut-tree/nut-js");

const square = async () => {
  await mouse.move(movement.right(500));
  await mouse.move(movement.down(500));
  await mouse.move(movement.left(500));
  await mouse.move(movement.up(500));
};

const openSpotlight = async () => {
  await keyboard.pressKey(Key.LeftSuper);
  await keyboard.pressKey(Key.Space);
  await keyboard.releaseKey(Key.Space);
  await keyboard.releaseKey(Key.LeftSuper);
};

describe("Basic test", () => {
  it("Should run a simple test", async () => {
    await square();
    await openSpotlight();
    await keyboard.type("calculator");
    await keyboard.type(Key.Return);
  });
});

Examples

nut-tree/trailmix contains a set of ready to use examples which demo the usage ot nut.js.

Modules

This list gives an overview on currently implemented and planned functionality. It's work in progress and will undergo constant modification.

Clipboard

  • Copy text to clipboard
  • Paste text from clipboard

Keyboard

  • Support for standard US keyboard layout
  • Support for German special characters

Mouse

  • Support for mouse movement
  • Support for mouse scroll
  • Configurable movement speed
  • Mouse drag

Process

  • Retrieve the region of a process window

Screen

  • findOnScreen
  • waitFor
  • Hooks to trigger actions based on images

Integration

  • Jest
S
Description
Native UI testing / controlling with node (supports windows ARM)
Readme 3.8 MiB
Languages
TypeScript 97.1%
JavaScript 2.6%
HTML 0.2%