@allwright.dev/core 0.1.23 → 0.1.25

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 CHANGED
@@ -20,6 +20,9 @@ await page.click(
20
20
  await browser.close();
21
21
  ```
22
22
 
23
+ Web clicks accept `{ button: "left" | "middle" | "right", clickCount: 1 | 2 | 3 }`.
24
+ Use `page.dblclick(selector)` or `locator.dblclick()` for the common double-click case.
25
+
23
26
  Register a typed hook before an action that opens a tab, then wait for its
24
27
  typed result afterward:
25
28
 
@@ -51,11 +54,17 @@ Paths passed to `setFiles` and `saveAs` belong to the test process, even when
51
54
  the Allwright server is remote. Android apps support the same `fileChooser` and
52
55
  `download` hook shape; Android `newPage` hooks are not applicable.
53
56
 
54
- Runnable examples live in [examples/web-basic.ts](./examples/web-basic.ts), [examples/android-basic.ts](./examples/android-basic.ts), and [examples/ios-basic.ts](./examples/ios-basic.ts).
57
+ Runnable examples cover every implemented surface:
58
+ [Web](./examples/web-basic.ts), [Android](./examples/android-basic.ts),
59
+ [iOS](./examples/ios-basic.ts), [macOS](./examples/macos-basic.ts), and
60
+ [Windows](./examples/windows-basic.ts). The desktop examples default to
61
+ Calculator on macOS and Notepad on Windows and accept `ALLWRIGHT_MAC_APP_ID`
62
+ or `ALLWRIGHT_WINDOWS_APP_ID`.
55
63
 
56
- Android, iOS, and macOS applications implement the shared `NativeApp` and
64
+ Android, iOS, macOS, and Windows applications implement the shared `NativeApp` and
57
65
  `NativeAppLocator` interfaces. Platform-specific type names such as
58
- `MobileAndroidApp`, `MobileIosLocator`, and `DesktopMacLocator` remain exported
66
+ `MobileAndroidApp`, `MobileIosLocator`, `DesktopMacLocator`, and
67
+ `DesktopWindowsLocator` remain exported
59
68
  as aliases for compatibility and platform-oriented annotations.
60
69
 
61
70
  Shared config files are stack-agnostic and can live in `allwright.config.yaml` or `allwright.config.json`.
@@ -117,3 +126,5 @@ const box = await page.locator('button').boundingBox(); // { x, y, width, height
117
126
  Element reads also have page methods such as `page.inputValue(selector, options)` and accept `timeoutMs`. Reads use the first locator match and work in frame pages. `inputValue` reads the live property of an input, textarea, or select. `selectedOptions` supports native selects (including multiple selections) and ARIA combobox/listbox options marked `aria-selected="true"`. `selectedText` returns the textbox's selected substring, an empty string for a caret, or `null` for input types without selection support. `isChecked` supports native checkbox/radio and ARIA checked controls; ARIA mixed state returns false.
118
127
 
119
128
  Missing attributes return `null` (an empty attribute remains `""`). Bounding boxes use CSS pixels relative to the page/frame viewport and return `null` for hidden or zero-area elements. Missing elements and incompatible control types raise errors. Use `textContent()` for raw text or `innerText()` for rendered text.
129
+
130
+ `NativeApp` and `NativeAppLocator` expose `inputValue`, `isChecked`, `getAttribute`, and `boundingBox` on Android, iOS, macOS, and Windows. Native attributes are platform accessibility/UI Automation properties, and native boxes use platform screen coordinates. Selected-option and selected-text reads remain web-only.
package/dist/bootstrap.js CHANGED
@@ -12,7 +12,7 @@ const ALLWRIGHT_HOME_ENV_VAR = "ALLWRIGHT_HOME";
12
12
  const ALLWRIGHT_REPOSITORY_ENV_VAR = "ALLWRIGHT_REPOSITORY";
13
13
  const ALLWRIGHT_VERSION_ENV_VAR = "ALLWRIGHT_VERSION";
14
14
  const DEFAULT_RELEASE_REPOSITORY = "allwright-dev/allwright";
15
- const DEFAULT_RELEASE_VERSION = "0.1.23";
15
+ const DEFAULT_RELEASE_VERSION = "0.1.25";
16
16
  const STARTUP_TIMEOUT_MS = 20_000;
17
17
  const PING_TIMEOUT_MS = 1_000;
18
18
  const PROTO_ROOT = fileURLToPath(new URL("../proto/", import.meta.url));
package/dist/desktop.js CHANGED
@@ -9,14 +9,16 @@ class DesktopMacImpl {
9
9
  runtime;
10
10
  stream;
11
11
  queue;
12
+ platformLabel;
12
13
  #closed = false;
13
14
  #currentApp;
14
- constructor(sessionId, surfaceSessionId, runtime, stream, queue, initialAppSessionId) {
15
+ constructor(sessionId, surfaceSessionId, runtime, stream, queue, initialAppSessionId, platformLabel = "macOS") {
15
16
  this.sessionId = sessionId;
16
17
  this.surfaceSessionId = surfaceSessionId;
17
18
  this.runtime = runtime;
18
19
  this.stream = stream;
19
20
  this.queue = queue;
21
+ this.platformLabel = platformLabel;
20
22
  this.#currentApp = new NativeAppImpl(runtime, surfaceSessionId, initialAppSessionId);
21
23
  }
22
24
  app() {
@@ -24,7 +26,7 @@ class DesktopMacImpl {
24
26
  }
25
27
  async launch(options) {
26
28
  if (this.#closed)
27
- throw new Error(`macOS desktop session ${this.sessionId} is closed`);
29
+ throw new Error(`${this.platformLabel} desktop session ${this.sessionId} is closed`);
28
30
  this.stream.write({
29
31
  launchDesktopApp: {
30
32
  appId: options.appId,
@@ -42,7 +44,7 @@ class DesktopMacImpl {
42
44
  throw new Error(event.error.message);
43
45
  if (event.closed) {
44
46
  this.#closed = true;
45
- throw new Error(`macOS desktop session ${this.sessionId} closed while launching app`);
47
+ throw new Error(`${this.platformLabel} desktop session ${this.sessionId} closed while launching app`);
46
48
  }
47
49
  }
48
50
  }
@@ -61,7 +63,28 @@ class DesktopMacSurfaceImpl {
61
63
  while (true) {
62
64
  const event = await queue.next();
63
65
  if (event.desktopConnected?.initialAppSessionId) {
64
- return new DesktopMacImpl(event.desktopConnected.desktopSessionId ?? event.sessionId ?? "", event.sessionId ?? "", runtime, stream, queue, event.desktopConnected.initialAppSessionId);
66
+ return new DesktopMacImpl(event.desktopConnected.desktopSessionId ?? event.sessionId ?? "", event.sessionId ?? "", runtime, stream, queue, event.desktopConnected.initialAppSessionId, "macOS");
67
+ }
68
+ if (event.error?.message)
69
+ throw new Error(event.error.message);
70
+ }
71
+ }
72
+ }
73
+ class DesktopWindowsSurfaceImpl {
74
+ async connect(options = {}) {
75
+ const runtime = await getRuntime();
76
+ const { stream, queue } = await createBrowserSessionHandle(runtime);
77
+ stream.write({
78
+ connectDesktop: {
79
+ platform: 2,
80
+ agentEndpoint: options.agentEndpoint,
81
+ retryOptions: retryOptions(options.timeoutMs),
82
+ },
83
+ });
84
+ while (true) {
85
+ const event = await queue.next();
86
+ if (event.desktopConnected?.initialAppSessionId) {
87
+ return new DesktopMacImpl(event.desktopConnected.desktopSessionId ?? event.sessionId ?? "", event.sessionId ?? "", runtime, stream, queue, event.desktopConnected.initialAppSessionId, "Windows");
65
88
  }
66
89
  if (event.error?.message)
67
90
  throw new Error(event.error.message);
@@ -70,4 +93,5 @@ class DesktopMacSurfaceImpl {
70
93
  }
71
94
  export const desktop = {
72
95
  mac: new DesktopMacSurfaceImpl(),
96
+ windows: new DesktopWindowsSurfaceImpl(),
73
97
  };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import { PageImpl } from "./page.js";
6
6
  import { setServerAddr, shutdown } from "./runtime.js";
7
7
  import type { Browser, BrowserKind, BrowserType, LaunchOptions, Page, Dialog, FileChooser, Download, HookType, ResolveConfigOptions, ResolvedAllwrightConfig } from "./types.js";
8
8
  export { findConfigFile, loadConfigFile, resolveConfig, setServerAddr, shutdown };
9
- export type { CapturedOption, BoundingBox, AccessibilitySnapshotOptions, AllwrightConfig, Browser, BrowserInfo, BrowserKind, BrowserType, Hook, HookType, Dialog, FileChooser, Download, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, LaunchOptions, NativeApp, NativeAppLocator, MobileAndroidConnectOptions, MobileAndroidDevice, MobileAndroidLaunchOptions, MobileAndroidLocator, MobileAndroidApp, MobileIosConnectOptions, MobileIosDevice, MobileIosLaunchOptions, MobileIosLocator, MobileIosApp, Locator, LocatorInfo, MobileSurfaceNamespace, DesktopMacApp, DesktopMacConnectOptions, DesktopMacDesktop, DesktopMacLaunchOptions, DesktopMacLocator, DesktopSurfaceNamespace, NavigateResult, Page, PageInfo, PressOptions, PressResult, ResolveConfigOptions, ResolvedAllwrightConfig, RetryConfig, ScreenshotOptions, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult, } from "./types.js";
9
+ export type { CapturedOption, BoundingBox, AccessibilitySnapshotOptions, AllwrightConfig, Browser, BrowserInfo, BrowserKind, BrowserType, Hook, HookType, Dialog, FileChooser, Download, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, LaunchOptions, NativeApp, NativeAppLocator, MobileAndroidConnectOptions, MobileAndroidDevice, MobileAndroidLaunchOptions, MobileAndroidLocator, MobileAndroidApp, MobileIosConnectOptions, MobileIosDevice, MobileIosLaunchOptions, MobileIosLocator, MobileIosApp, Locator, LocatorInfo, MobileSurfaceNamespace, DesktopMacApp, DesktopMacConnectOptions, DesktopMacDesktop, DesktopMacLaunchOptions, DesktopMacLocator, DesktopWindowsApp, DesktopWindowsConnectOptions, DesktopWindowsDesktop, DesktopWindowsLaunchOptions, DesktopWindowsLocator, DesktopSurfaceNamespace, NavigateResult, Page, PageInfo, PressOptions, PressResult, ResolveConfigOptions, ResolvedAllwrightConfig, RetryConfig, ScreenshotOptions, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult, } from "./types.js";
10
10
  export declare const chromium: BrowserType;
11
11
  export declare const firefox: BrowserType;
12
12
  export declare const hooks: {
package/dist/locator.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { WebLocatorBuilders, type LocatorFilterOptions } from "./web-locators.js";
2
- import type { BoundingBox, CapturedOption, CommandOptions, HighlightOptions, Locator, LocatorInfo, Page, PressOptions, WaitForSelectorOptions } from "./types.js";
2
+ import type { BoundingBox, CapturedOption, ClickOptions, CommandOptions, HighlightOptions, Locator, LocatorInfo, Page, PressOptions, WaitForSelectorOptions } from "./types.js";
3
3
  export declare class LocatorImpl extends WebLocatorBuilders implements Locator {
4
4
  readonly page: Page;
5
5
  readonly selector: string;
6
6
  constructor(input: LocatorInfo);
7
7
  frame(options?: CommandOptions): Promise<Page>;
8
8
  Frame(options?: CommandOptions): Promise<Page>;
9
- click(options?: CommandOptions): Promise<void>;
9
+ click(options?: ClickOptions): Promise<void>;
10
+ dblclick(options?: Omit<ClickOptions, "clickCount">): Promise<void>;
10
11
  count(options?: CommandOptions): Promise<number>;
11
12
  highlight(options?: HighlightOptions): Promise<void>;
12
13
  focus(options?: CommandOptions): Promise<void>;
package/dist/locator.js CHANGED
@@ -13,6 +13,9 @@ export class LocatorImpl extends WebLocatorBuilders {
13
13
  async click(options = {}) {
14
14
  return this.page.click(this.selector, options);
15
15
  }
16
+ async dblclick(options = {}) {
17
+ return this.page.dblclick(this.selector, options);
18
+ }
16
19
  async count(options = {}) {
17
20
  return this.page.count(this.selector, options);
18
21
  }
package/dist/mobile.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type RoleOptions, type TextMatcher, type TextOptions } from "./web-locators.js";
2
- import type { AccessibilitySnapshotOptions, CommandOptions, Hook, HookType, MobileSurfaceNamespace, NativeApp, NativeAppLocator, PressOptions, RuntimeClient, ScreenshotOptions, WaitForSelectorOptions } from "./types.js";
2
+ import type { AccessibilitySnapshotOptions, BoundingBox, CommandOptions, Hook, HookType, MobileSurfaceNamespace, NativeApp, NativeAppLocator, PressOptions, RuntimeClient, ScreenshotOptions, WaitForSelectorOptions } from "./types.js";
3
3
  export declare class NativeAppImpl implements NativeApp {
4
4
  #private;
5
5
  readonly sessionId: string;
@@ -21,6 +21,10 @@ export declare class NativeAppImpl implements NativeApp {
21
21
  press(selector: string, key: string, options?: PressOptions): Promise<void>;
22
22
  textContent(selector: string, options?: CommandOptions): Promise<string | null>;
23
23
  innerText(selector: string, options?: CommandOptions): Promise<string>;
24
+ inputValue(selector: string, options?: CommandOptions): Promise<string>;
25
+ isChecked(selector: string, options?: CommandOptions): Promise<boolean>;
26
+ getAttribute(selector: string, name: string, options?: CommandOptions): Promise<string | null>;
27
+ boundingBox(selector: string, options?: CommandOptions): Promise<BoundingBox | null>;
24
28
  waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<void>;
25
29
  accessibilitySnapshot(options?: AccessibilitySnapshotOptions): Promise<string>;
26
30
  screenshot(options?: ScreenshotOptions): Promise<Uint8Array>;
package/dist/mobile.js CHANGED
@@ -94,7 +94,7 @@ export class NativeAppImpl {
94
94
  setMobileFileChooserFiles: {
95
95
  fileChooserId,
96
96
  fileIds,
97
- retryOptions: retryOptions(options.timeoutMs),
97
+ retryOptions: options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : undefined,
98
98
  },
99
99
  });
100
100
  while (true) {
@@ -235,7 +235,7 @@ export class NativeAppImpl {
235
235
  throw new Error(event.error.message);
236
236
  if (event.closed) {
237
237
  handle.closed = true;
238
- throw new Error(`mobile app session ${this.sessionId} closed while opening deep link`);
238
+ throw new Error(`native app session ${this.sessionId} closed while opening deep link`);
239
239
  }
240
240
  }
241
241
  }
@@ -348,6 +348,18 @@ export class NativeAppImpl {
348
348
  async innerText(selector, options = {}) {
349
349
  return (await this.#readText(selector, options, false)).text;
350
350
  }
351
+ async inputValue(selector, options = {}) {
352
+ return (await this.#capture("CAPTURE_KIND_INPUT_VALUE", selector, "", options)).value ?? "";
353
+ }
354
+ async isChecked(selector, options = {}) {
355
+ return (await this.#capture("CAPTURE_KIND_CHECKED", selector, "", options)).checked ?? false;
356
+ }
357
+ async getAttribute(selector, name, options = {}) {
358
+ return (await this.#capture("CAPTURE_KIND_ATTRIBUTE", selector, name, options)).value ?? null;
359
+ }
360
+ async boundingBox(selector, options = {}) {
361
+ return (await this.#capture("CAPTURE_KIND_BOUNDING_BOX", selector, "", options)).boundingBox ?? null;
362
+ }
351
363
  async waitForSelector(selector, options = {}) {
352
364
  const handle = await this.#getHandle();
353
365
  this.#ensureOpen(handle);
@@ -449,6 +461,31 @@ export class NativeAppImpl {
449
461
  throw new Error(`android app session ${this.sessionId} is closed`);
450
462
  }
451
463
  }
464
+ async #capture(kind, selector, attributeName, options) {
465
+ const handle = await this.#getHandle();
466
+ this.#ensureOpen(handle);
467
+ handle.stream.write({
468
+ surfaceSessionId: this.#surfaceSessionId,
469
+ contextSessionId: this.sessionId,
470
+ capture: {
471
+ kind,
472
+ cssSelector: normalizeMobileSelectorForTransport(selector),
473
+ attributeName,
474
+ retryOptions: options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : undefined,
475
+ },
476
+ });
477
+ while (true) {
478
+ const event = await handle.queue.next();
479
+ if (event.captureResolved)
480
+ return event.captureResolved;
481
+ if (event.error?.message)
482
+ throw new Error(event.error.message);
483
+ if (event.closed) {
484
+ handle.closed = true;
485
+ throw new Error(`native app session ${this.sessionId} closed while capturing element state`);
486
+ }
487
+ }
488
+ }
452
489
  async #readText(selector, options, textContent) {
453
490
  const handle = await this.#getHandle();
454
491
  this.#ensureOpen(handle);
@@ -558,6 +595,18 @@ class NativeAppLocatorImpl {
558
595
  async innerText(options = {}) {
559
596
  return this.page.innerText(this.selector, options);
560
597
  }
598
+ async inputValue(options = {}) {
599
+ return this.page.inputValue(this.selector, options);
600
+ }
601
+ async isChecked(options = {}) {
602
+ return this.page.isChecked(this.selector, options);
603
+ }
604
+ async getAttribute(name, options = {}) {
605
+ return this.page.getAttribute(this.selector, name, options);
606
+ }
607
+ async boundingBox(options = {}) {
608
+ return this.page.boundingBox(this.selector, options);
609
+ }
561
610
  async waitFor(options = {}) {
562
611
  return this.page.waitForSelector(this.selector, options);
563
612
  }
package/dist/page.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebLocatorBuilders, type LocatorFilterOptions } from "./web-locators.js";
2
- import type { BoundingBox, CapturedOption, AccessibilitySnapshotOptions, CommandOptions, FileChooser, Download, HighlightOptions, Hook, HookType, Locator, Page, PageInfo, PressOptions, RuntimeClient, ScreenshotOptions, WaitForSelectorOptions } from "./types.js";
2
+ import type { BoundingBox, CapturedOption, AccessibilitySnapshotOptions, ClickOptions, CommandOptions, FileChooser, Download, HighlightOptions, Hook, HookType, Locator, Page, PageInfo, PressOptions, RuntimeClient, ScreenshotOptions, WaitForSelectorOptions } from "./types.js";
3
3
  export declare class PageImpl extends WebLocatorBuilders implements Page {
4
4
  #private;
5
5
  constructor(input: PageInfo & {
@@ -14,7 +14,8 @@ export declare class PageImpl extends WebLocatorBuilders implements Page {
14
14
  saveDownload(downloadId: string, path: string, options?: CommandOptions): Promise<void>;
15
15
  locator(selector: string, options?: LocatorFilterOptions): Locator;
16
16
  goto(url: string, options?: CommandOptions): Promise<void>;
17
- click(selector: string, options?: CommandOptions): Promise<void>;
17
+ click(selector: string, options?: ClickOptions): Promise<void>;
18
+ dblclick(selector: string, options?: Omit<ClickOptions, "clickCount">): Promise<void>;
18
19
  count(selector: string, options?: CommandOptions): Promise<number>;
19
20
  highlight(selector: string, options?: HighlightOptions): Promise<void>;
20
21
  focus(selector: string, options?: CommandOptions): Promise<void>;
package/dist/page.js CHANGED
@@ -291,6 +291,8 @@ export class PageImpl extends WebLocatorBuilders {
291
291
  contextSessionId: this.sessionId,
292
292
  clickElement: {
293
293
  cssSelector: transportSelector,
294
+ button: options.button,
295
+ clickCount: options.clickCount,
294
296
  retryOptions: options.timeoutMs ? { timeoutMs: options.timeoutMs } : undefined,
295
297
  },
296
298
  });
@@ -308,6 +310,9 @@ export class PageImpl extends WebLocatorBuilders {
308
310
  }
309
311
  }
310
312
  }
313
+ async dblclick(selector, options = {}) {
314
+ return this.click(selector, { ...options, clickCount: 2 });
315
+ }
311
316
  async count(selector, options = {}) {
312
317
  const handle = await this.#getHandle();
313
318
  this.#ensureOpen(handle);
package/dist/types.d.ts CHANGED
@@ -9,6 +9,11 @@ export type BrowserKind = "chromium" | "firefox";
9
9
  export interface CommandOptions {
10
10
  timeoutMs?: number;
11
11
  }
12
+ export type MouseButton = "left" | "middle" | "right";
13
+ export interface ClickOptions extends CommandOptions {
14
+ button?: MouseButton;
15
+ clickCount?: 1 | 2 | 3;
16
+ }
12
17
  export interface AccessibilitySnapshotOptions extends CommandOptions {
13
18
  format?: "json" | "yaml";
14
19
  mode?: "default" | "ai" | "autoexpect" | "codegen";
@@ -155,7 +160,8 @@ export interface Page extends PageInfo, WebLocators {
155
160
  locator(selector: string, options?: LocatorFilterOptions): Locator;
156
161
  goto(url: string, options?: CommandOptions): Promise<void>;
157
162
  navigate(url: string, options?: CommandOptions): Promise<void>;
158
- click(selector: string, options?: CommandOptions): Promise<void>;
163
+ click(selector: string, options?: ClickOptions): Promise<void>;
164
+ dblclick(selector: string, options?: Omit<ClickOptions, "clickCount">): Promise<void>;
159
165
  count(selector: string, options?: CommandOptions): Promise<number>;
160
166
  highlight(selector: string, options?: HighlightOptions): Promise<void>;
161
167
  focus(selector: string, options?: CommandOptions): Promise<void>;
@@ -193,6 +199,10 @@ export interface NativeAppLocator {
193
199
  press(key: string, options?: PressOptions): Promise<void>;
194
200
  textContent(options?: CommandOptions): Promise<string | null>;
195
201
  innerText(options?: CommandOptions): Promise<string>;
202
+ inputValue(options?: CommandOptions): Promise<string>;
203
+ isChecked(options?: CommandOptions): Promise<boolean>;
204
+ getAttribute(name: string, options?: CommandOptions): Promise<string | null>;
205
+ boundingBox(options?: CommandOptions): Promise<BoundingBox | null>;
196
206
  waitFor(options?: WaitForSelectorOptions): Promise<void>;
197
207
  locator(selector: string): NativeAppLocator;
198
208
  getByRole(role: string, options?: RoleOptions): NativeAppLocator;
@@ -217,6 +227,10 @@ export interface NativeApp {
217
227
  press(selector: string, key: string, options?: PressOptions): Promise<void>;
218
228
  textContent(selector: string, options?: CommandOptions): Promise<string | null>;
219
229
  innerText(selector: string, options?: CommandOptions): Promise<string>;
230
+ inputValue(selector: string, options?: CommandOptions): Promise<string>;
231
+ isChecked(selector: string, options?: CommandOptions): Promise<boolean>;
232
+ getAttribute(selector: string, name: string, options?: CommandOptions): Promise<string | null>;
233
+ boundingBox(selector: string, options?: CommandOptions): Promise<BoundingBox | null>;
220
234
  waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<void>;
221
235
  screenshot(options?: ScreenshotOptions): Promise<Uint8Array>;
222
236
  registerHook<T>(type: HookType<T>): Promise<Hook<T>>;
@@ -273,10 +287,22 @@ export interface DesktopMacDesktop {
273
287
  app(): DesktopMacApp;
274
288
  launch(options: DesktopMacLaunchOptions): Promise<DesktopMacApp>;
275
289
  }
290
+ export type DesktopWindowsConnectOptions = DesktopMacConnectOptions;
291
+ export type DesktopWindowsLaunchOptions = DesktopMacLaunchOptions;
292
+ export type DesktopWindowsApp = NativeApp;
293
+ export type DesktopWindowsLocator = NativeAppLocator;
294
+ export interface DesktopWindowsDesktop {
295
+ readonly sessionId: string;
296
+ app(): DesktopWindowsApp;
297
+ launch(options: DesktopWindowsLaunchOptions): Promise<DesktopWindowsApp>;
298
+ }
276
299
  export interface DesktopSurfaceNamespace {
277
300
  mac: {
278
301
  connect(options?: DesktopMacConnectOptions): Promise<DesktopMacDesktop>;
279
302
  };
303
+ windows: {
304
+ connect(options?: DesktopWindowsConnectOptions): Promise<DesktopWindowsDesktop>;
305
+ };
280
306
  }
281
307
  export interface Locator extends WebLocators {
282
308
  inputValue(options?: CommandOptions): Promise<string>;
@@ -294,7 +320,8 @@ export interface Locator extends WebLocators {
294
320
  last(): Locator;
295
321
  readonly page: Page;
296
322
  readonly selector: string;
297
- click(options?: CommandOptions): Promise<void>;
323
+ click(options?: ClickOptions): Promise<void>;
324
+ dblclick(options?: Omit<ClickOptions, "clickCount">): Promise<void>;
298
325
  count(options?: CommandOptions): Promise<number>;
299
326
  highlight(options?: HighlightOptions): Promise<void>;
300
327
  focus(options?: CommandOptions): Promise<void>;
@@ -820,6 +847,8 @@ export interface ClickRequest {
820
847
  contextSessionId: string;
821
848
  clickElement: {
822
849
  cssSelector: string;
850
+ button?: MouseButton;
851
+ clickCount?: number;
823
852
  retryOptions?: {
824
853
  timeoutMs?: number;
825
854
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allwright.dev/core",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "High-level TypeScript client for the allwright automation engine.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -170,6 +170,8 @@ message NavigatePageCommand {
170
170
  message ClickElementCommand {
171
171
  string css_selector = 1;
172
172
  optional CommandRetryOptions retry_options = 2;
173
+ optional string button = 3;
174
+ optional uint32 click_count = 4;
173
175
  }
174
176
 
175
177
  message CountElementsCommand {