appium-session-recorder 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -16
- package/package.json +1 -1
- package/src/server/routes.ts +14 -3
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ A modern Appium recorder and automation CLI with real-time UI visualization, ses
|
|
|
22
22
|
|
|
23
23
|
### Prerequisites
|
|
24
24
|
|
|
25
|
-
- [Bun](https://bun.sh/) runtime
|
|
25
|
+
- [Node.js](https://nodejs.org/) >= 18 or [Bun](https://bun.sh/) runtime
|
|
26
26
|
- [Appium](https://appium.io/) server installed
|
|
27
27
|
|
|
28
28
|
### Start Appium Server
|
|
@@ -38,14 +38,13 @@ The recorder proxy itself does not require `--allow-cors` for normal usage.
|
|
|
38
38
|
### Installation
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
|
|
42
|
-
bun install
|
|
41
|
+
npm i -g appium-session-recorder
|
|
43
42
|
```
|
|
44
43
|
|
|
45
44
|
### Run the CLI
|
|
46
45
|
|
|
47
46
|
```bash
|
|
48
|
-
|
|
47
|
+
appium-recorder
|
|
49
48
|
```
|
|
50
49
|
|
|
51
50
|
The CLI will interactively prompt you for:
|
|
@@ -56,13 +55,13 @@ The CLI will interactively prompt you for:
|
|
|
56
55
|
Alternatively, use command-line arguments:
|
|
57
56
|
|
|
58
57
|
```bash
|
|
59
|
-
|
|
58
|
+
appium-recorder --port 8080 --appium-url http://192.168.1.100:4723
|
|
60
59
|
```
|
|
61
60
|
|
|
62
61
|
Or run command mode (JSON output by default):
|
|
63
62
|
|
|
64
63
|
```bash
|
|
65
|
-
|
|
64
|
+
appium-recorder session create --appium-url http://127.0.0.1:4723 --caps-file ./caps.json --pretty
|
|
66
65
|
```
|
|
67
66
|
|
|
68
67
|
### Configure Appium Inspector
|
|
@@ -102,7 +101,7 @@ This project is intended for **local testing and development**. It runs an unaut
|
|
|
102
101
|
### Command Mode (JSON)
|
|
103
102
|
|
|
104
103
|
```bash
|
|
105
|
-
|
|
104
|
+
appium-recorder <group> <command> [flags]
|
|
106
105
|
```
|
|
107
106
|
|
|
108
107
|
Available command groups:
|
|
@@ -117,7 +116,7 @@ Global command flags:
|
|
|
117
116
|
|
|
118
117
|
- `--pretty` pretty-print JSON
|
|
119
118
|
- `--output <path>` persist JSON output to a file
|
|
120
|
-
- Legacy mode (`
|
|
119
|
+
- Legacy mode (`appium-recorder [legacy-options]`) does not accept `--pretty` or `--output`
|
|
121
120
|
|
|
122
121
|
### Agent Skill
|
|
123
122
|
|
|
@@ -139,17 +138,12 @@ appium --port 4723 --allow-cors
|
|
|
139
138
|
|
|
140
139
|
2. (Optional) Install skill globally for Codex:
|
|
141
140
|
|
|
142
|
-
```bash
|
|
143
|
-
mkdir -p ~/.codex/skills
|
|
144
|
-
cp -R ./skills/appium-cli-selector-navigator ~/.codex/skills/appium-cli-selector-navigator
|
|
145
|
-
```
|
|
146
|
-
|
|
147
141
|
```bash
|
|
148
142
|
mkdir -p ~/.claude/skills
|
|
149
143
|
cp -R ./skills/appium-cli-selector-navigator ~/.claude/skills/appium-cli-selector-navigator
|
|
150
144
|
```
|
|
151
145
|
|
|
152
|
-
Restart
|
|
146
|
+
Restart Claude after installing the global skill.
|
|
153
147
|
|
|
154
148
|
3. Create a capabilities file (example iOS Safari):
|
|
155
149
|
|
|
@@ -242,7 +236,7 @@ appium-recorder session delete \
|
|
|
242
236
|
### Legacy CLI Options (Backwards Compatible)
|
|
243
237
|
|
|
244
238
|
```bash
|
|
245
|
-
|
|
239
|
+
appium-recorder [options]
|
|
246
240
|
|
|
247
241
|
OPTIONS:
|
|
248
242
|
-p, --port <number> Proxy server port (default: 4724)
|
|
@@ -265,7 +259,7 @@ APPIUM_URL=http://192.168.1.100:4723
|
|
|
265
259
|
PROXY_PORT=8080
|
|
266
260
|
PROXY_HOST=127.0.0.1
|
|
267
261
|
|
|
268
|
-
|
|
262
|
+
appium-recorder
|
|
269
263
|
```
|
|
270
264
|
|
|
271
265
|
## 🎨 UI Features
|
|
@@ -297,6 +291,22 @@ bun run cli
|
|
|
297
291
|
|
|
298
292
|
## 🔧 Development
|
|
299
293
|
|
|
294
|
+
### Setup
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
git clone https://github.com/JustasMonkev/appium-session-recorder.git
|
|
298
|
+
cd appium-session-recorder
|
|
299
|
+
bun install
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Run from Source
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
bun run cli
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
This is equivalent to `appium-recorder` but runs directly from source. All examples in this README that use `appium-recorder` can be replaced with `bun run cli` during development.
|
|
309
|
+
|
|
300
310
|
### Build the UI
|
|
301
311
|
|
|
302
312
|
```bash
|
|
@@ -315,6 +325,14 @@ bun run dev
|
|
|
315
325
|
bun run cli
|
|
316
326
|
```
|
|
317
327
|
|
|
328
|
+
### Run Tests
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
bun run test # Run all tests
|
|
332
|
+
bun run test:watch # Watch mode
|
|
333
|
+
bun run test:coverage # With coverage
|
|
334
|
+
```
|
|
335
|
+
|
|
318
336
|
### Build for Production
|
|
319
337
|
|
|
320
338
|
```bash
|
package/package.json
CHANGED
package/src/server/routes.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import express, { Router } from 'express';
|
|
2
|
+
import fs from 'fs';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
4
5
|
import type { InteractionRecorder } from './interaction-recorder';
|
|
@@ -6,17 +7,27 @@ import type { InteractionRecorder } from './interaction-recorder';
|
|
|
6
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
8
|
const __dirname = path.dirname(__filename);
|
|
8
9
|
|
|
10
|
+
// Resolve UI dist path: works from both source (src/server/) and bundle (dist/)
|
|
11
|
+
function resolveUiDir(): string {
|
|
12
|
+
const candidates = [
|
|
13
|
+
path.join(__dirname, '../../dist/ui'), // dev: running from src/server/
|
|
14
|
+
path.join(__dirname, 'ui'), // prod: running from dist/
|
|
15
|
+
];
|
|
16
|
+
return candidates.find(p => fs.existsSync(p)) || candidates[0];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const uiDir = resolveUiDir();
|
|
20
|
+
|
|
9
21
|
export function createRoutes(recorder: InteractionRecorder) {
|
|
10
22
|
const router = Router();
|
|
11
23
|
|
|
12
24
|
// Serve the UI
|
|
13
25
|
router.get('/_recorder', (_req, res) => {
|
|
14
|
-
|
|
15
|
-
res.sendFile(uiPath);
|
|
26
|
+
res.sendFile(path.join(uiDir, 'index.html'));
|
|
16
27
|
});
|
|
17
28
|
|
|
18
29
|
// Serve static assets using express.static for better performance and caching
|
|
19
|
-
router.use('/_recorder/assets', express.static(path.join(
|
|
30
|
+
router.use('/_recorder/assets', express.static(path.join(uiDir, 'assets')));
|
|
20
31
|
|
|
21
32
|
// API: Get history
|
|
22
33
|
router.get('/_recorder/api/history', (_req, res) => {
|