@applitools/nlp-web-runner 5.4.1 → 5.5.0

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.
@@ -1 +1 @@
1
- var j=r;function r(C,L){C=C-0x131;var R=H();var G=R[C];if(r['YYGQoU']===undefined){var x=function(M){var F='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var K='',e='';for(var A=0x0,c,X,d=0x0;X=M['charAt'](d++);~X&&(c=A%0x4?c*0x40+X:X,A++%0x4)?K+=String['fromCharCode'](0xff&c>>(-0x2*A&0x6)):0x0){X=F['indexOf'](X);}for(var y=0x0,n=K['length'];y<n;y++){e+='%'+('00'+K['charCodeAt'](y)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(e);};r['jNzcZf']=x,r['zEgsem']={},r['YYGQoU']=!![];}var f=R[0x0],j=C+f,w=r['zEgsem'][j];return!w?(G=r['jNzcZf'](G),r['zEgsem'][j]=G):G=w,G;}(function(C,L){var f=r,R=C();while(!![]){try{var G=parseInt(f(0x13b))/0x1*(-parseInt(f(0x133))/0x2)+-parseInt(f(0x138))/0x3+parseInt(f(0x131))/0x4+parseInt(f(0x136))/0x5+-parseInt(f(0x137))/0x6*(-parseInt(f(0x13c))/0x7)+parseInt(f(0x135))/0x8*(parseInt(f(0x13d))/0x9)+-parseInt(f(0x139))/0xa*(parseInt(f(0x134))/0xb);if(G===L)break;else R['push'](R['shift']());}catch(x){R['push'](R['shift']());}}}(H,0xaa26f));var __defProp=Object[j(0x13a)],__exportAll=(C,L)=>{var w=j;let R={};for(var G in C)__defProp(R,G,{'get':C[G],'enumerable':!![]});if(!L)__defProp(R,Symbol[w(0x132)],{'value':w(0x13e)});return R;};function H(){var M=['zgvMAw5LuhjVCgvYDhK','mwjVzeTPzW','nZKWmtaWnwjUt1j3Aq','mZu5nJrLyuTXshC','tw9KDwXL','mJG3mta2ngf5Auz1yW','Dg9tDhjPBMDuywC','mJqZody2mMPzvMDnrG','odyXnZCZtvDtrwz1','mJaWognAsw5gAa','mtuZmdeZnw9Pr0Tmyq','nMLlvgDvsa','mZi0nZyZmKTbyvzksa','mJbmtfb6sgy'];H=function(){return M;};return H();}export{__exportAll as t};
1
+ var r=f;function f(u,J){u=u-0xe6;var C=F();var b=C[u];if(f['kuwJDi']===undefined){var T=function(H){var z='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var h='',P='';for(var R=0x0,Y,v,s=0x0;v=H['charAt'](s++);~v&&(Y=R%0x4?Y*0x40+v:v,R++%0x4)?h+=String['fromCharCode'](0xff&Y>>(-0x2*R&0x6)):0x0){v=z['indexOf'](v);}for(var K=0x0,q=h['length'];K<q;K++){P+='%'+('00'+h['charCodeAt'](K)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(P);};f['btqXfV']=T,f['pWhVEA']={},f['kuwJDi']=!![];}var n=C[0x0],r=u+n,l=f['pWhVEA'][r];return!l?(b=f['btqXfV'](b),f['pWhVEA'][r]=b):b=l,b;}(function(u,J){var n=f,C=u();while(!![]){try{var b=parseInt(n(0xf0))/0x1*(parseInt(n(0xf4))/0x2)+parseInt(n(0xee))/0x3*(-parseInt(n(0xe8))/0x4)+parseInt(n(0xf3))/0x5*(-parseInt(n(0xf1))/0x6)+-parseInt(n(0xed))/0x7*(parseInt(n(0xef))/0x8)+-parseInt(n(0xe7))/0x9+parseInt(n(0xe6))/0xa*(parseInt(n(0xf2))/0xb)+parseInt(n(0xea))/0xc;if(b===J)break;else C['push'](C['shift']());}catch(T){C['push'](C['shift']());}}}(F,0xe22a0));var __defProp=Object[r(0xec)],__exportAll=(u,J)=>{var l=r;let C={};for(var b in u)__defProp(C,b,{'get':u[b],'enumerable':!![]});if(!J)__defProp(C,Symbol[l(0xeb)],{'value':l(0xe9)});return C;};export{__exportAll as t};function F(){var H=['ntG5otmYovjIvwzqsa','ndi4nZy0y0nVAgL6','tw9KDwXL','mZm3mZaZntzusufpAMm','Dg9tDhjPBMDuywC','zgvMAw5LuhjVCgvYDhK','nJK4nMzezeT3va','mtj4qMXLtKC','ndq0ogXjt0LevW','mtLqsKPQywG','mte0vwLWAMXQ','mZu4ntaYmxvbwMP2AW','ndm2ntCWs2Tcugfs','mte0ndK0yMXhsND5','mtbHC3DKt3G'];F=function(){return H;};return F();}
@@ -652,19 +652,22 @@ declare class EventTargetNode<TEventMap extends Record<string, Event>> extends E
652
652
  constructor();
653
653
  }
654
654
  declare namespace logger_d_exports {
655
- export { Logger$1 as Logger, debug, error$1 as error, log, trace, use };
655
+ export { LogEventCatalog, Logger$1 as Logger, debug, error$1 as error, log, trace, use };
656
656
  }
657
657
  interface Logger$1 {
658
- log(...args: any): void;
659
- error(...args: any[]): void;
660
- trace(...args: any[]): void;
661
- debug(...args: any[]): void;
658
+ log(type: string, data: Record<string, unknown>): void;
659
+ error(type: string, data: Record<string, unknown>): void;
660
+ trace(type: string, data: Record<string, unknown>): void;
661
+ debug(type: string, data: Record<string, unknown>): void;
662
662
  }
663
+ interface LogEventCatalog {}
663
664
  declare function use(logger: Logger$1 | null | undefined): void;
664
- declare function log(...args: any[]): any;
665
- declare function error$1(...args: any[]): any;
666
- declare function trace(...args: any[]): any;
667
- declare function debug(...args: any[]): any; //#endregion
665
+ declare function log<TType extends keyof LogEventCatalog>(type: TType, data: LogEventCatalog[TType]): void;
666
+ declare function error$1<TType extends keyof LogEventCatalog>(type: TType, data: LogEventCatalog[TType]): void;
667
+ declare function trace<TType extends keyof LogEventCatalog>(type: TType, data: LogEventCatalog[TType]): void;
668
+ declare function debug<TType extends keyof LogEventCatalog>(type: TType, data: LogEventCatalog[TType]): void; //#endregion
669
+ //#region src/log/event-logger.d.ts
670
+ //#endregion
668
671
  //#region src/color.d.ts
669
672
  type ColorLike = Record<'r' | 'g' | 'b' | 'a', number>;
670
673
  //#endregion
@@ -766,7 +769,7 @@ declare class Rectangle {
766
769
  //#region src/patterns.d.ts
767
770
  type Match = (text: string) => string | null;
768
771
  //#endregion
769
- //#region dist/_inline/_chunks/script-6O13rCLT.d.ts
772
+ //#region dist/_inline/_chunks/script-De9VUKC6.d.ts
770
773
  //#region src/port.d.ts
771
774
  interface PortMessageEvent<TName extends string = string, TPayload = unknown> extends Event {
772
775
  readonly name: TName;
@@ -994,6 +997,7 @@ type ConnectionOptions$2 = {
994
997
  socket: WebSocket;
995
998
  signal?: AbortSignal;
996
999
  sessionId?: string;
1000
+ timeout?: number;
997
1001
  };
998
1002
  declare function makeConnection(options: ConnectionOptions$2): Connection;
999
1003
  declare class Connection {
@@ -1001,6 +1005,8 @@ declare class Connection {
1001
1005
  readonly socket: WebSocket;
1002
1006
  readonly sessionId: string | undefined;
1003
1007
  constructor(options: ConnectionOptions$2);
1008
+ get timeout(): number;
1009
+ set timeout(timeout: number);
1004
1010
  abort(reason: any): void;
1005
1011
  flush(reason: any): void;
1006
1012
  execute<TMethod extends keyof Methods>(method: TMethod, params?: Methods[TMethod]['request'], {
@@ -1376,7 +1382,7 @@ declare class Browser extends EventTargetNode<BrowserEventMap> implements Automa
1376
1382
  stabilize(stage: 'basic' | 'strict' | 'paranoid', {
1377
1383
  signal,
1378
1384
  timeout
1379
- }: {
1385
+ }?: {
1380
1386
  signal?: AbortSignal;
1381
1387
  timeout?: number;
1382
1388
  }): Promise<void>;
@@ -1386,9 +1392,11 @@ declare class Browser extends EventTargetNode<BrowserEventMap> implements Automa
1386
1392
  signal?: AbortSignal;
1387
1393
  }): Promise<void>;
1388
1394
  page({
1389
- url
1395
+ url,
1396
+ automationTimeout
1390
1397
  }: {
1391
1398
  url?: string;
1399
+ automationTimeout?: number;
1392
1400
  }): Promise<Target>;
1393
1401
  activatePreviousPage(): Promise<boolean>;
1394
1402
  activateNextPage(): Promise<boolean>;
@@ -8489,12 +8497,21 @@ type FindCandidatesOptions = {
8489
8497
  debug?: {
8490
8498
  reason?: FindCandidateReason;
8491
8499
  };
8500
+ /**
8501
+ * Whether required-type matching may fall back to the legacy safety-net score (0.01) for
8502
+ * backward-compatible types when classification finds no real score. Defaults to true —
8503
+ * element finding must locate *something* for old descriptors. Search-style consumers pass
8504
+ * false so "all buttons" doesn't include nodes that merely might be buttons.
8505
+ */
8506
+ useBackwardCompatibleTypeScore?: boolean;
8492
8507
  }; //#endregion
8493
8508
  //#region src/public/ax-provider.d.ts
8494
8509
  interface AXProvider {
8495
8510
  makeAXTree<TNode>(flat: AXTreeFlat<TNode>): IAXTreeView<TNode>;
8496
8511
  describeAXNode<TNode>(tree: IAXTreeView<TNode>, query: ElementDescriptorQuery<IAXNodeView<TNode>>): ResolvedElementDescriptor | undefined;
8497
8512
  findAXNode<TNode>(nodes: Iterable<IAXNodeView<TNode>>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): CandidateMetric | null;
8513
+ /** Optional: remote providers may not support returning the full ranked candidate list. */
8514
+ findAXNodes?<TNode>(nodes: Iterable<IAXNodeView<TNode>>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): CandidateMetric[];
8498
8515
  } //#endregion
8499
8516
  //#endregion
8500
8517
  //#region src/scope.d.ts
@@ -9192,7 +9209,7 @@ type RunResult$1<TResult extends HandleResult> = TResult & {
9192
9209
  before?: Capture;
9193
9210
  after?: Capture;
9194
9211
  values: UsedValues;
9195
- metrics?: StepMetrics;
9212
+ metrics?: InstructionMetrics;
9196
9213
  };
9197
9214
  type HandleResult = {
9198
9215
  status: string;
@@ -9225,6 +9242,12 @@ type ErrorResult = {
9225
9242
  type Capture = {
9226
9243
  image: string;
9227
9244
  elements?: ElementMarker[];
9245
+ viewport?: {
9246
+ width: number;
9247
+ height: number;
9248
+ scrollX: number;
9249
+ scrollY: number;
9250
+ };
9228
9251
  };
9229
9252
  type ElementMarker = {
9230
9253
  region: {
@@ -9250,7 +9273,7 @@ declare abstract class Handler$1<TAutomator extends Automator, TInstruction exte
9250
9273
  readonly expectedNavigationStatuses: number[];
9251
9274
  get action(): TInstruction extends Action<any> ? TInstruction : unknown;
9252
9275
  get stack(): ValuesStack;
9253
- get metrics(): StepMetrics;
9276
+ get metrics(): InstructionMetrics;
9254
9277
  get findTimeout(): any;
9255
9278
  get frameStabilityTimeout(): any;
9256
9279
  get navigateTimeout(): any;
@@ -9942,7 +9965,10 @@ type RunnerOptions<TAutomator extends Automator> = {
9942
9965
  type RunOptions = {
9943
9966
  stepIndex?: number;
9944
9967
  signal?: AbortSignal;
9945
- shouldCapture?: boolean; /** @internal */
9968
+ shouldCapture?: boolean;
9969
+ /** Opaque id echoed on each `subinstructionExecutionStarted` so a caller can tie the resulting
9970
+ * instruction logs back to the run it triggered (e.g. the devtools instruction details view). */
9971
+ correlationId?: string; /** @internal */
9946
9972
  runningPreinstructions?: boolean; /** @internal for BE usage only */
9947
9973
  shouldNotThrowOnUnexpectedNavigationStatus?: boolean; /** @internal for BE usage only */
9948
9974
  expectedNavigationStatuses?: number[];
@@ -10079,7 +10105,7 @@ type SubinstructionExecutionStartedDetails = {
10079
10105
  instruction: Instruction;
10080
10106
  };
10081
10107
  };
10082
- type StepMetrics = {
10108
+ type InstructionMetrics = {
10083
10109
  platform?: 'web' | 'mobile';
10084
10110
  stabilizeMs?: number;
10085
10111
  handleMs?: number;
@@ -10097,7 +10123,7 @@ type SubinstructionExecutionFinishedDetails = {
10097
10123
  duration: number;
10098
10124
  status: HandlerResult<Automator, Instruction>['status'];
10099
10125
  errorcode?: ErrorCode;
10100
- metrics?: StepMetrics;
10126
+ metrics?: InstructionMetrics;
10101
10127
  };
10102
10128
  };
10103
10129
  type RecorderLogDetails = RecordingStartedDetails | RecordingStopedDetails | InstructionRecordedDetails | ElementSelectionStartedDetails | ElementSelectionStoppedDetails | ElementDescriptorGeneratedDetails | ElementSelectorGeneratedDetails | RecorderErrorDetails;
@@ -10113,7 +10139,7 @@ type InstructionRecordedDetails = {
10113
10139
  instruction: string;
10114
10140
  guid: string;
10115
10141
  analytics?: any;
10116
- metrics?: StepMetrics;
10142
+ metrics?: InstructionMetrics;
10117
10143
  };
10118
10144
  };
10119
10145
  type ElementSelectionStartedDetails = {
@@ -10129,7 +10155,7 @@ type ElementDescriptorGeneratedDetails = {
10129
10155
  type: 'elementDescriptorGenerated';
10130
10156
  data: {
10131
10157
  description: string;
10132
- metrics?: StepMetrics;
10158
+ metrics?: InstructionMetrics;
10133
10159
  };
10134
10160
  };
10135
10161
  type ElementSelectorGeneratedDetails = {
@@ -10156,7 +10182,11 @@ declare class LogEvent extends CustomEvent<LogDetails & {
10156
10182
  timestamp: number;
10157
10183
  }> {
10158
10184
  readonly component: 'runner' | 'recorder';
10159
- constructor(details: LogDetails);
10185
+ constructor(details: LogDetails & {
10186
+ timestamp?: number;
10187
+ });
10188
+ /** An already-dispatched event can't be dispatched again — re-dispatchers need a fresh instance. */
10189
+ clone(): LogEvent;
10160
10190
  }
10161
10191
  //#endregion
10162
10192
  //#region src/ax/ax-ops.d.ts
@@ -10164,7 +10194,7 @@ type FindNodeOptions = {
10164
10194
  stack: ValuesStack;
10165
10195
  timeout?: number;
10166
10196
  signal?: AbortSignal;
10167
- metrics?: StepMetrics;
10197
+ metrics?: InstructionMetrics;
10168
10198
  };
10169
10199
  type FindNodeResult<TAutomator extends Automator> = {
10170
10200
  web: IAXNodeView<WebNode> | null;
@@ -10178,6 +10208,16 @@ declare class AXOps<TAutomator extends Automator = Automator> {
10178
10208
  extractTree<TNode = unknown>(): Promise<IAXTreeView<TNode>>;
10179
10209
  makeTree<TNode>(flat: AXTreeFlat<TNode>): IAXTreeView<TNode>;
10180
10210
  findCandidate<TNode>(tree: IAXTreeView<TNode>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): CandidateMetric | null;
10211
+ findCandidates<TNode>(tree: IAXTreeView<TNode>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): CandidateMetric[];
10212
+ /**
10213
+ * Search-oriented "find all": ranked candidates matching the descriptor, and — when the
10214
+ * descriptor combines a title with a type — the remaining candidates of that type appended
10215
+ * after the title matches. A search for "ok button" should surface ALL buttons with the "ok"
10216
+ * ones ranked first, whereas plain candidate matching filters non-matching titles out entirely.
10217
+ * The legacy safety-net type score is disabled: "all buttons" must not include nodes that
10218
+ * merely might be buttons.
10219
+ */
10220
+ searchCandidates<TNode>(tree: IAXTreeView<TNode>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): CandidateMetric[];
10181
10221
  describeNode<TNode>(tree: IAXTreeView<TNode>, query: ElementDescriptorQuery<IAXNodeView<TNode>>): ResolvedElementDescriptor | undefined;
10182
10222
  findNode(descriptor: ResolvedElementDescriptor, options: FindNodeOptions): Promise<FindNodeResult<TAutomator>>;
10183
10223
  }