@rickcedwhat/playwright-smart-vision 0.3.0-next.e6a6e47 → 0.4.0-next.32eee32
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/dist/author/apply.d.ts +2 -0
- package/dist/author/apply.d.ts.map +1 -1
- package/dist/author/apply.js +47 -2
- package/dist/author/apply.js.map +1 -1
- package/dist/author/author.test.js +19 -17
- package/dist/author/author.test.js.map +1 -1
- package/dist/author/catalog.d.ts +6 -0
- package/dist/author/catalog.d.ts.map +1 -1
- package/dist/author/catalog.js +41 -4
- package/dist/author/catalog.js.map +1 -1
- package/dist/author/detect.d.ts +4 -1
- package/dist/author/detect.d.ts.map +1 -1
- package/dist/author/detect.js +55 -6
- package/dist/author/detect.js.map +1 -1
- package/dist/author/geometry.d.ts +6 -0
- package/dist/author/geometry.d.ts.map +1 -1
- package/dist/author/geometry.js.map +1 -1
- package/dist/author/index.d.ts +2 -2
- package/dist/author/index.d.ts.map +1 -1
- package/dist/author/index.js +1 -1
- package/dist/author/index.js.map +1 -1
- package/dist/author/labels.d.ts +8 -0
- package/dist/author/labels.d.ts.map +1 -1
- package/dist/author/labels.js +41 -4
- package/dist/author/labels.js.map +1 -1
- package/dist/author/options.d.ts +2 -1
- package/dist/author/options.d.ts.map +1 -1
- package/dist/author/options.js +34 -10
- package/dist/author/options.js.map +1 -1
- package/dist/configure.d.ts +10 -0
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +4 -0
- package/dist/configure.js.map +1 -1
- package/dist/element.d.ts +71 -5
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +164 -34
- package/dist/element.js.map +1 -1
- package/dist/element.test.js +122 -1
- package/dist/element.test.js.map +1 -1
- package/dist/field-extractor.d.ts.map +1 -1
- package/dist/field-extractor.js +3 -2
- package/dist/field-extractor.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/presets.d.ts +52 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +63 -0
- package/dist/presets.js.map +1 -0
- package/dist/screen-api.d.ts +1 -1
- package/dist/screen-api.d.ts.map +1 -1
- package/dist/screen-api.js.map +1 -1
- package/dist/screen-api.test.d.ts +2 -0
- package/dist/screen-api.test.d.ts.map +1 -0
- package/dist/screen-api.test.js +42 -0
- package/dist/screen-api.test.js.map +1 -0
- package/dist/screen-handler.d.ts +31 -0
- package/dist/screen-handler.d.ts.map +1 -0
- package/dist/screen-handler.js +138 -0
- package/dist/screen-handler.js.map +1 -0
- package/dist/screen-handler.test.d.ts +2 -0
- package/dist/screen-handler.test.d.ts.map +1 -0
- package/dist/screen-handler.test.js +206 -0
- package/dist/screen-handler.test.js.map +1 -0
- package/dist/screen-result.d.ts +35 -0
- package/dist/screen-result.d.ts.map +1 -1
- package/dist/screen-result.js +103 -6
- package/dist/screen-result.js.map +1 -1
- package/dist/screen-result.test.d.ts +2 -0
- package/dist/screen-result.test.d.ts.map +1 -0
- package/dist/screen-result.test.js +71 -0
- package/dist/screen-result.test.js.map +1 -0
- package/dist/screen.d.ts +49 -10
- package/dist/screen.d.ts.map +1 -1
- package/dist/screen.js +67 -14
- package/dist/screen.js.map +1 -1
- package/dist/strategies.d.ts +114 -0
- package/dist/strategies.d.ts.map +1 -0
- package/dist/strategies.js +179 -0
- package/dist/strategies.js.map +1 -0
- package/dist/strategies.test.d.ts +2 -0
- package/dist/strategies.test.d.ts.map +1 -0
- package/dist/strategies.test.js +181 -0
- package/dist/strategies.test.js.map +1 -0
- package/dist/text-element.d.ts +70 -0
- package/dist/text-element.d.ts.map +1 -0
- package/dist/text-element.js +239 -0
- package/dist/text-element.js.map +1 -0
- package/dist/text-element.test.d.ts +2 -0
- package/dist/text-element.test.d.ts.map +1 -0
- package/dist/text-element.test.js +162 -0
- package/dist/text-element.test.js.map +1 -0
- package/dist/typed-screen.d.ts +6 -13
- package/dist/typed-screen.d.ts.map +1 -1
- package/dist/typed-screen.js +5 -9
- package/dist/typed-screen.js.map +1 -1
- package/dist/unhover.d.ts +10 -2
- package/dist/unhover.d.ts.map +1 -1
- package/dist/unhover.js +11 -2
- package/dist/unhover.js.map +1 -1
- package/dist/unhover.test.js +32 -2
- package/dist/unhover.test.js.map +1 -1
- package/dist/utils/ocr.d.ts +46 -9
- package/dist/utils/ocr.d.ts.map +1 -1
- package/dist/utils/ocr.js +80 -13
- package/dist/utils/ocr.js.map +1 -1
- package/dist/utils/ocr.test.js +95 -2
- package/dist/utils/ocr.test.js.map +1 -1
- package/package.json +1 -1
package/dist/screen.d.ts
CHANGED
|
@@ -2,24 +2,49 @@ import type { Page, TestType } from '@playwright/test';
|
|
|
2
2
|
import type { ScreenConfig } from './screen-config.js';
|
|
3
3
|
import { FieldExtractor } from './field-extractor.js';
|
|
4
4
|
import { ScreenResult } from './screen-result.js';
|
|
5
|
-
import { type
|
|
5
|
+
import { type FieldRead } from './utils/ocr.js';
|
|
6
|
+
import { Strategies, type ClickStrategy, type FillStrategy, type HoverStrategy, type DblClickStrategy, type CaptureStrategy, type OcrStrategy } from './strategies.js';
|
|
6
7
|
export interface BindOcrScreenOptions {
|
|
7
8
|
shotDir?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Show live match outlines while waiting/asserting.
|
|
11
|
+
* Default inherits `init({ overlay })`.
|
|
12
|
+
*/
|
|
8
13
|
overlay?: boolean;
|
|
9
14
|
/**
|
|
10
15
|
* Override `init({ unhoverBeforeCapture })` for this screen.
|
|
11
16
|
* Default inherits global config (true when unset).
|
|
12
17
|
*/
|
|
13
18
|
unhover?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Override `init({ read })` for this screen.
|
|
21
|
+
* Default inherits the init-level read mode.
|
|
22
|
+
*/
|
|
23
|
+
read?: FieldRead;
|
|
24
|
+
/**
|
|
25
|
+
* When false, returns the ScreenResult synchronously without waiting.
|
|
26
|
+
* Default is to wait — `await screen(name)` resolves after `waitFor()`.
|
|
27
|
+
*/
|
|
28
|
+
wait?: boolean;
|
|
14
29
|
}
|
|
15
30
|
/** Warm OCR + OpenCV (safe to call more than once). */
|
|
16
31
|
export declare function ensureOcrRuntime(): Promise<void>;
|
|
17
32
|
/** New extractor for a Playwright fixture scope. */
|
|
18
33
|
export declare function createOcrExtractor(): Promise<FieldExtractor>;
|
|
19
34
|
export declare function bindOcrScreen(page: Page, config: ScreenConfig, extractor: FieldExtractor, shotDir: string, options?: BindOcrScreenOptions): ScreenResult;
|
|
20
|
-
export interface
|
|
21
|
-
charsets
|
|
35
|
+
export interface InitStrategies {
|
|
36
|
+
/** OCR configuration: charsets, inference map, global swaps, default charset, read mode. */
|
|
37
|
+
ocr?: OcrStrategy;
|
|
38
|
+
/** Interaction strategies for click, fill, hover, and double-click. */
|
|
39
|
+
actions?: {
|
|
40
|
+
click?: ClickStrategy;
|
|
41
|
+
fill?: FillStrategy;
|
|
42
|
+
hover?: HoverStrategy;
|
|
43
|
+
dblclick?: DblClickStrategy;
|
|
44
|
+
};
|
|
45
|
+
capture?: CaptureStrategy;
|
|
22
46
|
}
|
|
47
|
+
export { Strategies, type OcrStrategy, type ClickStrategy, type FillStrategy, type HoverStrategy, type DblClickStrategy, type CaptureStrategy };
|
|
23
48
|
interface InitOptions {
|
|
24
49
|
page: Page;
|
|
25
50
|
storage?: {
|
|
@@ -27,7 +52,19 @@ interface InitOptions {
|
|
|
27
52
|
};
|
|
28
53
|
devtools?: boolean;
|
|
29
54
|
unhoverBeforeCapture?: boolean;
|
|
30
|
-
|
|
55
|
+
/** Global overlay default. Per-screen `{ overlay }` still wins. */
|
|
56
|
+
overlay?: boolean;
|
|
57
|
+
/** Environment-level read override. Wins over index.json; call site wins over this. */
|
|
58
|
+
read?: FieldRead;
|
|
59
|
+
/**
|
|
60
|
+
* Override the default unhover destination (top-left corner).
|
|
61
|
+
* Useful when the top-left corner overlaps interactive content.
|
|
62
|
+
*/
|
|
63
|
+
unhoverPoint?: {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
};
|
|
67
|
+
strategies?: InitStrategies;
|
|
31
68
|
}
|
|
32
69
|
/**
|
|
33
70
|
* Warm OCR/CV, configure the page and storage root, and make `screen()` sync.
|
|
@@ -38,13 +75,16 @@ interface InitOptions {
|
|
|
38
75
|
*/
|
|
39
76
|
export declare function init(options: InitOptions): Promise<void>;
|
|
40
77
|
/**
|
|
41
|
-
* Bind a screen to the page set by `init()
|
|
42
|
-
*
|
|
78
|
+
* Bind a screen to the page set by `init()` and wait for it to appear.
|
|
79
|
+
* Pass `{ wait: false }` to skip waiting and get the result synchronously.
|
|
43
80
|
*
|
|
44
|
-
* const customerInfo = screen('customer-info');
|
|
45
|
-
*
|
|
81
|
+
* const customerInfo = await screen('customer-info');
|
|
82
|
+
* const s = screen('service', { wait: false }); // already visible
|
|
46
83
|
*/
|
|
47
|
-
export declare function screen(nameOrConfig: string | ScreenConfig, options
|
|
84
|
+
export declare function screen(nameOrConfig: string | ScreenConfig, options: BindOcrScreenOptions & {
|
|
85
|
+
wait: false;
|
|
86
|
+
}): ScreenResult;
|
|
87
|
+
export declare function screen(nameOrConfig: string | ScreenConfig, options?: BindOcrScreenOptions): Promise<ScreenResult>;
|
|
48
88
|
/** Release shared OCR/CV resources. Optional — registered automatically by init(). */
|
|
49
89
|
export declare function release(): Promise<void>;
|
|
50
90
|
/** @deprecated Use release() */
|
|
@@ -72,5 +112,4 @@ interface ScreenWorkerFixtures {
|
|
|
72
112
|
* test.use({ ocrOverlay: true });
|
|
73
113
|
*/
|
|
74
114
|
export declare function createFixture(): TestType<ScreenFixtures, ScreenWorkerFixtures>;
|
|
75
|
-
export {};
|
|
76
115
|
//# sourceMappingURL=screen.d.ts.map
|
package/dist/screen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../src/screen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sour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AgB,gBAAU,CAAC;AAIxC,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,KAAK,YAAY,CAAC;AAE5E,UAAU,cAAc;IACtB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,oBAAoB;IAC5B,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,IAAI,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAsC9E"}
|
package/dist/screen.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { loadScreen, clearConfigUnhoverPoint, configure } from './configure.js';
|
|
5
|
+
import { clearScreenHandlers } from './screen-handler.js';
|
|
6
6
|
import { FieldExtractor } from './field-extractor.js';
|
|
7
7
|
import { ScreenResult } from './screen-result.js';
|
|
8
|
-
import { cleanupOCR, getOCRUtil,
|
|
8
|
+
import { cleanupOCR, getOCRUtil, setOcrStrategy, getOcrStrategy } from './utils/ocr.js';
|
|
9
|
+
import { setUnhoverPoint } from './unhover.js';
|
|
9
10
|
import { ensureCvReady } from './utils/vision.js';
|
|
11
|
+
import { Strategies, setClickStrategy, setFillStrategy, setHoverStrategy, setDblClickStrategy, } from './strategies.js';
|
|
10
12
|
/** Warm OCR + OpenCV (safe to call more than once). */
|
|
11
13
|
export async function ensureOcrRuntime() {
|
|
12
14
|
await Promise.all([getOCRUtil(), ensureCvReady()]);
|
|
@@ -20,8 +22,10 @@ export function bindOcrScreen(page, config, extractor, shotDir, options = {}) {
|
|
|
20
22
|
return ScreenResult.bind(page, extractor, config, shotDir, {
|
|
21
23
|
...(options.overlay !== undefined && { overlay: options.overlay }),
|
|
22
24
|
...(options.unhover !== undefined && { unhover: options.unhover }),
|
|
25
|
+
...(options.read !== undefined && { initRead: options.read }),
|
|
23
26
|
});
|
|
24
27
|
}
|
|
28
|
+
export { Strategies };
|
|
25
29
|
let initState = null;
|
|
26
30
|
let exitHandlerRegistered = false;
|
|
27
31
|
function defaultShotDir() {
|
|
@@ -45,8 +49,40 @@ export async function init(options) {
|
|
|
45
49
|
else {
|
|
46
50
|
initState.config = { ...initState.config, ...options };
|
|
47
51
|
}
|
|
48
|
-
if (options.
|
|
49
|
-
|
|
52
|
+
if (options.unhoverPoint !== undefined) {
|
|
53
|
+
setUnhoverPoint(options.unhoverPoint);
|
|
54
|
+
}
|
|
55
|
+
if (options.strategies?.capture !== undefined) {
|
|
56
|
+
const cap = options.strategies.capture;
|
|
57
|
+
initState.config.unhoverBeforeCapture = cap.unhover;
|
|
58
|
+
if (cap.unhoverPoint !== undefined)
|
|
59
|
+
setUnhoverPoint(cap.unhoverPoint);
|
|
60
|
+
}
|
|
61
|
+
if (options.strategies?.actions?.click !== undefined) {
|
|
62
|
+
setClickStrategy(options.strategies.actions.click);
|
|
63
|
+
}
|
|
64
|
+
if (options.strategies?.actions?.fill !== undefined) {
|
|
65
|
+
setFillStrategy(options.strategies.actions.fill);
|
|
66
|
+
}
|
|
67
|
+
if (options.strategies?.actions?.hover !== undefined) {
|
|
68
|
+
setHoverStrategy(options.strategies.actions.hover);
|
|
69
|
+
}
|
|
70
|
+
if (options.strategies?.actions?.dblclick !== undefined) {
|
|
71
|
+
setDblClickStrategy(options.strategies.actions.dblclick);
|
|
72
|
+
}
|
|
73
|
+
if (options.strategies?.ocr !== undefined) {
|
|
74
|
+
const existing = getOcrStrategy();
|
|
75
|
+
const next = options.strategies.ocr;
|
|
76
|
+
const merged = existing
|
|
77
|
+
? {
|
|
78
|
+
...existing,
|
|
79
|
+
...next,
|
|
80
|
+
...(next.charsets && existing.charsets
|
|
81
|
+
? { charsets: { ...existing.charsets, ...next.charsets } }
|
|
82
|
+
: {}),
|
|
83
|
+
}
|
|
84
|
+
: next;
|
|
85
|
+
setOcrStrategy(merged);
|
|
50
86
|
}
|
|
51
87
|
try {
|
|
52
88
|
await options.page.context().grantPermissions(['clipboard-read', 'clipboard-write']);
|
|
@@ -54,6 +90,9 @@ export async function init(options) {
|
|
|
54
90
|
catch {
|
|
55
91
|
// clipboard is optional until a field sets read: 'clipboard'
|
|
56
92
|
}
|
|
93
|
+
if (options.storage) {
|
|
94
|
+
await configure({ storage: options.storage });
|
|
95
|
+
}
|
|
57
96
|
if (options.devtools) {
|
|
58
97
|
const { injectDevtools } = await import('./devtools.js');
|
|
59
98
|
await injectDevtools(options.page);
|
|
@@ -65,13 +104,6 @@ export async function init(options) {
|
|
|
65
104
|
});
|
|
66
105
|
}
|
|
67
106
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Bind a screen to the page set by `init()`.
|
|
70
|
-
* Sync after `init()` has been called.
|
|
71
|
-
*
|
|
72
|
-
* const customerInfo = screen('customer-info');
|
|
73
|
-
* await customerInfo.element('customerNumber').toHaveValue('SEA314535');
|
|
74
|
-
*/
|
|
75
107
|
export function screen(nameOrConfig, options = {}) {
|
|
76
108
|
if (!initState) {
|
|
77
109
|
const name = typeof nameOrConfig === 'string' ? nameOrConfig : nameOrConfig.name;
|
|
@@ -82,13 +114,30 @@ export function screen(nameOrConfig, options = {}) {
|
|
|
82
114
|
if (mergedOptions.unhover === undefined && initState.config.unhoverBeforeCapture !== undefined) {
|
|
83
115
|
mergedOptions.unhover = initState.config.unhoverBeforeCapture;
|
|
84
116
|
}
|
|
85
|
-
|
|
117
|
+
if (mergedOptions.overlay === undefined && initState.config.overlay !== undefined) {
|
|
118
|
+
mergedOptions.overlay = initState.config.overlay;
|
|
119
|
+
}
|
|
120
|
+
if (mergedOptions.read === undefined && initState.config.read !== undefined) {
|
|
121
|
+
mergedOptions.read = initState.config.read;
|
|
122
|
+
}
|
|
123
|
+
const result = bindOcrScreen(initState.config.page, config, initState.extractor, options.shotDir ?? initState.shotDir, mergedOptions);
|
|
124
|
+
if (options.wait === false) {
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
return result.waitFor().then(() => result);
|
|
86
128
|
}
|
|
87
129
|
/** Release shared OCR/CV resources. Optional — registered automatically by init(). */
|
|
88
130
|
export async function release() {
|
|
89
131
|
initState?.extractor.cleanup();
|
|
90
132
|
initState = null;
|
|
91
|
-
|
|
133
|
+
setUnhoverPoint(undefined);
|
|
134
|
+
clearConfigUnhoverPoint();
|
|
135
|
+
clearScreenHandlers();
|
|
136
|
+
setClickStrategy(undefined);
|
|
137
|
+
setFillStrategy(undefined);
|
|
138
|
+
setHoverStrategy(undefined);
|
|
139
|
+
setDblClickStrategy(undefined);
|
|
140
|
+
setOcrStrategy(undefined);
|
|
92
141
|
await cleanupOCR();
|
|
93
142
|
}
|
|
94
143
|
/** @deprecated Use release() */
|
|
@@ -108,6 +157,10 @@ export const releaseOcrScreen = release;
|
|
|
108
157
|
* test.use({ ocrOverlay: true });
|
|
109
158
|
*/
|
|
110
159
|
export function createFixture() {
|
|
160
|
+
// Dynamic import so @playwright/test is not required at module load time
|
|
161
|
+
// (it is an optional peer — QA Wolf flows use init()/screen() without fixtures)
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
163
|
+
const { test: base } = require('@playwright/test');
|
|
111
164
|
return base.extend({
|
|
112
165
|
_ocrReady: [
|
|
113
166
|
async ({}, use) => {
|
package/dist/screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../src/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../src/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,O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AC;YACjD,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3C,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;gBACtB,MAAM,MAAM,GAAG,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACjF,OAAO,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YAClF,CAAC,CAAC,CAAC;YACH,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;KACF,CAA8D,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
import type { Rect } from './types.js';
|
|
3
|
+
import type { OcrStrategy } from './utils/ocr.js';
|
|
4
|
+
export type { OcrStrategy };
|
|
5
|
+
export interface ClickStrategy {
|
|
6
|
+
/** Returns the point to click within the element's bounding rect. */
|
|
7
|
+
getPoint(rect: Rect): {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface FillStrategy {
|
|
13
|
+
/** Full fill sequence: focus, select, type. Owns all keyboard/mouse steps. */
|
|
14
|
+
fill(page: Page, rect: Rect, text: string): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface HoverStrategy {
|
|
17
|
+
/** Full hover lifetime: move to the element, wait, done. */
|
|
18
|
+
hover(page: Page, rect: Rect): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export interface DblClickStrategy {
|
|
21
|
+
/** Full double-click lifetime. */
|
|
22
|
+
dblclick(page: Page, rect: Rect): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export interface CaptureStrategy {
|
|
25
|
+
unhover: boolean;
|
|
26
|
+
unhoverPoint?: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export declare function setClickStrategy(s: ClickStrategy | undefined): void;
|
|
32
|
+
export declare function setFillStrategy(s: FillStrategy | undefined): void;
|
|
33
|
+
export declare function setHoverStrategy(s: HoverStrategy | undefined): void;
|
|
34
|
+
export declare function setDblClickStrategy(s: DblClickStrategy | undefined): void;
|
|
35
|
+
export declare function getClickStrategy(): ClickStrategy;
|
|
36
|
+
export declare function getFillStrategy(): FillStrategy;
|
|
37
|
+
export declare function getHoverStrategy(): HoverStrategy | undefined;
|
|
38
|
+
export declare function getDblClickStrategy(): DblClickStrategy | undefined;
|
|
39
|
+
export declare const Strategies: {
|
|
40
|
+
Ocr: {
|
|
41
|
+
/** Create an Ocr strategy with global charset defaults, name-inference, and swaps. */
|
|
42
|
+
default(options: OcrStrategy): OcrStrategy;
|
|
43
|
+
};
|
|
44
|
+
Click: {
|
|
45
|
+
/** Click the center of the element rect. Default behavior. */
|
|
46
|
+
center(): ClickStrategy;
|
|
47
|
+
/**
|
|
48
|
+
* Click at a fractional offset within the element rect.
|
|
49
|
+
* `{ x: 0, y: 0.5 }` → left-center; `{ x: 0.5, y: 0.5 }` → center.
|
|
50
|
+
*/
|
|
51
|
+
offset(pct: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
}): ClickStrategy;
|
|
55
|
+
/** Click at a custom point derived from the rect. */
|
|
56
|
+
point(fn: (rect: Rect) => {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
}): ClickStrategy;
|
|
60
|
+
};
|
|
61
|
+
Fill: {
|
|
62
|
+
/** Click → Ctrl/Cmd+A → Backspace → insertText. Default behavior. */
|
|
63
|
+
selectAllType(): FillStrategy;
|
|
64
|
+
/**
|
|
65
|
+
* Triple-click (selects all in remote/Guacamole envs) → insertText.
|
|
66
|
+
* Preferred over selectAllType for environments that don't relay Ctrl+A.
|
|
67
|
+
*/
|
|
68
|
+
tripleClickType(): FillStrategy;
|
|
69
|
+
/** Click → Ctrl/Cmd+A → Backspace → keyboard.type (slower, fires key events). */
|
|
70
|
+
clearAndType(): FillStrategy;
|
|
71
|
+
/** Type into the currently focused element without clicking or clearing. */
|
|
72
|
+
typeOnly(): FillStrategy;
|
|
73
|
+
/**
|
|
74
|
+
* Click to focus, then type one character at a time with a delay.
|
|
75
|
+
* Use in environments where rapid key events are dropped.
|
|
76
|
+
*/
|
|
77
|
+
charByChar(options: {
|
|
78
|
+
delay: number;
|
|
79
|
+
}): FillStrategy;
|
|
80
|
+
/** Click to focus, then use insertText without selecting/clearing first. */
|
|
81
|
+
insertText(): FillStrategy;
|
|
82
|
+
};
|
|
83
|
+
Hover: {
|
|
84
|
+
/**
|
|
85
|
+
* Hover over the element for `ms` milliseconds, then resolve.
|
|
86
|
+
* Use in environments where hover-triggered UI needs time to appear
|
|
87
|
+
* (tooltips, dropdowns) before the next action.
|
|
88
|
+
*/
|
|
89
|
+
withDelay(ms: number): HoverStrategy;
|
|
90
|
+
/** Hover over the element with no additional delay. */
|
|
91
|
+
default(): HoverStrategy;
|
|
92
|
+
};
|
|
93
|
+
DblClick: {
|
|
94
|
+
/** Double-click the center of the element rect. Default behavior. */
|
|
95
|
+
default(): DblClickStrategy;
|
|
96
|
+
/**
|
|
97
|
+
* Double-click with a delay between the two clicks.
|
|
98
|
+
* Use in remote desktop environments where rapid clicks may not register.
|
|
99
|
+
*/
|
|
100
|
+
withDelay(ms: number): DblClickStrategy;
|
|
101
|
+
};
|
|
102
|
+
Capture: {
|
|
103
|
+
/** Move the mouse to a neutral corner before OCR screenshots. Default behavior. */
|
|
104
|
+
unhover(options?: {
|
|
105
|
+
point?: {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
};
|
|
109
|
+
}): CaptureStrategy;
|
|
110
|
+
/** Skip the unhover mouse move before capture. */
|
|
111
|
+
noop(): CaptureStrategy;
|
|
112
|
+
};
|
|
113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E,kDAAkD;gBAC1C,eAAe;;CAI1B,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// ─── Module-level state ───────────────────────────────────────────────────────
|
|
2
|
+
let globalClickStrategy;
|
|
3
|
+
let globalFillStrategy;
|
|
4
|
+
let globalHoverStrategy;
|
|
5
|
+
let globalDblClickStrategy;
|
|
6
|
+
export function setClickStrategy(s) {
|
|
7
|
+
globalClickStrategy = s;
|
|
8
|
+
}
|
|
9
|
+
export function setFillStrategy(s) {
|
|
10
|
+
globalFillStrategy = s;
|
|
11
|
+
}
|
|
12
|
+
export function setHoverStrategy(s) {
|
|
13
|
+
globalHoverStrategy = s;
|
|
14
|
+
}
|
|
15
|
+
export function setDblClickStrategy(s) {
|
|
16
|
+
globalDblClickStrategy = s;
|
|
17
|
+
}
|
|
18
|
+
export function getClickStrategy() {
|
|
19
|
+
return globalClickStrategy ?? Strategies.Click.center();
|
|
20
|
+
}
|
|
21
|
+
export function getFillStrategy() {
|
|
22
|
+
return globalFillStrategy ?? Strategies.Fill.selectAllType();
|
|
23
|
+
}
|
|
24
|
+
export function getHoverStrategy() {
|
|
25
|
+
return globalHoverStrategy;
|
|
26
|
+
}
|
|
27
|
+
export function getDblClickStrategy() {
|
|
28
|
+
return globalDblClickStrategy;
|
|
29
|
+
}
|
|
30
|
+
// ─── Strategies namespace ─────────────────────────────────────────────────────
|
|
31
|
+
export const Strategies = {
|
|
32
|
+
Ocr: {
|
|
33
|
+
/** Create an Ocr strategy with global charset defaults, name-inference, and swaps. */
|
|
34
|
+
default(options) {
|
|
35
|
+
return options;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
Click: {
|
|
39
|
+
/** Click the center of the element rect. Default behavior. */
|
|
40
|
+
center() {
|
|
41
|
+
return { getPoint: (r) => ({ x: r.x + r.width / 2, y: r.y + r.height / 2 }) };
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Click at a fractional offset within the element rect.
|
|
45
|
+
* `{ x: 0, y: 0.5 }` → left-center; `{ x: 0.5, y: 0.5 }` → center.
|
|
46
|
+
*/
|
|
47
|
+
offset(pct) {
|
|
48
|
+
return { getPoint: (r) => ({ x: r.x + r.width * pct.x, y: r.y + r.height * pct.y }) };
|
|
49
|
+
},
|
|
50
|
+
/** Click at a custom point derived from the rect. */
|
|
51
|
+
point(fn) {
|
|
52
|
+
return { getPoint: fn };
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
Fill: {
|
|
56
|
+
/** Click → Ctrl/Cmd+A → Backspace → insertText. Default behavior. */
|
|
57
|
+
selectAllType() {
|
|
58
|
+
return {
|
|
59
|
+
async fill(page, rect, text) {
|
|
60
|
+
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2);
|
|
61
|
+
await page.keyboard.press('ControlOrMeta+A');
|
|
62
|
+
await page.keyboard.press('Backspace');
|
|
63
|
+
await page.keyboard.insertText(text);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Triple-click (selects all in remote/Guacamole envs) → insertText.
|
|
69
|
+
* Preferred over selectAllType for environments that don't relay Ctrl+A.
|
|
70
|
+
*/
|
|
71
|
+
tripleClickType() {
|
|
72
|
+
return {
|
|
73
|
+
async fill(page, rect, text) {
|
|
74
|
+
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2, { clickCount: 3 });
|
|
75
|
+
await page.keyboard.insertText(text);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
/** Click → Ctrl/Cmd+A → Backspace → keyboard.type (slower, fires key events). */
|
|
80
|
+
clearAndType() {
|
|
81
|
+
return {
|
|
82
|
+
async fill(page, rect, text) {
|
|
83
|
+
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2);
|
|
84
|
+
await page.keyboard.press('ControlOrMeta+A');
|
|
85
|
+
await page.keyboard.press('Backspace');
|
|
86
|
+
await page.keyboard.type(text);
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
/** Type into the currently focused element without clicking or clearing. */
|
|
91
|
+
typeOnly() {
|
|
92
|
+
return {
|
|
93
|
+
async fill(page, _rect, text) {
|
|
94
|
+
await page.keyboard.type(text);
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Click to focus, then type one character at a time with a delay.
|
|
100
|
+
* Use in environments where rapid key events are dropped.
|
|
101
|
+
*/
|
|
102
|
+
charByChar(options) {
|
|
103
|
+
return {
|
|
104
|
+
async fill(page, rect, text) {
|
|
105
|
+
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2);
|
|
106
|
+
await page.keyboard.type(text, { delay: options.delay });
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
/** Click to focus, then use insertText without selecting/clearing first. */
|
|
111
|
+
insertText() {
|
|
112
|
+
return {
|
|
113
|
+
async fill(page, rect, text) {
|
|
114
|
+
await page.mouse.click(rect.x + rect.width / 2, rect.y + rect.height / 2);
|
|
115
|
+
await page.keyboard.insertText(text);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
Hover: {
|
|
121
|
+
/**
|
|
122
|
+
* Hover over the element for `ms` milliseconds, then resolve.
|
|
123
|
+
* Use in environments where hover-triggered UI needs time to appear
|
|
124
|
+
* (tooltips, dropdowns) before the next action.
|
|
125
|
+
*/
|
|
126
|
+
withDelay(ms) {
|
|
127
|
+
return {
|
|
128
|
+
async hover(page, rect) {
|
|
129
|
+
const { x, y } = getClickStrategy().getPoint(rect);
|
|
130
|
+
await page.mouse.move(x, y);
|
|
131
|
+
await page.waitForTimeout(ms);
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
/** Hover over the element with no additional delay. */
|
|
136
|
+
default() {
|
|
137
|
+
return {
|
|
138
|
+
async hover(page, rect) {
|
|
139
|
+
const { x, y } = getClickStrategy().getPoint(rect);
|
|
140
|
+
await page.mouse.move(x, y);
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
DblClick: {
|
|
146
|
+
/** Double-click the center of the element rect. Default behavior. */
|
|
147
|
+
default() {
|
|
148
|
+
return {
|
|
149
|
+
async dblclick(page, rect) {
|
|
150
|
+
const { x, y } = getClickStrategy().getPoint(rect);
|
|
151
|
+
await page.mouse.dblclick(x, y);
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* Double-click with a delay between the two clicks.
|
|
157
|
+
* Use in remote desktop environments where rapid clicks may not register.
|
|
158
|
+
*/
|
|
159
|
+
withDelay(ms) {
|
|
160
|
+
return {
|
|
161
|
+
async dblclick(page, rect) {
|
|
162
|
+
const { x, y } = getClickStrategy().getPoint(rect);
|
|
163
|
+
await page.mouse.dblclick(x, y, { delay: ms });
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
Capture: {
|
|
169
|
+
/** Move the mouse to a neutral corner before OCR screenshots. Default behavior. */
|
|
170
|
+
unhover(options) {
|
|
171
|
+
return { unhover: true, ...(options?.point !== undefined && { unhoverPoint: options.point }) };
|
|
172
|
+
},
|
|
173
|
+
/** Skip the unhover mouse move before capture. */
|
|
174
|
+
noop() {
|
|
175
|
+
return { unhover: false };
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=strategies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategies.js","sourceRoot":"","sources":["../src/strategies.ts"],"names":[],"mappings":"AAgCA,iFAAiF;AAEjF,IAAI,mBAA8C,CAAC;AACnD,IAAI,kBAA4C,CAAC;AACjD,IAAI,mBAA8C,CAAC;AACnD,IAAI,sBAAoD,CAAC;AAEzD,MAAM,UAAU,gBAAgB,CAAC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