Skip to content

Commit 8a38264

Browse files
committed
(#134) Restructured readme and added macOS permissions note
1 parent 81b5971 commit 8a38264

File tree

1 file changed

+85
-74
lines changed

1 file changed

+85
-74
lines changed

README.md

Lines changed: 85 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,48 @@ Native UI testing / automation with node.js
1919
It allows for native UI interactions via keyboard and / or mouse,
2020
but additionally gives you the possibility to navigate the screen based on image matching.
2121

22+
# Examples
23+
24+
[nut-tree/trailmix](https://github.com/nut-tree/trailmix) contains a set of ready to use examples which demo the usage ot nut.js.
25+
26+
# Modules
27+
28+
This list gives an overview on currently implemented and planned functionality.
29+
It's work in progress and will undergo constant modification.
30+
31+
## Clipboard
32+
33+
- [x] Copy text to clipboard
34+
- [x] Paste text from clipboard
35+
36+
## Keyboard
37+
38+
- [x] Support for standard US keyboard layout
39+
- [x] Support for German special characters
40+
41+
## Mouse
42+
43+
- [x] Support for mouse movement
44+
- [x] Support for mouse scroll
45+
- [x] Configurable movement speed
46+
- [x] Mouse drag
47+
48+
## Process
49+
50+
- [ ] Retrieve the region of a process window
51+
52+
## Screen
53+
54+
- [x] findOnScreen
55+
- [x] waitFor
56+
- [x] Hooks to trigger actions based on images
57+
- [x] Highlighting screen regions
58+
59+
## Integration
60+
61+
- [x] Jest
62+
- [x] Electron
63+
2264
# Sample
2365

2466
The following snippet shows a valid `nut.js` example (on macOS)
@@ -75,73 +117,31 @@ You can install them by running
75117
xcode-select --install
76118
```
77119

78-
#### Linux
79-
80-
Depending on your distribution, Linux setups may differ.
120+
**Attention**:
81121

82-
In general, `nut.js` requires
122+
In case you're experiencing problems like your mouse not moving or your keyboard not typing,
123+
please make sure to give the process you're executing your tests with accessibility permissions.
83124

84-
- libXtst
85-
86-
Installation on `*buntu` distributions:
87-
```bash
88-
sudo apt-get install libxtst-dev
89-
```
90-
91-
Setups on other distributions might differ.
92-
93-
## Manual build
94-
95-
As a fallback, `nut.js` is able to build all required dependencies by itself.
96-
To do so, some setup is required on the respective target platform.
125+
If an application wants to use accessibility features, a permission pop-up should be shown.
126+
If not, you could try to manually add the application you're running the script from.
97127

98-
#### Windows
99-
100-
In order to install `nut.js` on Windows, [Windows Build Tools](https://www.microsoft.com/en-us/download/details.aspx?id=48159) and [Python 2](https://www.python.org/downloads/windows/) are required.
101-
You can either set them up manually, or install them via npm:
102-
103-
```bash
104-
npm install --global windows-build-tools
105-
```
106-
107-
or
108-
109-
```bash
110-
yarn global add windows-build-tools
111-
```
112-
113-
#### macOS
114-
115-
On macOS, Xcode command line tools are required.
116-
You can install them by running
117-
```bash
118-
xcode-select --install
119-
```
128+
`Settings -> Security & Privacy -> Privacy -> Accessibility -> Add...`
120129

121130
#### Linux
122131

123132
Depending on your distribution, Linux setups may differ.
124133

125134
In general, `nut.js` requires
126135

127-
- Python 2
128-
- g++
129-
- make
130136
- libXtst
131-
- libPng
132137

133138
Installation on `*buntu` distributions:
134139
```bash
135-
sudo apt-get install build-essential python libxtst-dev libpng++-dev
140+
sudo apt-get install libxtst-dev
136141
```
137142

138143
Setups on other distributions might differ.
139144

140-
For reference, please see:
141-
142-
- [opencv4nodejs](https://github.com/justadudewhohacks/opencv4nodejs#how-to-install)
143-
- [robotjs](http://robotjs.io/docs/building)
144-
145145
## Install `nut.js`
146146

147147
Running
@@ -225,43 +225,54 @@ Next, we add a `rebuild` script to our `package.json`:
225225
Now all we have to do is run `npm run rebuild` and `electron-rebuild` will fetch the appropriate bindings for our Electron version.
226226
Currently `nut.js` provides bindings for all ABI version to work with Electron v4.x up to 8.x
227227

228-
# Examples
228+
### Manual build
229229

230-
[nut-tree/trailmix](https://github.com/nut-tree/trailmix) contains a set of ready to use examples which demo the usage ot nut.js.
230+
As a fallback, `nut.js` is able to build all required dependencies by itself.
231+
To do so, some setup is required on the respective target platform.
231232

232-
# Modules
233+
#### Windows
233234

234-
This list gives an overview on currently implemented and planned functionality.
235-
It's work in progress and will undergo constant modification.
235+
In order to install `nut.js` on Windows, [Windows Build Tools](https://www.microsoft.com/en-us/download/details.aspx?id=48159) and [Python 2](https://www.python.org/downloads/windows/) are required.
236+
You can either set them up manually, or install them via npm:
236237

237-
## Clipboard
238+
```bash
239+
npm install --global windows-build-tools
240+
```
238241

239-
- [x] Copy text to clipboard
240-
- [x] Paste text from clipboard
242+
or
241243

242-
## Keyboard
244+
```bash
245+
yarn global add windows-build-tools
246+
```
243247

244-
- [x] Support for standard US keyboard layout
245-
- [x] Support for German special characters
248+
#### macOS
246249

247-
## Mouse
250+
On macOS, Xcode command line tools are required.
251+
You can install them by running
252+
```bash
253+
xcode-select --install
254+
```
248255

249-
- [x] Support for mouse movement
250-
- [x] Support for mouse scroll
251-
- [x] Configurable movement speed
252-
- [x] Mouse drag
256+
#### Linux
253257

254-
## Process
258+
Depending on your distribution, Linux setups may differ.
255259

256-
- [ ] Retrieve the region of a process window
260+
In general, `nut.js` requires
257261

258-
## Screen
262+
- Python 2
263+
- g++
264+
- make
265+
- libXtst
266+
- libPng
259267

260-
- [x] findOnScreen
261-
- [x] waitFor
262-
- [x] Hooks to trigger actions based on images
263-
- [x] Highlighting screen regions
268+
Installation on `*buntu` distributions:
269+
```bash
270+
sudo apt-get install build-essential python libxtst-dev libpng++-dev
271+
```
264272

265-
## Integration
273+
Setups on other distributions might differ.
266274

267-
- [x] Jest
275+
For reference, please see:
276+
277+
- [opencv4nodejs](https://github.com/justadudewhohacks/opencv4nodejs#how-to-install)
278+
- [robotjs](http://robotjs.io/docs/building)

0 commit comments

Comments
 (0)