@rehearsal-labs/retest 0.1.0 → 0.2.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.
- package/README.md +6 -0
- package/dist/agent/session.d.ts +21 -2
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +73 -11
- package/dist/api/app-page.d.ts +39 -3
- package/dist/api/app-page.d.ts.map +1 -1
- package/dist/api/app-page.js +108 -0
- package/dist/api/dialog.d.ts +38 -0
- package/dist/api/dialog.d.ts.map +1 -0
- package/dist/api/dialog.js +78 -0
- package/dist/api/drag.d.ts +32 -0
- package/dist/api/drag.d.ts.map +1 -0
- package/dist/api/drag.js +26 -0
- package/dist/api/files.d.ts +49 -0
- package/dist/api/files.d.ts.map +1 -0
- package/dist/api/files.js +168 -0
- package/dist/api/inbox.d.ts +97 -0
- package/dist/api/inbox.d.ts.map +1 -0
- package/dist/api/inbox.js +191 -0
- package/dist/api/locator-recipes.d.ts +1 -1
- package/dist/api/locator-recipes.d.ts.map +1 -1
- package/dist/api/locator-recipes.js +4 -3
- package/dist/api/page.d.ts +214 -4
- package/dist/api/page.d.ts.map +1 -1
- package/dist/api/route.d.ts +21 -0
- package/dist/api/route.d.ts.map +1 -0
- package/dist/api/route.js +99 -0
- package/dist/api/test-run.d.ts +127 -1
- package/dist/api/test-run.d.ts.map +1 -1
- package/dist/api/test-run.js +293 -0
- package/dist/assertions/expect.d.ts +91 -2
- package/dist/assertions/expect.d.ts.map +1 -1
- package/dist/assertions/expect.js +98 -0
- package/dist/assertions/look-until.d.ts +5 -0
- package/dist/assertions/look-until.d.ts.map +1 -1
- package/dist/assertions/look-until.js +1 -1
- package/dist/assertions/poll-layout.d.ts +24 -0
- package/dist/assertions/poll-layout.d.ts.map +1 -0
- package/dist/assertions/poll-layout.js +63 -0
- package/dist/assertions/screenshot.d.ts +36 -0
- package/dist/assertions/screenshot.d.ts.map +1 -0
- package/dist/assertions/screenshot.js +125 -0
- package/dist/browser/accessibility.d.ts.map +1 -1
- package/dist/browser/accessibility.js +22 -1
- package/dist/browser/actionability.d.ts +9 -6
- package/dist/browser/actionability.d.ts.map +1 -1
- package/dist/browser/actionability.js +17 -8
- package/dist/browser/browser.d.ts.map +1 -1
- package/dist/browser/browser.js +15 -4
- package/dist/browser/cdp/connection.d.ts +6 -0
- package/dist/browser/cdp/connection.d.ts.map +1 -1
- package/dist/browser/cdp/connection.js +8 -0
- package/dist/browser/checked-state.d.ts +2 -2
- package/dist/browser/checked-state.d.ts.map +1 -1
- package/dist/browser/chromium-process.d.ts +9 -2
- package/dist/browser/chromium-process.d.ts.map +1 -1
- package/dist/browser/chromium-process.js +17 -4
- package/dist/browser/contract.d.ts +119 -5
- package/dist/browser/contract.d.ts.map +1 -1
- package/dist/browser/dialogs.d.ts +157 -0
- package/dist/browser/dialogs.d.ts.map +1 -0
- package/dist/browser/dialogs.js +271 -0
- package/dist/browser/downloads.d.ts +71 -0
- package/dist/browser/downloads.d.ts.map +1 -0
- package/dist/browser/downloads.js +253 -0
- package/dist/browser/drag.d.ts +50 -0
- package/dist/browser/drag.d.ts.map +1 -0
- package/dist/browser/drag.js +584 -0
- package/dist/browser/electron-window-watch.d.ts +32 -0
- package/dist/browser/electron-window-watch.d.ts.map +1 -0
- package/dist/browser/electron-window-watch.js +93 -0
- package/dist/browser/electron.d.ts +13 -2
- package/dist/browser/electron.d.ts.map +1 -1
- package/dist/browser/electron.js +53 -8
- package/dist/browser/element-queries.d.ts +51 -15
- package/dist/browser/element-queries.d.ts.map +1 -1
- package/dist/browser/element-queries.js +92 -13
- package/dist/browser/emulation.d.ts.map +1 -1
- package/dist/browser/emulation.js +7 -5
- package/dist/browser/file-chooser.d.ts +75 -0
- package/dist/browser/file-chooser.d.ts.map +1 -0
- package/dist/browser/file-chooser.js +449 -0
- package/dist/browser/firefox/input.d.ts +5 -0
- package/dist/browser/firefox/input.d.ts.map +1 -1
- package/dist/browser/firefox/input.js +6 -3
- package/dist/browser/firefox/page.d.ts +11 -1
- package/dist/browser/firefox/page.d.ts.map +1 -1
- package/dist/browser/firefox/page.js +66 -7
- package/dist/browser/frames.d.ts +205 -0
- package/dist/browser/frames.d.ts.map +1 -0
- package/dist/browser/frames.js +657 -0
- package/dist/browser/input-guard.d.ts +18 -5
- package/dist/browser/input-guard.d.ts.map +1 -1
- package/dist/browser/input-guard.js +65 -6
- package/dist/browser/isolated-world.d.ts +8 -1
- package/dist/browser/isolated-world.d.ts.map +1 -1
- package/dist/browser/layout.d.ts +120 -0
- package/dist/browser/layout.d.ts.map +1 -0
- package/dist/browser/layout.js +213 -0
- package/dist/browser/locate.d.ts +10 -0
- package/dist/browser/locate.d.ts.map +1 -1
- package/dist/browser/locate.js +24 -6
- package/dist/browser/origin-document.d.ts +4 -0
- package/dist/browser/origin-document.d.ts.map +1 -1
- package/dist/browser/origin-document.js +9 -1
- package/dist/browser/page-scripts.d.ts +48 -0
- package/dist/browser/page-scripts.d.ts.map +1 -1
- package/dist/browser/page-scripts.js +515 -39
- package/dist/browser/page.d.ts +60 -1
- package/dist/browser/page.d.ts.map +1 -1
- package/dist/browser/page.js +275 -32
- package/dist/browser/popups.d.ts +166 -0
- package/dist/browser/popups.d.ts.map +1 -0
- package/dist/browser/popups.js +317 -0
- package/dist/browser/routes.d.ts +97 -0
- package/dist/browser/routes.d.ts.map +1 -0
- package/dist/browser/routes.js +226 -0
- package/dist/browser/screenshot.d.ts +44 -0
- package/dist/browser/screenshot.d.ts.map +1 -0
- package/dist/browser/screenshot.js +51 -0
- package/dist/browser/shadow-candidates.d.ts +20 -0
- package/dist/browser/shadow-candidates.d.ts.map +1 -0
- package/dist/browser/shadow-candidates.js +77 -0
- package/dist/browser/webkit/page.d.ts +11 -1
- package/dist/browser/webkit/page.d.ts.map +1 -1
- package/dist/browser/webkit/page.js +53 -2
- package/dist/browser/webkit/relay.d.ts.map +1 -1
- package/dist/browser/webkit/relay.js +5 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +2 -0
- package/dist/cli/inspect/test-timeline.d.ts.map +1 -1
- package/dist/cli/inspect/test-timeline.js +38 -4
- package/dist/config/loaded.d.ts +12 -2
- package/dist/config/loaded.d.ts.map +1 -1
- package/dist/config/read-inboxes.d.ts +10 -0
- package/dist/config/read-inboxes.d.ts.map +1 -0
- package/dist/config/read-inboxes.js +78 -0
- package/dist/config/register.d.ts +5 -1
- package/dist/config/register.d.ts.map +1 -1
- package/dist/config/types.d.ts +36 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/validate.d.ts.map +1 -1
- package/dist/config/validate.js +4 -1
- package/dist/diagnostics/artifact.d.ts.map +1 -1
- package/dist/diagnostics/artifact.js +10 -2
- package/dist/diagnostics/attempt.d.ts +5 -0
- package/dist/diagnostics/attempt.d.ts.map +1 -1
- package/dist/diagnostics/attempt.js +10 -0
- package/dist/diagnostics/chromium-collector.d.ts +9 -1
- package/dist/diagnostics/chromium-collector.d.ts.map +1 -1
- package/dist/diagnostics/chromium-collector.js +19 -4
- package/dist/diagnostics/observations.d.ts +8 -0
- package/dist/diagnostics/observations.d.ts.map +1 -1
- package/dist/diagnostics/session-capture.d.ts.map +1 -1
- package/dist/diagnostics/session-capture.js +8 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/media/policy.d.ts +2 -2
- package/dist/media/policy.d.ts.map +1 -1
- package/dist/media/policy.js +1 -1
- package/dist/playwright/not-yet.d.ts.map +1 -1
- package/dist/playwright/not-yet.js +5 -2
- package/dist/protocol/commands.d.ts +122 -13
- package/dist/protocol/commands.d.ts.map +1 -1
- package/dist/protocol/commands.js +85 -6
- package/dist/protocol/diagnostics.d.ts +10 -0
- package/dist/protocol/diagnostics.d.ts.map +1 -1
- package/dist/protocol/diagnostics.js +5 -0
- package/dist/protocol/dialogs.d.ts +104 -0
- package/dist/protocol/dialogs.d.ts.map +1 -0
- package/dist/protocol/dialogs.js +101 -0
- package/dist/protocol/drag.d.ts +45 -0
- package/dist/protocol/drag.d.ts.map +1 -0
- package/dist/protocol/drag.js +31 -0
- package/dist/protocol/events.d.ts +153 -1
- package/dist/protocol/events.d.ts.map +1 -1
- package/dist/protocol/events.js +97 -0
- package/dist/protocol/files.d.ts +83 -0
- package/dist/protocol/files.d.ts.map +1 -0
- package/dist/protocol/files.js +68 -0
- package/dist/protocol/inbox.d.ts +87 -0
- package/dist/protocol/inbox.d.ts.map +1 -0
- package/dist/protocol/inbox.js +51 -0
- package/dist/protocol/index.d.ts +4 -1
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/layout-checks.d.ts +83 -0
- package/dist/protocol/layout-checks.d.ts.map +1 -0
- package/dist/protocol/layout-checks.js +214 -0
- package/dist/protocol/layout.d.ts +135 -0
- package/dist/protocol/layout.d.ts.map +1 -0
- package/dist/protocol/layout.js +124 -0
- package/dist/protocol/locator-checks.d.ts +19 -2
- package/dist/protocol/locator-checks.d.ts.map +1 -1
- package/dist/protocol/locator-checks.js +23 -1
- package/dist/protocol/locator.d.ts +55 -7
- package/dist/protocol/locator.d.ts.map +1 -1
- package/dist/protocol/locator.js +99 -18
- package/dist/protocol/messages.d.ts +95 -0
- package/dist/protocol/messages.d.ts.map +1 -1
- package/dist/protocol/messages.js +63 -0
- package/dist/protocol/popups.d.ts +43 -0
- package/dist/protocol/popups.d.ts.map +1 -0
- package/dist/protocol/popups.js +27 -0
- package/dist/protocol/result.d.ts +5 -0
- package/dist/protocol/result.d.ts.map +1 -1
- package/dist/protocol/result.js +1 -0
- package/dist/protocol/routes.d.ts +136 -0
- package/dist/protocol/routes.d.ts.map +1 -0
- package/dist/protocol/routes.js +191 -0
- package/dist/protocol/screenshot.d.ts +219 -0
- package/dist/protocol/screenshot.d.ts.map +1 -0
- package/dist/protocol/screenshot.js +335 -0
- package/dist/reporters/actions.d.ts +6 -4
- package/dist/reporters/actions.d.ts.map +1 -1
- package/dist/reporters/actions.js +24 -6
- package/dist/reporters/agent.d.ts.map +1 -1
- package/dist/reporters/agent.js +4 -2
- package/dist/reporters/dialogs-popups.d.ts +22 -0
- package/dist/reporters/dialogs-popups.d.ts.map +1 -0
- package/dist/reporters/dialogs-popups.js +30 -0
- package/dist/reporters/failure-card.d.ts +10 -1
- package/dist/reporters/failure-card.d.ts.map +1 -1
- package/dist/reporters/failure-card.js +5 -1
- package/dist/reporters/format.d.ts +33 -0
- package/dist/reporters/format.d.ts.map +1 -1
- package/dist/reporters/format.js +42 -0
- package/dist/reporters/html/comparison-view.d.ts +12 -0
- package/dist/reporters/html/comparison-view.d.ts.map +1 -0
- package/dist/reporters/html/comparison-view.js +21 -0
- package/dist/reporters/html/diagnostics-view.js +8 -0
- package/dist/reporters/html/downloads-view.d.ts +10 -0
- package/dist/reporters/html/downloads-view.d.ts.map +1 -0
- package/dist/reporters/html/downloads-view.js +29 -0
- package/dist/reporters/html/style.d.ts.map +1 -1
- package/dist/reporters/html/style.js +3 -0
- package/dist/reporters/html/summary-view.d.ts.map +1 -1
- package/dist/reporters/html/summary-view.js +3 -2
- package/dist/reporters/html/test-view.d.ts.map +1 -1
- package/dist/reporters/html/test-view.js +6 -3
- package/dist/reporters/html/timeline-view.d.ts.map +1 -1
- package/dist/reporters/html/timeline-view.js +26 -2
- package/dist/reporters/human-card.js +10 -0
- package/dist/reporters/human.d.ts.map +1 -1
- package/dist/reporters/human.js +3 -1
- package/dist/reporters/routes.d.ts +9 -0
- package/dist/reporters/routes.d.ts.map +1 -0
- package/dist/reporters/routes.js +17 -0
- package/dist/runner/child-program.js +10 -0
- package/dist/runner/contract.d.ts +5 -0
- package/dist/runner/contract.d.ts.map +1 -1
- package/dist/runner/dialogs.d.ts +71 -0
- package/dist/runner/dialogs.d.ts.map +1 -0
- package/dist/runner/dialogs.js +189 -0
- package/dist/runner/files.d.ts +79 -0
- package/dist/runner/files.d.ts.map +1 -0
- package/dist/runner/files.js +312 -0
- package/dist/runner/inbox-links.d.ts +19 -0
- package/dist/runner/inbox-links.d.ts.map +1 -0
- package/dist/runner/inbox-links.js +63 -0
- package/dist/runner/inbox.d.ts +87 -0
- package/dist/runner/inbox.d.ts.map +1 -0
- package/dist/runner/inbox.js +340 -0
- package/dist/runner/index.d.ts +2 -1
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/native-pool.d.ts.map +1 -1
- package/dist/runner/native-pool.js +2 -0
- package/dist/runner/observations.d.ts +15 -2
- package/dist/runner/observations.d.ts.map +1 -1
- package/dist/runner/observations.js +109 -6
- package/dist/runner/popups.d.ts +82 -0
- package/dist/runner/popups.d.ts.map +1 -0
- package/dist/runner/popups.js +236 -0
- package/dist/runner/redactor.d.ts.map +1 -1
- package/dist/runner/redactor.js +10 -6
- package/dist/runner/routes.d.ts +23 -0
- package/dist/runner/routes.d.ts.map +1 -0
- package/dist/runner/routes.js +128 -0
- package/dist/runner/run-media.d.ts +6 -0
- package/dist/runner/run-media.d.ts.map +1 -1
- package/dist/runner/run-media.js +21 -0
- package/dist/runner/run-session.d.ts.map +1 -1
- package/dist/runner/run-session.js +93 -8
- package/dist/runner/running-test.d.ts +35 -0
- package/dist/runner/running-test.d.ts.map +1 -1
- package/dist/runner/running-test.js +333 -22
- package/dist/runner/screenshot-baselines.d.ts +159 -0
- package/dist/runner/screenshot-baselines.d.ts.map +1 -0
- package/dist/runner/screenshot-baselines.js +357 -0
- package/dist/runner/secrets.d.ts +13 -0
- package/dist/runner/secrets.d.ts.map +1 -1
- package/dist/runner/secrets.js +6 -4
- package/dist/runner/test-pages.d.ts +3 -1
- package/dist/runner/test-pages.d.ts.map +1 -1
- package/dist/runner/test-pages.js +4 -3
- package/dist/schemas/event-v1.schema.json +118873 -6311
- package/dist/schemas/result-v1.schema.json +4 -0
- package/dist/shared/image-diff.d.ts +36 -0
- package/dist/shared/image-diff.d.ts.map +1 -0
- package/dist/shared/image-diff.js +242 -0
- package/dist/shared/metadata-process.d.ts +4 -1
- package/dist/shared/metadata-process.d.ts.map +1 -1
- package/dist/shared/metadata-process.js +51 -9
- package/dist/shared/png.d.ts +35 -0
- package/dist/shared/png.d.ts.map +1 -0
- package/dist/shared/png.js +251 -0
- package/dist/shared/process-ownership.d.ts +15 -4
- package/dist/shared/process-ownership.d.ts.map +1 -1
- package/dist/shared/process-ownership.js +123 -34
- package/dist/store/artifacts.d.ts +23 -2
- package/dist/store/artifacts.d.ts.map +1 -1
- package/dist/store/artifacts.js +40 -1
- package/dist/store/rebuild-result.d.ts.map +1 -1
- package/dist/store/rebuild-result.js +6 -0
- package/package.json +1 -1
|
@@ -159,6 +159,9 @@ export type NetworkResponseRecord = DiagnosticIdentity & NativeNetworkProvenance
|
|
|
159
159
|
serviceWorker?: boolean;
|
|
160
160
|
protocol?: string;
|
|
161
161
|
redirectedTo?: string;
|
|
162
|
+
/** The response was the test's own: a route of the page gave it in the network's place. `route` is its pattern. */
|
|
163
|
+
mocked?: true;
|
|
164
|
+
route?: string;
|
|
162
165
|
};
|
|
163
166
|
/**
|
|
164
167
|
* A hop that finished: for a redirect, when its response arrived. `durationMs` is the browser's own measure from the
|
|
@@ -186,6 +189,13 @@ export type NetworkFailedRecord = DiagnosticIdentity & NativeNetworkProvenance &
|
|
|
186
189
|
reason: string;
|
|
187
190
|
canceled?: true;
|
|
188
191
|
blocked?: string;
|
|
192
|
+
/**
|
|
193
|
+
* The failure was the test's own: a route of the page refused the request. `route` is its pattern, and
|
|
194
|
+
* `routeRefused` Chrome's reason when Chrome refused the route's answer, so Retest failed the request in its place.
|
|
195
|
+
*/
|
|
196
|
+
mocked?: true;
|
|
197
|
+
route?: string;
|
|
198
|
+
routeRefused?: string;
|
|
189
199
|
};
|
|
190
200
|
/**
|
|
191
201
|
* Why a hop's end is not recorded: it was still open when the attempt ended, the run was interrupted, the page crashed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/protocol/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MA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C;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAAA;AAEtJ,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,mBAAmB,CAAA;AASxF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,eAAe,CAMxD,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,gBAAgB,CAO1D,CAAA;AAwBF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,CAKtD,CAAA;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,CAKtD,CAAA;AAEF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,kBAAkB,CAS9D,CAAA;AAEF,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,uBAAuB,CAWxE,CAAA;AA0GF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,gBAAgB,CAQ1D,CAAA;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,CAUtD,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC,GAAG,SAAS,CAE1I"}
|
|
@@ -149,6 +149,8 @@ const responseShape = {
|
|
|
149
149
|
serviceWorker: s.optional(s.boolean()),
|
|
150
150
|
protocol: s.optional(s.string()),
|
|
151
151
|
redirectedTo: s.optional(s.string()),
|
|
152
|
+
mocked: s.optional(s.literal(true)),
|
|
153
|
+
route: s.optional(s.string()),
|
|
152
154
|
};
|
|
153
155
|
const finishedShape = {
|
|
154
156
|
...nativeNetworkProvenance,
|
|
@@ -169,6 +171,9 @@ const failedShape = {
|
|
|
169
171
|
reason: s.string(),
|
|
170
172
|
canceled: s.optional(s.literal(true)),
|
|
171
173
|
blocked: s.optional(s.string()),
|
|
174
|
+
mocked: s.optional(s.literal(true)),
|
|
175
|
+
route: s.optional(s.string()),
|
|
176
|
+
routeRefused: s.optional(s.string()),
|
|
172
177
|
};
|
|
173
178
|
const pendingShape = {
|
|
174
179
|
...identity,
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type Failure } from './failures.ts';
|
|
2
|
+
import { type Schema } from './schema.ts';
|
|
3
|
+
/** The kinds of JavaScript dialog a page can open. */
|
|
4
|
+
export type DialogType = 'alert' | 'confirm' | 'prompt' | 'beforeunload';
|
|
5
|
+
export declare const dialogTypes: readonly DialogType[];
|
|
6
|
+
/**
|
|
7
|
+
* A dialog as the test file's process receives it: its id within the attempt, its kind, the text the page showed and a
|
|
8
|
+
* prompt's default, both with every value the run hides replaced. A dialog other than a prompt has an empty default.
|
|
9
|
+
*/
|
|
10
|
+
export type DialogRecord = {
|
|
11
|
+
id: string;
|
|
12
|
+
type: DialogType;
|
|
13
|
+
message: string;
|
|
14
|
+
defaultValue: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* What a test asks of an app's page about dialogs: to wait for the next one, to stop a wait whose action failed before
|
|
18
|
+
* any dialog opened, naming the wait by its id, or to answer a dialog it was given, with the text a prompt takes.
|
|
19
|
+
*/
|
|
20
|
+
export type DialogRequest = {
|
|
21
|
+
kind: 'wait';
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'stop';
|
|
24
|
+
wait: number;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'answer';
|
|
27
|
+
dialog: string;
|
|
28
|
+
accept: boolean;
|
|
29
|
+
promptText?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The parent's answers. A wait is first `armed`, once the page hands its next dialog to the test, then `opened` with that
|
|
33
|
+
* dialog, or `failed` at either point. A stop is `stopped`, and an answer `answered` or `failed`.
|
|
34
|
+
*/
|
|
35
|
+
export type DialogAnswer = {
|
|
36
|
+
kind: 'armed';
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'opened';
|
|
39
|
+
dialog: DialogRecord;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'stopped';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'answered';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'failed';
|
|
46
|
+
failure: Failure;
|
|
47
|
+
};
|
|
48
|
+
/** How a dialog was answered: accepted or dismissed. */
|
|
49
|
+
export type DialogAnswered = 'accepted' | 'dismissed';
|
|
50
|
+
/** How many code units of a dialog's text an event records, as a title is cut. */
|
|
51
|
+
export declare const dialogTextLimit = 300;
|
|
52
|
+
export declare const dialogTypeSchema: Schema<DialogType>;
|
|
53
|
+
export declare const dialogRecordSchema: Schema<DialogRecord>;
|
|
54
|
+
export declare const dialogRequestSchema: Schema<DialogRequest>;
|
|
55
|
+
export declare const dialogAnswerSchema: Schema<DialogAnswer>;
|
|
56
|
+
/**
|
|
57
|
+
* Whether a value names a kind of dialog, as Chrome's `Page.javascriptDialogOpening` reports it.
|
|
58
|
+
*
|
|
59
|
+
* @example isDialogType('confirm') // true
|
|
60
|
+
*/
|
|
61
|
+
export declare function isDialogType(value: string): value is DialogType;
|
|
62
|
+
/**
|
|
63
|
+
* Who reads a dialog's sentence: a test, which can wrap an action in `page.dialog()`, or an agent session, which cannot
|
|
64
|
+
* and is told what Retest answered instead.
|
|
65
|
+
*/
|
|
66
|
+
export type DialogReader = 'test' | 'agent';
|
|
67
|
+
/** A dialog Retest answered itself because nothing waited for it, as a failure's sentence names it. */
|
|
68
|
+
export type UnwaitedDialogParts = {
|
|
69
|
+
type: DialogType;
|
|
70
|
+
/** The text the page showed, as a sentence may quote it: redacted, or left out where it cannot be. */
|
|
71
|
+
text?: string | undefined;
|
|
72
|
+
answered: DialogAnswered;
|
|
73
|
+
/** The command that was running, as a failure names it, such as "click getByTestId('delete')"; none when idle. */
|
|
74
|
+
command?: string | undefined;
|
|
75
|
+
/** The dialog came from a page this page opened while nothing waited for it. */
|
|
76
|
+
popup?: boolean | undefined;
|
|
77
|
+
/** Who reads the sentence; a test unless named. */
|
|
78
|
+
reader?: DialogReader | undefined;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The sentence for a dialog nobody waited for, when it is the whole failure of the command that ran meanwhile: its kind
|
|
82
|
+
* and text, what was running, how Retest answered it, and, for a test, how to answer it. A `beforeunload` dialog is
|
|
83
|
+
* accepted, so the navigation the test asked for happens.
|
|
84
|
+
*
|
|
85
|
+
* @example unwaitedDialogMessage({ type: 'confirm', text: 'Delete?', answered: 'dismissed', command: "click getByTestId('delete')" })
|
|
86
|
+
*/
|
|
87
|
+
export declare function unwaitedDialogMessage(parts: UnwaitedDialogParts): string;
|
|
88
|
+
/**
|
|
89
|
+
* The sentence for a dialog nobody waited for, when the command that ran meanwhile failed of its own accord: it follows
|
|
90
|
+
* that command's own message and names the dialog and Retest's answer.
|
|
91
|
+
*
|
|
92
|
+
* @example unwaitedDialogSentence({ type: 'alert', text: 'Saved', answered: 'dismissed' }) // 'The page also opened an alert dialog that says "Saved", and Retest dismissed it.'
|
|
93
|
+
*/
|
|
94
|
+
export declare function unwaitedDialogSentence(parts: UnwaitedDialogParts): string;
|
|
95
|
+
/**
|
|
96
|
+
* A failure that names a dialog Retest answered, in words for its reader, with the dialog's text quoted once `redact` has
|
|
97
|
+
* hidden every value in it. The page gives that text apart, in `details.dialogMessage`, and a failure whose `details`
|
|
98
|
+
* name the command was the dialog's alone; any other is the command's own, with the dialog's sentence after it. Any
|
|
99
|
+
* other failure is given back as it is.
|
|
100
|
+
*
|
|
101
|
+
* @example withDialogWords(failure, (text) => redactor.redact(text), 'agent')
|
|
102
|
+
*/
|
|
103
|
+
export declare function withDialogWords(failure: Failure, redact: (text: string) => string, reader?: DialogReader): Failure;
|
|
104
|
+
//# sourceMappingURL=dialogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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oteText } from "./text.js";
|
|
4
|
+
export const dialogTypes = ['alert', 'confirm', 'prompt', 'beforeunload'];
|
|
5
|
+
/** How many code units of a dialog's text an event records, as a title is cut. */
|
|
6
|
+
export const dialogTextLimit = 300;
|
|
7
|
+
export const dialogTypeSchema = s.enum(['alert', 'confirm', 'prompt', 'beforeunload']);
|
|
8
|
+
export const dialogRecordSchema = s.object({ id: s.string(), type: dialogTypeSchema, message: s.string(), defaultValue: s.string() });
|
|
9
|
+
export const dialogRequestSchema = s.discriminatedUnion('kind', [
|
|
10
|
+
s.object({ kind: s.literal('wait') }),
|
|
11
|
+
s.object({ kind: s.literal('stop'), wait: s.number({ integer: true, min: 0 }) }),
|
|
12
|
+
s.object({ kind: s.literal('answer'), dialog: s.string(), accept: s.boolean(), promptText: s.optional(s.string()) }),
|
|
13
|
+
]);
|
|
14
|
+
export const dialogAnswerSchema = s.discriminatedUnion('kind', [
|
|
15
|
+
s.object({ kind: s.literal('armed') }),
|
|
16
|
+
s.object({ kind: s.literal('opened'), dialog: dialogRecordSchema }),
|
|
17
|
+
s.object({ kind: s.literal('stopped') }),
|
|
18
|
+
s.object({ kind: s.literal('answered') }),
|
|
19
|
+
s.object({ kind: s.literal('failed'), failure: failureSchema }),
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* Whether a value names a kind of dialog, as Chrome's `Page.javascriptDialogOpening` reports it.
|
|
23
|
+
*
|
|
24
|
+
* @example isDialogType('confirm') // true
|
|
25
|
+
*/
|
|
26
|
+
export function isDialogType(value) {
|
|
27
|
+
return dialogTypes.some((type) => type === value);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The sentence for a dialog nobody waited for, when it is the whole failure of the command that ran meanwhile: its kind
|
|
31
|
+
* and text, what was running, how Retest answered it, and, for a test, how to answer it. A `beforeunload` dialog is
|
|
32
|
+
* accepted, so the navigation the test asked for happens.
|
|
33
|
+
*
|
|
34
|
+
* @example unwaitedDialogMessage({ type: 'confirm', text: 'Delete?', answered: 'dismissed', command: "click getByTestId('delete')" })
|
|
35
|
+
*/
|
|
36
|
+
export function unwaitedDialogMessage(parts) {
|
|
37
|
+
const { type, command, popup, reader } = parts;
|
|
38
|
+
const agent = reader === 'agent';
|
|
39
|
+
const who = popup === true ? 'A page this page opened showed' : agent ? 'The page showed' : 'The page opened';
|
|
40
|
+
const when = command === undefined ? (agent ? 'between commands' : 'while no action was running') : `while Retest tried to ${command}`;
|
|
41
|
+
const opened = `${who} ${article(type)} ${type} dialog${says(parts.text)} ${when}.`;
|
|
42
|
+
if (agent)
|
|
43
|
+
return `${opened} ${capitalize(answeredWords(parts))}.`;
|
|
44
|
+
const fix = popup === true ? 'To answer it, take that page with page.popup() and wrap its action in dialog().' : command === undefined ? 'To answer it, wrap the action that opens it in page.dialog().' : 'To answer it, wrap the action in page.dialog().';
|
|
45
|
+
return `${opened} ${capitalize(answeredWords(parts))}. ${fix}`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The sentence for a dialog nobody waited for, when the command that ran meanwhile failed of its own accord: it follows
|
|
49
|
+
* that command's own message and names the dialog and Retest's answer.
|
|
50
|
+
*
|
|
51
|
+
* @example unwaitedDialogSentence({ type: 'alert', text: 'Saved', answered: 'dismissed' }) // 'The page also opened an alert dialog that says "Saved", and Retest dismissed it.'
|
|
52
|
+
*/
|
|
53
|
+
export function unwaitedDialogSentence(parts) {
|
|
54
|
+
const { type, popup, reader } = parts;
|
|
55
|
+
const verb = reader === 'agent' ? 'showed' : 'opened';
|
|
56
|
+
const who = popup === true ? 'A page this page opened also showed' : `The page also ${verb}`;
|
|
57
|
+
return `${who} ${article(type)} ${type} dialog${says(parts.text)}, and ${answeredWords(parts)}.`;
|
|
58
|
+
}
|
|
59
|
+
// What Retest did with a dialog, as a test reads it, or as an agent reads it: the answer a person would have given.
|
|
60
|
+
function answeredWords({ type, answered, reader }) {
|
|
61
|
+
if (reader !== 'agent')
|
|
62
|
+
return answered === 'accepted' ? 'Retest accepted it, so the page could leave' : 'Retest dismissed it';
|
|
63
|
+
if (answered === 'accepted')
|
|
64
|
+
return 'Retest answered yes, so the page could leave';
|
|
65
|
+
return type === 'alert' ? 'Retest closed it' : 'Retest answered no';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A failure that names a dialog Retest answered, in words for its reader, with the dialog's text quoted once `redact` has
|
|
69
|
+
* hidden every value in it. The page gives that text apart, in `details.dialogMessage`, and a failure whose `details`
|
|
70
|
+
* name the command was the dialog's alone; any other is the command's own, with the dialog's sentence after it. Any
|
|
71
|
+
* other failure is given back as it is.
|
|
72
|
+
*
|
|
73
|
+
* @example withDialogWords(failure, (text) => redactor.redact(text), 'agent')
|
|
74
|
+
*/
|
|
75
|
+
export function withDialogWords(failure, redact, reader = 'test') {
|
|
76
|
+
const { details } = failure;
|
|
77
|
+
const text = details?.['dialogMessage'];
|
|
78
|
+
const type = details?.['dialog'];
|
|
79
|
+
const given = details?.['answered'];
|
|
80
|
+
const command = details?.['command'];
|
|
81
|
+
const answered = given === 'accepted' || given === 'dismissed' ? given : undefined;
|
|
82
|
+
if (typeof text !== 'string' || typeof type !== 'string' || !isDialogType(type) || answered === undefined)
|
|
83
|
+
return failure;
|
|
84
|
+
const { dialogMessage: _text, command: _command, ...kept } = details ?? {};
|
|
85
|
+
const parts = { type, answered, popup: details?.['popup'] === true, reader };
|
|
86
|
+
if (typeof command === 'string')
|
|
87
|
+
return { ...failure, message: unwaitedDialogMessage({ ...parts, text: redact(text), command }), details: kept };
|
|
88
|
+
// The page wrote the dialog's sentence after the command's own message, for a test and without the text.
|
|
89
|
+
const written = ` ${unwaitedDialogSentence({ type, answered, popup: parts.popup })}`;
|
|
90
|
+
const own = failure.message.endsWith(written) ? failure.message.slice(0, -written.length) : failure.message;
|
|
91
|
+
return { ...failure, message: `${own} ${unwaitedDialogSentence({ ...parts, text: redact(text) })}`, details: kept };
|
|
92
|
+
}
|
|
93
|
+
function says(text) {
|
|
94
|
+
return text === undefined || text === '' ? '' : ` that says ${quoteText(text)}`;
|
|
95
|
+
}
|
|
96
|
+
function capitalize(text) {
|
|
97
|
+
return `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
|
|
98
|
+
}
|
|
99
|
+
function article(word) {
|
|
100
|
+
return /^[aeiou]/.test(word) ? 'an' : 'a';
|
|
101
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Failure } from './failures.ts';
|
|
2
|
+
import type { LocatorRecipe } from './locator.ts';
|
|
3
|
+
import { type Schema } from './schema.ts';
|
|
4
|
+
/** How many positions a drag moves the mouse through on its way to the target when the test gives no `steps`. */
|
|
5
|
+
export declare const defaultDragSteps = 5;
|
|
6
|
+
/** The most positions a test may ask a drag to move through. Each one waits for a frame of the page. */
|
|
7
|
+
export declare const maxDragSteps = 100;
|
|
8
|
+
/**
|
|
9
|
+
* How a drag reached the page: through mouse events alone, or, once the press and the first moves began an HTML drag
|
|
10
|
+
* (`draggable`, `dragstart`), through the browser's drag events, which carry the drag's `dataTransfer` to the drop.
|
|
11
|
+
*/
|
|
12
|
+
export type DragThrough = 'mouse' | 'drag-events';
|
|
13
|
+
export declare const dragThroughSchema: Schema<DragThrough>;
|
|
14
|
+
/** A drag as commands and events carry it: the element it drops on, and the positions the test asked for, when it did. */
|
|
15
|
+
type DragCall = {
|
|
16
|
+
readonly target: LocatorRecipe;
|
|
17
|
+
readonly steps?: number | undefined;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A `dragTo` as its action's event records it: the element it drops on, the positions the test asked for when it did,
|
|
21
|
+
* and, once it dropped, how it reached the page.
|
|
22
|
+
*/
|
|
23
|
+
export type DragRecord = {
|
|
24
|
+
target: LocatorRecipe;
|
|
25
|
+
steps?: number;
|
|
26
|
+
through?: DragThrough;
|
|
27
|
+
};
|
|
28
|
+
export declare const dragRecordSchema: Schema<DragRecord>;
|
|
29
|
+
/**
|
|
30
|
+
* What the test process and the parent both refuse, as `usage`, in a drag: `steps` that is not a whole number from 1
|
|
31
|
+
* to `maxDragSteps`.
|
|
32
|
+
*
|
|
33
|
+
* @example dragProblem({ steps: 0 })?.message // 'dragTo() takes steps as a whole number from 1 to 100, received 0.'
|
|
34
|
+
*/
|
|
35
|
+
export declare function dragProblem({ steps }: {
|
|
36
|
+
readonly steps?: number | undefined;
|
|
37
|
+
}): Failure | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The arguments of a drag as a test writes them: the target's locator, and `steps` when the test gave it.
|
|
40
|
+
*
|
|
41
|
+
* @example describeDragArguments({ target: { by: 'testId', value: 'done' }, steps: 10 }) // "getByTestId('done'), { steps: 10 }"
|
|
42
|
+
*/
|
|
43
|
+
export declare function describeDragArguments({ target, steps }: DragCall): string;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag.d.ts","sourceRoot":"","sources":["../../src/protocol/drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,EAAK,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AAE5C,iHAAiH;AACjH,eAAO,MAAM,gBAAgB,IAAI,CAAA;AAEjC,wGAAwG;AACxG,eAAO,MAAM,YAAY,MAAM,CAAA;AAE/B;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,CAAA;AAEjD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,CAAoC,CAAA;AAEtF,0HAA0H;AAC1H,KAAK,QAAQ,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAEvF;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAEzF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAI9C,CAAA;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,GAAG,SAAS,CAGnG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,GAAG,MAAM,CAEzE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describeLocator, locatorRecipeSchema } from "./locator.js";
|
|
2
|
+
import { s } from "./schema.js";
|
|
3
|
+
/** How many positions a drag moves the mouse through on its way to the target when the test gives no `steps`. */
|
|
4
|
+
export const defaultDragSteps = 5;
|
|
5
|
+
/** The most positions a test may ask a drag to move through. Each one waits for a frame of the page. */
|
|
6
|
+
export const maxDragSteps = 100;
|
|
7
|
+
export const dragThroughSchema = s.enum(['mouse', 'drag-events']);
|
|
8
|
+
export const dragRecordSchema = s.object({
|
|
9
|
+
target: locatorRecipeSchema,
|
|
10
|
+
steps: s.optional(s.number({ integer: true, min: 1 })),
|
|
11
|
+
through: s.optional(dragThroughSchema),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* What the test process and the parent both refuse, as `usage`, in a drag: `steps` that is not a whole number from 1
|
|
15
|
+
* to `maxDragSteps`.
|
|
16
|
+
*
|
|
17
|
+
* @example dragProblem({ steps: 0 })?.message // 'dragTo() takes steps as a whole number from 1 to 100, received 0.'
|
|
18
|
+
*/
|
|
19
|
+
export function dragProblem({ steps }) {
|
|
20
|
+
if (steps === undefined || (Number.isInteger(steps) && steps >= 1 && steps <= maxDragSteps))
|
|
21
|
+
return undefined;
|
|
22
|
+
return { class: 'usage', message: `dragTo() takes steps as a whole number from 1 to ${maxDragSteps}, received ${String(steps)}.`, details: { inputSent: false } };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The arguments of a drag as a test writes them: the target's locator, and `steps` when the test gave it.
|
|
26
|
+
*
|
|
27
|
+
* @example describeDragArguments({ target: { by: 'testId', value: 'done' }, steps: 10 }) // "getByTestId('done'), { steps: 10 }"
|
|
28
|
+
*/
|
|
29
|
+
export function describeDragArguments({ target, steps }) {
|
|
30
|
+
return `${describeLocator(target)}${steps === undefined ? '' : `, { steps: ${steps} }`}`;
|
|
31
|
+
}
|
|
@@ -2,19 +2,25 @@ import type { CaptureReference } from './evidence.ts';
|
|
|
2
2
|
import type { NativeExecutionRecord } from './execution.ts';
|
|
3
3
|
import { type ActionKind } from './commands.ts';
|
|
4
4
|
import { type DiagnosticLimits, type DiagnosticScope, type DiagnosticsPolicyRecord, type DiagnosticsSummary } from './diagnostics.ts';
|
|
5
|
+
import { type DialogType } from './dialogs.ts';
|
|
6
|
+
import { type DragRecord } from './drag.ts';
|
|
5
7
|
import { type Emulation } from './emulation.ts';
|
|
6
8
|
import { type EvaluationRecord, type HostEvaluationRecord } from './evaluation.ts';
|
|
7
9
|
import { type BundleRecord, type CleanupRecord, type Ending, type ExecutionRecord, type PreparationRecord, type RequirementCheck } from './execution.ts';
|
|
8
10
|
import { type Failure, type SourceLocation, type TruncatedText } from './failures.ts';
|
|
11
|
+
import { type FileRecord } from './files.ts';
|
|
9
12
|
import { type HostCheckActual, type HostCheckRecord } from './host-check.ts';
|
|
10
13
|
import { type CaptureSourceName } from './identity.ts';
|
|
14
|
+
import { type LayoutRecord } from './layout-checks.ts';
|
|
11
15
|
import { type CheckRecord } from './locator-checks.ts';
|
|
12
16
|
import { type LocatorRecipe } from './locator.ts';
|
|
13
17
|
import { type ObservedRecord } from './observation-record.ts';
|
|
14
18
|
import { type OptionChoiceRecord } from './option-choices.ts';
|
|
15
19
|
import { type NavigationCause, type NavigationDocument } from './page-facts.ts';
|
|
16
20
|
import { type EvidenceStatus, type LeftoverRecord, type MediaStartedRecord, type RecordingRecord, type RunEvidenceStatus } from './recording.ts';
|
|
21
|
+
import { type RouteAnswerSummary } from './routes.ts';
|
|
17
22
|
import { type Schema } from './schema.ts';
|
|
23
|
+
import { type Attachment, type ScreenshotRecord } from './screenshot.ts';
|
|
18
24
|
import { type Timeouts } from './timeouts.ts';
|
|
19
25
|
import { type Variant } from './variant.ts';
|
|
20
26
|
/**
|
|
@@ -152,9 +158,14 @@ type ActionFields = StepScope & {
|
|
|
152
158
|
pageTitle?: string;
|
|
153
159
|
durationMs: number;
|
|
154
160
|
location?: SourceLocation;
|
|
155
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* The length of the text a `fill` typed. A secret fill names its secret instead, and a fill of an inbox's code names
|
|
163
|
+
* `code`; a `goto` to an inbox's link names the link, `link` or `link:2`, as it prints.
|
|
164
|
+
*/
|
|
156
165
|
valueLength?: number;
|
|
157
166
|
secret?: string;
|
|
167
|
+
/** The inbox a `fill` took its code from, or a `goto` its link. */
|
|
168
|
+
inbox?: string;
|
|
158
169
|
/** The key a `press` sent, as the test wrote it. */
|
|
159
170
|
key?: string;
|
|
160
171
|
/** The options a `select` chose, as the test named them. */
|
|
@@ -180,6 +191,15 @@ type ActionFields = StepScope & {
|
|
|
180
191
|
operation?: 'wait' | 'dismiss' | 'dismissFirstRunCard' | 'accept';
|
|
181
192
|
/** The label of the button a native alert call pressed, as the test wrote it. */
|
|
182
193
|
button?: string;
|
|
194
|
+
/** The files a `setInputFiles` or a file picker's `setFiles` gave the input, as its `change` carried them. */
|
|
195
|
+
files?: FileRecord[];
|
|
196
|
+
/**
|
|
197
|
+
* A `dragTo`'s target, the positions the test asked for when it did, and, once it dropped, whether it reached the page
|
|
198
|
+
* through mouse events alone or through the browser's drag events.
|
|
199
|
+
*/
|
|
200
|
+
drag?: DragRecord;
|
|
201
|
+
/** What the input held once the page's own listeners ran, when that differs from `files`, as when a page clears it. */
|
|
202
|
+
kept?: FileRecord[];
|
|
183
203
|
/**
|
|
184
204
|
* For a call that gave itself `{ timeout }`: in `callTimeoutMs` what it asked for, and in `timeoutMs` the time the
|
|
185
205
|
* parent gave the command, the smallest of that, the action or navigation budget and the test's time left. Both
|
|
@@ -220,6 +240,18 @@ type AssertionFields = TestScope & {
|
|
|
220
240
|
* names no look, the session of the app it judged it on. A value assertion has none.
|
|
221
241
|
*/
|
|
222
242
|
sessionId?: string;
|
|
243
|
+
/**
|
|
244
|
+
* What the look a layout assertion rested on measured, as the parent judged it, with the viewport's size. Absent on
|
|
245
|
+
* every other assertion.
|
|
246
|
+
*/
|
|
247
|
+
layout?: LayoutRecord;
|
|
248
|
+
/**
|
|
249
|
+
* What the picture a screenshot assertion rested on showed against its baseline, as the parent judged it. Absent on
|
|
250
|
+
* every other assertion.
|
|
251
|
+
*/
|
|
252
|
+
screenshot?: ScreenshotRecord;
|
|
253
|
+
/** Files the parent left in the run folder for the assertion, such as a failed screenshot comparison's pictures. */
|
|
254
|
+
attachments?: Attachment[];
|
|
223
255
|
/** From `expect.soft`: the test went on after it failed. */
|
|
224
256
|
soft?: true;
|
|
225
257
|
};
|
|
@@ -749,6 +781,126 @@ export type EventBody = (Common & VariantScope & (StepEvent | AssertionEvent)) |
|
|
|
749
781
|
| (StepScope & {
|
|
750
782
|
type: 'evaluation.finished';
|
|
751
783
|
evaluation: EvaluationRecord;
|
|
784
|
+
})
|
|
785
|
+
/**
|
|
786
|
+
* A screenshot's baseline a run with `--update-screenshots` wrote, from the picture an assertion settled on. Always
|
|
787
|
+
* the parent's. `path` is the baseline's, POSIX and relative to the project's root; `replaced` says a baseline was
|
|
788
|
+
* there before. `observationId` names the look whose picture it is, and `session` the app whose page it shows.
|
|
789
|
+
*/
|
|
790
|
+
| (StepScope & {
|
|
791
|
+
type: 'baseline.written';
|
|
792
|
+
sessionId: string;
|
|
793
|
+
observationId: string;
|
|
794
|
+
name: string;
|
|
795
|
+
path: string;
|
|
796
|
+
width: number;
|
|
797
|
+
height: number;
|
|
798
|
+
scale?: number;
|
|
799
|
+
replaced: boolean;
|
|
800
|
+
location?: SourceLocation;
|
|
801
|
+
})
|
|
802
|
+
/**
|
|
803
|
+
* A test's read of an inbox, once it ended. Always the parent's. `messages` is how many the mailbox held on the last
|
|
804
|
+
* look, `looks` how many times Retest asked it, none for a read refused before it asked, and `waitedMs` how long the
|
|
805
|
+
* read took. `wanted` is the subject the
|
|
806
|
+
* test asked for, a `RegExp` written `/source/flags`. A read that found a message records its `subject`, when it
|
|
807
|
+
* arrived and how many codes and links it holds, each code and each link that carries a token in the subject
|
|
808
|
+
* replaced by its placeholder; a read that found none records why in `failure`.
|
|
809
|
+
*/
|
|
810
|
+
| (StepScope & {
|
|
811
|
+
type: 'inbox.read';
|
|
812
|
+
inbox: string;
|
|
813
|
+
messages: number;
|
|
814
|
+
looks: number;
|
|
815
|
+
waitedMs: number;
|
|
816
|
+
wanted?: string;
|
|
817
|
+
subject?: string;
|
|
818
|
+
receivedAt?: string;
|
|
819
|
+
codes?: number;
|
|
820
|
+
links?: number;
|
|
821
|
+
location?: SourceLocation;
|
|
822
|
+
failure?: Failure;
|
|
823
|
+
})
|
|
824
|
+
/**
|
|
825
|
+
* A JavaScript dialog an app's page opened, once it closed. Always the parent's. `dialog` is its kind and `message`
|
|
826
|
+
* its text, with every value the run hides replaced, cut to 300 code units. `answer` says whether it was accepted or
|
|
827
|
+
* dismissed, and `by` who answered it: the test, through `dialog.accept()` or `dialog.dismiss()`, or Retest, which
|
|
828
|
+
* answers a dialog nothing waited for and one the test left open when it ended. `typed` is how many characters a
|
|
829
|
+
* prompt was given. `location` names the call that answered it.
|
|
830
|
+
*/
|
|
831
|
+
| (StepScope & {
|
|
832
|
+
type: 'dialog';
|
|
833
|
+
sessionId: string;
|
|
834
|
+
dialog: DialogType;
|
|
835
|
+
message: string;
|
|
836
|
+
answer: 'accepted' | 'dismissed';
|
|
837
|
+
by: 'test' | 'retest';
|
|
838
|
+
typed?: number;
|
|
839
|
+
location?: SourceLocation;
|
|
840
|
+
})
|
|
841
|
+
/**
|
|
842
|
+
* A page an app's page opened, once a `page.popup()` was given it. Always the parent's. `session` and `sessionId` name
|
|
843
|
+
* the page that opened it; `popup` is the app name its own commands and events go by, and `popupSessionId` its
|
|
844
|
+
* session. `url` is the first address it opened, its origin and path, and `title` that page's title. `location`
|
|
845
|
+
* names the `page.popup()` call.
|
|
846
|
+
*/
|
|
847
|
+
| (StepScope & {
|
|
848
|
+
type: 'popup.opened';
|
|
849
|
+
sessionId: string;
|
|
850
|
+
popup: string;
|
|
851
|
+
popupSessionId: string;
|
|
852
|
+
url: string;
|
|
853
|
+
title?: string;
|
|
854
|
+
location?: SourceLocation;
|
|
855
|
+
})
|
|
856
|
+
/** A page a test was given by `page.popup()` that closed while the test ran, without the test closing it. `session` names it. */
|
|
857
|
+
| (StepScope & {
|
|
858
|
+
type: 'popup.closed';
|
|
859
|
+
sessionId: string;
|
|
860
|
+
})
|
|
861
|
+
/**
|
|
862
|
+
* A download its app's browser context made, once it ended or its test did. Always the parent's. `suggestedFilename`
|
|
863
|
+
* is the name the browser suggested and `url` the address it came from, its origin and path, each with every secret
|
|
864
|
+
* replaced. `startedIn` says where it began when that was not the app's page or a frame inside it: `popup`, a page
|
|
865
|
+
* it opened, or `other`, another page of its context. A `completed` download names its file in the run folder in
|
|
866
|
+
* `path`, with its size in bytes in `size`; a `withheld` one held the value of a secret, so its file was removed,
|
|
867
|
+
* and `failure` says so; a `canceled` one says how many bytes arrived of how many, and why in `failure`; an
|
|
868
|
+
* `unfinished` one was still on its way when its test ended. `awaited` marks one a `page.download()` waited for,
|
|
869
|
+
* and `location` names that call.
|
|
870
|
+
*/
|
|
871
|
+
| (StepScope & {
|
|
872
|
+
type: 'download';
|
|
873
|
+
sessionId: string;
|
|
874
|
+
suggestedFilename: string;
|
|
875
|
+
url: string;
|
|
876
|
+
startedIn?: 'popup' | 'other';
|
|
877
|
+
state: 'completed' | 'withheld' | 'canceled' | 'unfinished';
|
|
878
|
+
path?: string;
|
|
879
|
+
size?: number;
|
|
880
|
+
receivedBytes?: number;
|
|
881
|
+
totalBytes?: number;
|
|
882
|
+
awaited?: true;
|
|
883
|
+
location?: SourceLocation;
|
|
884
|
+
failure?: Failure;
|
|
885
|
+
})
|
|
886
|
+
/**
|
|
887
|
+
* A change to an app's routes, once its page held it or refused it, or an answer of a route that Chrome refused.
|
|
888
|
+
* Always the parent's. `operation` is `add`, `remove` or `answer`, and `pattern` the route's pattern as the test
|
|
889
|
+
* wrote it, with every secret replaced, then cut to the message limit. An added route records its `answer`: its
|
|
890
|
+
* status, content type, header names and body size, or the error it refuses requests with. A removal records how
|
|
891
|
+
* many routes went in `removed`. An `answer` names the request in `url`, its origin and path, which Retest failed
|
|
892
|
+
* in its place. `failure` says why nothing changed or what Chrome refused, and `location` names the call.
|
|
893
|
+
*/
|
|
894
|
+
| (StepScope & {
|
|
895
|
+
type: 'route';
|
|
896
|
+
sessionId: string;
|
|
897
|
+
operation: 'add' | 'remove' | 'answer';
|
|
898
|
+
pattern: string;
|
|
899
|
+
url?: string;
|
|
900
|
+
answer?: RouteAnswerSummary;
|
|
901
|
+
removed?: number;
|
|
902
|
+
location?: SourceLocation;
|
|
903
|
+
failure?: Failure;
|
|
752
904
|
}) | (AttemptScope & {
|
|
753
905
|
type: 'test.finished';
|
|
754
906
|
status: TestStatus;
|