doc-detective-common 4.23.0 → 4.24.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.
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * A step in a test.
7
7
  */
8
- export type Step = (Common & CheckLink) | (Common1 & Click) | (Common2 & Find) | (Common3 & GoTo) | (Common4 & HttpRequest) | (Common5 & RunShell) | (Common6 & RunCode) | (Common7 & RunBrowserScript) | (Common8 & Type) | (Common9 & Screenshot) | (Common10 & SaveCookie) | (Common11 & Record) | (Common12 & StopRecord) | (Common13 & CloseSurface) | (Common14 & StartSurface) | (Common15 & LoadVariables) | (Common16 & DragAndDrop) | (Common17 & LoadCookie) | (Common18 & Wait);
8
+ export type Step = (Common & CheckLink) | (Common1 & Click) | (Common2 & Find) | (Common3 & GoTo) | (Common4 & HttpRequest) | (Common5 & RunShell) | (Common6 & RunCode) | (Common7 & RunBrowserScript) | (Common8 & Type) | (Common9 & Screenshot) | (Common10 & SaveCookie) | (Common11 & Record) | (Common12 & StopRecord) | (Common13 & CloseSurface) | (Common14 & StartSurface) | (Common15 & LoadVariables) | (Common16 & DragAndDrop) | (Common17 & LoadCookie) | (Common18 & Swipe) | (Common19 & Wait);
9
9
  /**
10
10
  * A condition expression, or an array of expressions combined with logical AND.
11
11
  */
@@ -1218,6 +1218,130 @@ export type Routing74 = {
1218
1218
  export type Routing75 = {
1219
1219
  [k: string]: unknown;
1220
1220
  };
1221
+ /**
1222
+ * Swipe (or scroll) a surface in a direction or between two points. The direction is the virtual finger's motion: swiping up moves content up, revealing content further down the page. Works on app and browser surfaces.
1223
+ */
1224
+ export type Swipe1 = SwipeSimple | SwipeDirectional | SwipePointToPoint;
1225
+ /**
1226
+ * Direction the virtual finger moves. `up` reveals content below; `left` reveals content to the right (for example, the next carousel card).
1227
+ */
1228
+ export type SwipeSimple = "up" | "down" | "left" | "right";
1229
+ /**
1230
+ * Direction the virtual finger moves. `up` reveals content below; `left` reveals content to the right (for example, the next carousel card).
1231
+ */
1232
+ export type SwipeSimple1 = "up" | "down" | "left" | "right";
1233
+ /**
1234
+ * Browser engine keyword. Targets that browser. Steps that can only ever act on a browser (not a background process) restrict the bare-string form to this enum, so a process name here is rejected at validation time instead of failing at runtime.
1235
+ */
1236
+ export type SurfaceByBrowserEngine5 = "chrome" | "firefox" | "safari" | "webkit" | "edge";
1237
+ /**
1238
+ * Which window to act on. Omit to use the active window.
1239
+ */
1240
+ export type WindowTabSelector16 = ByIndex20 | ByName20 | ByCriteria20;
1241
+ /**
1242
+ * Index in creation order. Negative counts from the end; `-1` is the newest.
1243
+ */
1244
+ export type ByIndex20 = number;
1245
+ /**
1246
+ * Name assigned when the window/tab was opened (goTo `newTab`/`newWindow`). The integer branch is listed first because Ajv validates with coerceTypes — string-first would coerce integer indexes into name strings.
1247
+ */
1248
+ export type ByName20 = string;
1249
+ /**
1250
+ * Which tab to act on. Omit to use the active tab. Without `window`, the selector searches every tab in creation order — including tabs the page opened itself.
1251
+ */
1252
+ export type WindowTabSelector17 = ByIndex21 | ByName21 | ByCriteria21;
1253
+ /**
1254
+ * Index in creation order. Negative counts from the end; `-1` is the newest.
1255
+ */
1256
+ export type ByIndex21 = number;
1257
+ /**
1258
+ * Name assigned when the window/tab was opened (goTo `newTab`/`newWindow`). The integer branch is listed first because Ajv validates with coerceTypes — string-first would coerce integer indexes into name strings.
1259
+ */
1260
+ export type ByName21 = string;
1261
+ /**
1262
+ * Which app window to act on. Omit to use the active window. Apps have windows, no tabs.
1263
+ */
1264
+ export type AppWindowSelector4 = ByIndex22 | ByName22 | ByCriteria22;
1265
+ /**
1266
+ * Index in creation order. Negative counts from the end; `-1` is the newest (e.g. a dialog the app just opened).
1267
+ */
1268
+ export type ByIndex22 = number;
1269
+ /**
1270
+ * Assigned window name. The integer branch is listed first because Ajv validates with coerceTypes — string-first would coerce integer indexes into name strings.
1271
+ */
1272
+ export type ByName22 = string;
1273
+ /**
1274
+ * Browser engine keyword. Targets that browser. Steps that can only ever act on a browser (not a background process) restrict the bare-string form to this enum, so a process name here is rejected at validation time instead of failing at runtime.
1275
+ */
1276
+ export type SurfaceByBrowserEngine6 = "chrome" | "firefox" | "safari" | "webkit" | "edge";
1277
+ /**
1278
+ * Which window to act on. Omit to use the active window.
1279
+ */
1280
+ export type WindowTabSelector18 = ByIndex23 | ByName23 | ByCriteria23;
1281
+ /**
1282
+ * Index in creation order. Negative counts from the end; `-1` is the newest.
1283
+ */
1284
+ export type ByIndex23 = number;
1285
+ /**
1286
+ * Name assigned when the window/tab was opened (goTo `newTab`/`newWindow`). The integer branch is listed first because Ajv validates with coerceTypes — string-first would coerce integer indexes into name strings.
1287
+ */
1288
+ export type ByName23 = string;
1289
+ /**
1290
+ * Which tab to act on. Omit to use the active tab. Without `window`, the selector searches every tab in creation order — including tabs the page opened itself.
1291
+ */
1292
+ export type WindowTabSelector19 = ByIndex24 | ByName24 | ByCriteria24;
1293
+ /**
1294
+ * Index in creation order. Negative counts from the end; `-1` is the newest.
1295
+ */
1296
+ export type ByIndex24 = number;
1297
+ /**
1298
+ * Name assigned when the window/tab was opened (goTo `newTab`/`newWindow`). The integer branch is listed first because Ajv validates with coerceTypes — string-first would coerce integer indexes into name strings.
1299
+ */
1300
+ export type ByName24 = string;
1301
+ /**
1302
+ * Which app window to act on. Omit to use the active window. Apps have windows, no tabs.
1303
+ */
1304
+ export type AppWindowSelector5 = ByIndex25 | ByName25 | ByCriteria25;
1305
+ /**
1306
+ * Index in creation order. Negative counts from the end; `-1` is the newest (e.g. a dialog the app just opened).
1307
+ */
1308
+ export type ByIndex25 = number;
1309
+ /**
1310
+ * Assigned window name. The integer branch is listed first because Ajv validates with coerceTypes — string-first would coerce integer indexes into name strings.
1311
+ */
1312
+ export type ByName25 = string;
1313
+ /**
1314
+ * A condition expression, or an array of expressions combined with logical AND.
1315
+ */
1316
+ export type Condition38 = string | [string, ...string[]];
1317
+ /**
1318
+ * A condition expression, or an array of expressions combined with logical AND.
1319
+ */
1320
+ export type Condition39 = string | [string, ...string[]];
1321
+ /**
1322
+ * A single dynamic-routing entry: an optional condition (`if`) plus exactly one routing action. Attached to a step or test handler (`onPass`, `onFail`, `onWarning`, `onSkip`). For step-level handlers, `continue`, `stop`, `retry`, and `goToStep` are evaluated at runtime; `goToTest` is validated but not yet executed (deferred at step scope). For test-level handlers, `continue`, `stop`, and `goToTest` are evaluated at runtime (test scope; `goToTest` jumps to a test within the spec), while `retry` and `goToStep` are not applicable at test scope.
1323
+ */
1324
+ export type Routing76 = {
1325
+ [k: string]: unknown;
1326
+ };
1327
+ /**
1328
+ * A single dynamic-routing entry: an optional condition (`if`) plus exactly one routing action. Attached to a step or test handler (`onPass`, `onFail`, `onWarning`, `onSkip`). For step-level handlers, `continue`, `stop`, `retry`, and `goToStep` are evaluated at runtime; `goToTest` is validated but not yet executed (deferred at step scope). For test-level handlers, `continue`, `stop`, and `goToTest` are evaluated at runtime (test scope; `goToTest` jumps to a test within the spec), while `retry` and `goToStep` are not applicable at test scope.
1329
+ */
1330
+ export type Routing77 = {
1331
+ [k: string]: unknown;
1332
+ };
1333
+ /**
1334
+ * A single dynamic-routing entry: an optional condition (`if`) plus exactly one routing action. Attached to a step or test handler (`onPass`, `onFail`, `onWarning`, `onSkip`). For step-level handlers, `continue`, `stop`, `retry`, and `goToStep` are evaluated at runtime; `goToTest` is validated but not yet executed (deferred at step scope). For test-level handlers, `continue`, `stop`, and `goToTest` are evaluated at runtime (test scope; `goToTest` jumps to a test within the spec), while `retry` and `goToStep` are not applicable at test scope.
1335
+ */
1336
+ export type Routing78 = {
1337
+ [k: string]: unknown;
1338
+ };
1339
+ /**
1340
+ * A single dynamic-routing entry: an optional condition (`if`) plus exactly one routing action. Attached to a step or test handler (`onPass`, `onFail`, `onWarning`, `onSkip`). For step-level handlers, `continue`, `stop`, `retry`, and `goToStep` are evaluated at runtime; `goToTest` is validated but not yet executed (deferred at step scope). For test-level handlers, `continue`, `stop`, and `goToTest` are evaluated at runtime (test scope; `goToTest` jumps to a test within the spec), while `retry` and `goToStep` are not applicable at test scope.
1341
+ */
1342
+ export type Routing79 = {
1343
+ [k: string]: unknown;
1344
+ };
1221
1345
  /**
1222
1346
  * Pause (in milliseconds) before performing the next action.
1223
1347
  */
@@ -4810,6 +4934,334 @@ export interface SourceLocation18 {
4810
4934
  */
4811
4935
  endIndex: number;
4812
4936
  }
4937
+ export interface Swipe {
4938
+ swipe: Swipe1;
4939
+ [k: string]: unknown;
4940
+ }
4941
+ export interface SwipeDirectional {
4942
+ direction: SwipeSimple1;
4943
+ /**
4944
+ * How far to swipe, as a fraction of the surface's height (for up/down) or width (for left/right).
4945
+ */
4946
+ distance?: number;
4947
+ /**
4948
+ * Duration of the swipe movement in milliseconds.
4949
+ */
4950
+ duration?: number;
4951
+ /**
4952
+ * The browser window/tab or app window this step acts on. Omit to act on the active tab. The targeted surface stays focused afterward. App surfaces use the object form ({ "app": … }).
4953
+ */
4954
+ surface?: SurfaceByBrowserEngine5 | BrowserSurface8 | AppSurface4;
4955
+ }
4956
+ export interface BrowserSurface8 {
4957
+ /**
4958
+ * Browser engine. Selects the browser surface with that engine (or the one named by `name`). A goTo step opens the browser if it isn't open yet; other steps require it to already be open.
4959
+ */
4960
+ browser: "chrome" | "firefox" | "safari" | "webkit" | "edge";
4961
+ /**
4962
+ * Name of the browser surface. Defaults to the engine name (the context's default browser registers under its engine). Assign distinct names to drive multiple browsers at once, including several of the same engine.
4963
+ */
4964
+ name?: string;
4965
+ window?: WindowTabSelector16;
4966
+ tab?: WindowTabSelector17;
4967
+ }
4968
+ export interface ByCriteria20 {
4969
+ /**
4970
+ * Name assigned when the window/tab was opened.
4971
+ */
4972
+ name?: string;
4973
+ /**
4974
+ * Index in creation order. Negative counts from the end.
4975
+ */
4976
+ index?: number;
4977
+ /**
4978
+ * Page title to match. Substring, or /regex/.
4979
+ */
4980
+ title?: string;
4981
+ /**
4982
+ * Page URL to match. Substring, or /regex/.
4983
+ */
4984
+ url?: string;
4985
+ }
4986
+ export interface ByCriteria21 {
4987
+ /**
4988
+ * Name assigned when the window/tab was opened.
4989
+ */
4990
+ name?: string;
4991
+ /**
4992
+ * Index in creation order. Negative counts from the end.
4993
+ */
4994
+ index?: number;
4995
+ /**
4996
+ * Page title to match. Substring, or /regex/.
4997
+ */
4998
+ title?: string;
4999
+ /**
5000
+ * Page URL to match. Substring, or /regex/.
5001
+ */
5002
+ url?: string;
5003
+ }
5004
+ export interface AppSurface4 {
5005
+ /**
5006
+ * Name of an app surface opened by `startSurface` (its `name`, or the default derived from the app identifier).
5007
+ */
5008
+ app: string;
5009
+ window?: AppWindowSelector4;
5010
+ }
5011
+ export interface ByCriteria22 {
5012
+ /**
5013
+ * Assigned window name.
5014
+ */
5015
+ name?: string;
5016
+ /**
5017
+ * Index in creation order. Negative counts from the end.
5018
+ */
5019
+ index?: number;
5020
+ /**
5021
+ * Window title to match. Substring, or /regex/.
5022
+ */
5023
+ title?: string;
5024
+ }
5025
+ export interface SwipePointToPoint {
5026
+ from: Point;
5027
+ to: Point1;
5028
+ /**
5029
+ * Duration of the swipe movement in milliseconds.
5030
+ */
5031
+ duration?: number;
5032
+ /**
5033
+ * The browser window/tab or app window this step acts on. Omit to act on the active tab. The targeted surface stays focused afterward. App surfaces use the object form ({ "app": … }).
5034
+ */
5035
+ surface?: SurfaceByBrowserEngine6 | BrowserSurface9 | AppSurface5;
5036
+ }
5037
+ /**
5038
+ * A pixel coordinate on the surface, measured from its top-left corner (0, 0).
5039
+ */
5040
+ export interface Point {
5041
+ /**
5042
+ * Horizontal position in pixels from the left edge of the surface (the app window, or the browser viewport).
5043
+ */
5044
+ x: number;
5045
+ /**
5046
+ * Vertical position in pixels from the top edge of the surface (the app window, or the browser viewport).
5047
+ */
5048
+ y: number;
5049
+ }
5050
+ /**
5051
+ * A pixel coordinate on the surface, measured from its top-left corner (0, 0).
5052
+ */
5053
+ export interface Point1 {
5054
+ /**
5055
+ * Horizontal position in pixels from the left edge of the surface (the app window, or the browser viewport).
5056
+ */
5057
+ x: number;
5058
+ /**
5059
+ * Vertical position in pixels from the top edge of the surface (the app window, or the browser viewport).
5060
+ */
5061
+ y: number;
5062
+ }
5063
+ export interface BrowserSurface9 {
5064
+ /**
5065
+ * Browser engine. Selects the browser surface with that engine (or the one named by `name`). A goTo step opens the browser if it isn't open yet; other steps require it to already be open.
5066
+ */
5067
+ browser: "chrome" | "firefox" | "safari" | "webkit" | "edge";
5068
+ /**
5069
+ * Name of the browser surface. Defaults to the engine name (the context's default browser registers under its engine). Assign distinct names to drive multiple browsers at once, including several of the same engine.
5070
+ */
5071
+ name?: string;
5072
+ window?: WindowTabSelector18;
5073
+ tab?: WindowTabSelector19;
5074
+ }
5075
+ export interface ByCriteria23 {
5076
+ /**
5077
+ * Name assigned when the window/tab was opened.
5078
+ */
5079
+ name?: string;
5080
+ /**
5081
+ * Index in creation order. Negative counts from the end.
5082
+ */
5083
+ index?: number;
5084
+ /**
5085
+ * Page title to match. Substring, or /regex/.
5086
+ */
5087
+ title?: string;
5088
+ /**
5089
+ * Page URL to match. Substring, or /regex/.
5090
+ */
5091
+ url?: string;
5092
+ }
5093
+ export interface ByCriteria24 {
5094
+ /**
5095
+ * Name assigned when the window/tab was opened.
5096
+ */
5097
+ name?: string;
5098
+ /**
5099
+ * Index in creation order. Negative counts from the end.
5100
+ */
5101
+ index?: number;
5102
+ /**
5103
+ * Page title to match. Substring, or /regex/.
5104
+ */
5105
+ title?: string;
5106
+ /**
5107
+ * Page URL to match. Substring, or /regex/.
5108
+ */
5109
+ url?: string;
5110
+ }
5111
+ export interface AppSurface5 {
5112
+ /**
5113
+ * Name of an app surface opened by `startSurface` (its `name`, or the default derived from the app identifier).
5114
+ */
5115
+ app: string;
5116
+ window?: AppWindowSelector5;
5117
+ }
5118
+ export interface ByCriteria25 {
5119
+ /**
5120
+ * Assigned window name.
5121
+ */
5122
+ name?: string;
5123
+ /**
5124
+ * Index in creation order. Negative counts from the end.
5125
+ */
5126
+ index?: number;
5127
+ /**
5128
+ * Window title to match. Substring, or /regex/.
5129
+ */
5130
+ title?: string;
5131
+ }
5132
+ export interface Common19 {
5133
+ /**
5134
+ * JSON Schema for this object.
5135
+ */
5136
+ $schema?: "https://raw.githubusercontent.com/doc-detective/common/refs/heads/main/dist/schemas/step_v3.schema.json";
5137
+ /**
5138
+ * ID of the step.
5139
+ */
5140
+ stepId?: string;
5141
+ /**
5142
+ * Description of the step.
5143
+ */
5144
+ description?: string;
5145
+ /**
5146
+ * Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.
5147
+ */
5148
+ unsafe?: boolean;
5149
+ outputs?: OutputsStep19;
5150
+ variables?: VariablesStep19;
5151
+ /**
5152
+ * Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled.
5153
+ */
5154
+ breakpoint?: boolean;
5155
+ if?: Condition38;
5156
+ /**
5157
+ * Assertions for this step. As authored input, a custom condition expression (or array of expressions, combined with logical AND). In a test result, the runner replaces this with the array of articulated assertion records it evaluated (implicit then custom).
5158
+ */
5159
+ assertions?: Condition39 | Assertion19[];
5160
+ /**
5161
+ * Routing entries evaluated when this step passes. The first entry whose `if` matches applies. `continue`, `stop`, `retry`, and `goToStep` are honored at runtime; `goToTest` is validated but not yet executed.
5162
+ */
5163
+ onPass?: Routing76[];
5164
+ /**
5165
+ * Routing entries evaluated when this step fails. The first entry whose `if` matches applies; the default when none is set stops the test. `continue`, `stop`, `retry`, and `goToStep` are honored at runtime; `goToTest` is validated but not yet executed.
5166
+ */
5167
+ onFail?: Routing77[];
5168
+ /**
5169
+ * Routing entries evaluated when this step produces a warning. The first entry whose `if` matches applies. `continue`, `stop`, `retry`, and `goToStep` are honored at runtime; `goToTest` is validated but not yet executed.
5170
+ */
5171
+ onWarning?: Routing78[];
5172
+ /**
5173
+ * Routing entries evaluated when this step is skipped (reached but not run — unsafe-blocked or guard-`if` false). The first entry whose `if` matches applies. `continue`, `stop`, and `goToStep` are honored at runtime; `goToTest` is validated but not yet executed. (`retry` is a no-op here — a step that never ran cannot be re-run.)
5174
+ */
5175
+ onSkip?: Routing79[];
5176
+ location?: SourceLocation19;
5177
+ /**
5178
+ * Path, relative to the run's artifact directory (the report's `runDir`), of the screenshot captured automatically after this step. Always a non-empty, forward-slash, relative path. Present only in test results, when `autoScreenshot` is enabled and the capture succeeded. This is system-populated metadata and should not be set manually.
5179
+ */
5180
+ autoScreenshot?: string;
5181
+ /**
5182
+ * Total number of times this step ran (the initial attempt plus retries) when a routing `retry` action re-ran it. Present only in test results, and only when the step was retried at least once (so the value is always >= 2). This is system-populated metadata and should not be set manually.
5183
+ */
5184
+ attempts?: number;
5185
+ /**
5186
+ * Which visit of this step produced this report, when a routing goToStep re-ran it (the first visit omits this field). Present only in test results; system-populated.
5187
+ */
5188
+ visit?: number;
5189
+ [k: string]: unknown;
5190
+ }
5191
+ /**
5192
+ * Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.
5193
+ */
5194
+ export interface OutputsStep19 {
5195
+ /**
5196
+ * Runtime expression for a user-defined output value.
5197
+ *
5198
+ * This interface was referenced by `OutputsStep19`'s JSON-Schema definition
5199
+ * via the `patternProperty` "^[A-Za-z0-9_]+$".
5200
+ */
5201
+ [k: string]: string;
5202
+ }
5203
+ /**
5204
+ * Environment variables to set from user-defined expressions.
5205
+ */
5206
+ export interface VariablesStep19 {
5207
+ /**
5208
+ * Runtime expression for a user-defined output value.
5209
+ *
5210
+ * This interface was referenced by `VariablesStep19`'s JSON-Schema definition
5211
+ * via the `patternProperty` "^[A-Za-z0-9_]+$".
5212
+ */
5213
+ [k: string]: string;
5214
+ }
5215
+ /**
5216
+ * An articulated assertion record produced by the runner for a step result. Each record names a single verification check, whether it passed, and the values it compared. The step's result is the roll-up of its assertion results (FAIL > WARNING > all-SKIPPED > PASS). System-populated; appears in test results, not in authored specs.
5217
+ */
5218
+ export interface Assertion19 {
5219
+ /**
5220
+ * Human-readable articulation of the check, e.g. `exitCode in [0]`.
5221
+ */
5222
+ statement: string;
5223
+ /**
5224
+ * Who defined the assertion: `implicit` (runner-defined) or `custom` (user-defined).
5225
+ */
5226
+ source: "implicit" | "custom";
5227
+ /**
5228
+ * Outcome of evaluating the assertion.
5229
+ */
5230
+ result: "PASS" | "FAIL" | "WARNING" | "SKIPPED";
5231
+ /**
5232
+ * The value (or values) the assertion expected. Optional.
5233
+ */
5234
+ expected?: unknown[] | boolean | number | null | {
5235
+ [k: string]: unknown;
5236
+ } | string;
5237
+ /**
5238
+ * The value actually observed. Optional.
5239
+ */
5240
+ actual?: unknown[] | boolean | number | null | {
5241
+ [k: string]: unknown;
5242
+ } | string;
5243
+ /**
5244
+ * Human-readable explanation of the outcome. Optional.
5245
+ */
5246
+ description?: string;
5247
+ }
5248
+ /**
5249
+ * Source location where this step was detected in the original file. This is system-populated metadata and should not be set manually.
5250
+ */
5251
+ export interface SourceLocation19 {
5252
+ /**
5253
+ * 1-indexed line number in the source file where the step was detected.
5254
+ */
5255
+ line: number;
5256
+ /**
5257
+ * 0-indexed character offset from the start of the source file where the step begins.
5258
+ */
5259
+ startIndex: number;
5260
+ /**
5261
+ * 0-indexed character offset from the start of the source file where the step ends (exclusive).
5262
+ */
5263
+ endIndex: number;
5264
+ }
4813
5265
  export interface Wait {
4814
5266
  wait: Wait1;
4815
5267
  [k: string]: unknown;