@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
|
@@ -33,7 +33,7 @@ export declare function textRecipe(by: 'label' | 'text' | 'placeholder', text: u
|
|
|
33
33
|
export declare function cssRecipe(selector: unknown): BuiltRecipe;
|
|
34
34
|
/**
|
|
35
35
|
* A recipe scoped inside another: the outer recipe's steps, then the inner one's, which finds elements inside those
|
|
36
|
-
* the outer one keeps.
|
|
36
|
+
* the outer one keeps, in the frame the outer one is in.
|
|
37
37
|
*
|
|
38
38
|
* @example scopedRecipe({ by: 'testId', value: 'tasks' }, { by: 'role', role: 'listitem' }) // { by: 'role', role: 'listitem', within: [{ by: 'testId', value: 'tasks' }] }
|
|
39
39
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locator-recipes.d.ts","sourceRoot":"","sources":["../../src/api/locator-recipes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,aAAa,EAAa,MAAM,wBAAwB,CAAA;AAOnF,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAM3F;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG,WAAW,CAGrD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CASvE;AAED;;;;;GAKG;AACH,wBAAg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O,GAAG,WAAW,CAK3H"}
|
|
@@ -65,13 +65,14 @@ export function cssRecipe(selector) {
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* A recipe scoped inside another: the outer recipe's steps, then the inner one's, which finds elements inside those
|
|
68
|
-
* the outer one keeps.
|
|
68
|
+
* the outer one keeps, in the frame the outer one is in.
|
|
69
69
|
*
|
|
70
70
|
* @example scopedRecipe({ by: 'testId', value: 'tasks' }, { by: 'role', role: 'listitem' }) // { by: 'role', role: 'listitem', within: [{ by: 'testId', value: 'tasks' }] }
|
|
71
71
|
*/
|
|
72
72
|
export function scopedRecipe(outer, inner) {
|
|
73
|
-
const { within: _innerScope, dialect: _innerDialect, ...step } = inner;
|
|
74
|
-
|
|
73
|
+
const { within: _innerScope, dialect: _innerDialect, frame: _innerFrame, ...step } = inner;
|
|
74
|
+
const dialect = outer.dialect === undefined ? {} : { dialect: outer.dialect };
|
|
75
|
+
return { ...step, within: locatorSteps(outer), ...dialect, ...(outer.frame === undefined ? {} : { frame: outer.frame }) };
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
78
|
* The recipe `first()`, `last()` or `nth(index)` makes: the same steps, keeping one match of the last. A locator
|
package/dist/api/page.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { RetestTypeError, TestIdValue } from '../config/register.ts';
|
|
2
2
|
import type { NativePlatform } from '../config/types.ts';
|
|
3
3
|
import type { AriaRole } from '../protocol/aria-role.ts';
|
|
4
|
+
import type { DialogType } from '../protocol/dialogs.ts';
|
|
5
|
+
import type { AbortReason } from '../protocol/routes.ts';
|
|
4
6
|
import type { CallOptions } from './call-options.ts';
|
|
7
|
+
import type { DragOptions } from './drag.ts';
|
|
8
|
+
import type { InboxLink } from './inbox.ts';
|
|
5
9
|
import type { KeyArgument } from './key-argument.ts';
|
|
6
10
|
import type { Secret } from './secret.ts';
|
|
7
11
|
/**
|
|
@@ -67,11 +71,12 @@ export interface Finders<Touch extends boolean = boolean> {
|
|
|
67
71
|
*/
|
|
68
72
|
export interface Page<Touch extends boolean = boolean> extends Finders<Touch> {
|
|
69
73
|
/**
|
|
70
|
-
* Opens a URL and waits for the page to load. A relative URL resolves against the app's base URL.
|
|
74
|
+
* Opens a URL and waits for the page to load. A relative URL resolves against the app's base URL. A link from an
|
|
75
|
+
* inbox's message is opened by the process that runs Retest, which never hands its address to the test.
|
|
71
76
|
*
|
|
72
77
|
* @example await page.goto('/')
|
|
73
78
|
*/
|
|
74
|
-
goto(url: string, options?: CallOptions): Promise<void>;
|
|
79
|
+
goto(url: string | InboxLink, options?: CallOptions): Promise<void>;
|
|
75
80
|
/**
|
|
76
81
|
* Reloads the page and waits for it to load.
|
|
77
82
|
*
|
|
@@ -105,6 +110,14 @@ export interface Page<Touch extends boolean = boolean> extends Finders<Touch> {
|
|
|
105
110
|
* @example const title = await page.title()
|
|
106
111
|
*/
|
|
107
112
|
title(): Promise<string>;
|
|
113
|
+
/**
|
|
114
|
+
* The frame shown by the `<iframe>` or `<frame>` element `locator` finds on this page, a frame of another site
|
|
115
|
+
* included. The element is found again for every use, so a frame that is removed and added again is found again. Its
|
|
116
|
+
* finders find elements inside the frame's document.
|
|
117
|
+
*
|
|
118
|
+
* @example const payment = page.frame(page.locator('iframe[title="Secure payment"]'))
|
|
119
|
+
*/
|
|
120
|
+
frame(locator: Locator<Touch>): Frame<Touch>;
|
|
108
121
|
/** The keyboard of this app's page. It presses keys on whatever holds the keyboard focus. */
|
|
109
122
|
readonly keyboard: Keyboard;
|
|
110
123
|
/**
|
|
@@ -114,13 +127,192 @@ export interface Page<Touch extends boolean = boolean> extends Finders<Touch> {
|
|
|
114
127
|
* @example await page.scroll({ y: 600 })
|
|
115
128
|
*/
|
|
116
129
|
scroll(delta: ScrollDelta, options?: CallOptions): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* Runs `action` and gives the JavaScript dialog it opens, as soon as it opens: an alert, a confirm, a prompt or a
|
|
132
|
+
* `beforeunload` confirmation. The page is armed before the action runs. A dialog holds the page, so the action is
|
|
133
|
+
* still waiting when this resolves, and finishes once the test answers the dialog: await this, then await
|
|
134
|
+
* `dialog.accept()` or `dialog.dismiss()`, which resolves once the action is over too. The wait lasts the action budget,
|
|
135
|
+
* or a shorter `{ timeout }`. A dialog nothing waited for fails the action that opened it, and Retest dismisses it.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* const dialog = await page.dialog(() => page.getByRole('button', { name: 'Delete' }).click())
|
|
139
|
+
* await dialog.accept()
|
|
140
|
+
*/
|
|
141
|
+
dialog(action: () => Promise<unknown>, options?: CallOptions): Promise<Dialog>;
|
|
142
|
+
/**
|
|
143
|
+
* Runs `action` and gives the page it opens, by `window.open`, a link with a target or a form, as a page of its own:
|
|
144
|
+
* its commands, checks and failure screenshot are its own, and it closes when the test ends. The page is armed before
|
|
145
|
+
* the action runs, and this resolves once the new page has opened its first document and the action is over. The wait
|
|
146
|
+
* lasts the action budget, or a shorter `{ timeout }`. A page opened while nothing waited runs on unwatched.
|
|
147
|
+
*
|
|
148
|
+
* @example const terms = await page.popup(() => page.getByRole('link', { name: 'Terms' }).click())
|
|
149
|
+
*/
|
|
150
|
+
popup(action: () => Promise<unknown>, options?: CallOptions): Promise<Page<Touch>>;
|
|
151
|
+
/**
|
|
152
|
+
* Closes a page the app opened, which `page.popup()` gave, and waits for it to go. Its `beforeunload` handlers run
|
|
153
|
+
* first; answer their dialog with `page.dialog()`. The test's own pages close when the test ends.
|
|
154
|
+
*
|
|
155
|
+
* @example await terms.close()
|
|
156
|
+
*/
|
|
157
|
+
close(options?: CallOptions): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Runs `action` and gives the file picker it opens, which is never shown, so its input can be given files. The wait
|
|
160
|
+
* for the picker starts before the action, and lasts the action budget or a shorter `{ timeout }`. A picker the test
|
|
161
|
+
* did not wait for fails the action that opened it.
|
|
162
|
+
*
|
|
163
|
+
* @example const chooser = await page.fileChooser(() => page.getByRole('button', { name: 'Upload' }).click())
|
|
164
|
+
*/
|
|
165
|
+
fileChooser(action: () => Promise<unknown>, options?: CallOptions): Promise<FileChooser>;
|
|
166
|
+
/**
|
|
167
|
+
* Runs `action` and gives the download it starts. The wait for it starts before the action, and lasts the action
|
|
168
|
+
* budget or a shorter `{ timeout }`. The run folder keeps every download a page makes, under the name the page
|
|
169
|
+
* suggested, whether or not a test waits for it.
|
|
170
|
+
*
|
|
171
|
+
* @example const download = await page.download(() => page.getByRole('link', { name: 'Export CSV' }).click())
|
|
172
|
+
*/
|
|
173
|
+
download(action: () => Promise<unknown>, options?: CallOptions): Promise<Download>;
|
|
174
|
+
/**
|
|
175
|
+
* Answers every request of the page whose whole address `pattern` matches with `answer`, in the network's place, from
|
|
176
|
+
* now on: a response, or a refusal. A later route answers before an earlier one. It resolves once the page holds the
|
|
177
|
+
* route, so the next `goto` meets it. A popup shares the routes of the page that opened it.
|
|
178
|
+
*
|
|
179
|
+
* @example await page.route('http://127.0.0.1:4173/api/tasks', { contentType: 'application/json', body: JSON.stringify([{ title: 'Stubbed' }]) })
|
|
180
|
+
*/
|
|
181
|
+
route(pattern: RoutePattern, answer: RouteAnswer): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Removes every route added with `pattern`, written as it was added. A pattern that matches no route fails.
|
|
184
|
+
*
|
|
185
|
+
* @example await page.unroute(/\/api\/tasks$/)
|
|
186
|
+
*/
|
|
187
|
+
unroute(pattern: RoutePattern): Promise<void>;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A frame of an app's page: the document an `<iframe>` or `<frame>` element shows, found again by that element's
|
|
191
|
+
* locator for every use. Its finders find elements inside that document, through its open shadow roots, and `frame()`
|
|
192
|
+
* a frame inside it. It has no address of its own to go to: `goto`, `toHaveURL` and `toHaveTitle` are the page's.
|
|
193
|
+
*/
|
|
194
|
+
export interface Frame<Touch extends boolean = boolean> extends Finders<Touch> {
|
|
195
|
+
/**
|
|
196
|
+
* The frame shown by the `<iframe>` or `<frame>` element `locator` finds in this frame's document.
|
|
197
|
+
*
|
|
198
|
+
* @example const notes = order.frame(order.locator('iframe'))
|
|
199
|
+
*/
|
|
200
|
+
frame(locator: Locator<Touch>): Frame<Touch>;
|
|
117
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* A JavaScript dialog an action opened: an alert, a confirm, a prompt or a `beforeunload` confirmation. It holds the page
|
|
204
|
+
* until the test answers it, and the action that opened it finishes only then, so `accept()` and `dismiss()` each
|
|
205
|
+
* resolve once the dialog is answered and that action is over. Answer each dialog once.
|
|
206
|
+
*/
|
|
207
|
+
export interface Dialog {
|
|
208
|
+
/** The kind of dialog the page opened. */
|
|
209
|
+
readonly type: DialogType;
|
|
210
|
+
/** The text the page showed, with every value the run hides replaced. A `beforeunload` dialog's is empty. */
|
|
211
|
+
readonly message: string;
|
|
212
|
+
/** A prompt's default answer, and empty for any other dialog. */
|
|
213
|
+
readonly defaultValue: string;
|
|
214
|
+
/**
|
|
215
|
+
* Accepts the dialog, as its OK button does. A prompt takes the text to answer with, and without it answers with its
|
|
216
|
+
* default. A `beforeunload` dialog accepted lets the page leave.
|
|
217
|
+
*
|
|
218
|
+
* @example await dialog.accept('Ada')
|
|
219
|
+
*/
|
|
220
|
+
accept(promptText?: string): Promise<void>;
|
|
221
|
+
/**
|
|
222
|
+
* Dismisses the dialog, as its Cancel button does. A prompt dismissed answers `null`; a `beforeunload` dialog
|
|
223
|
+
* dismissed keeps the page where it is, so the navigation that asked fails.
|
|
224
|
+
*
|
|
225
|
+
* @example await dialog.dismiss()
|
|
226
|
+
*/
|
|
227
|
+
dismiss(): Promise<void>;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A file picker a `page.fileChooser()` caught: the operating system's picker was never shown, and the page waits for
|
|
231
|
+
* the files its input is given here.
|
|
232
|
+
*/
|
|
233
|
+
export interface FileChooser {
|
|
234
|
+
/** Whether the picker's input takes several files, as its `multiple` attribute says. */
|
|
235
|
+
readonly multiple: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Gives the picker's input the files, as a person choosing them would, so the page hears its `input` and `change`
|
|
238
|
+
* events. A path is read against the folder of the file that makes the call.
|
|
239
|
+
*
|
|
240
|
+
* @example await chooser.setFiles('./fixtures/report.pdf')
|
|
241
|
+
*/
|
|
242
|
+
setFiles(files: InputFiles, options?: CallOptions): Promise<void>;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* A download a `page.download()` caught. The process that runs Retest saves it in the run folder, under the name the
|
|
246
|
+
* page suggested, whether or not the test asks for it.
|
|
247
|
+
*/
|
|
248
|
+
export interface Download {
|
|
249
|
+
/** The name the browser suggested for the file, from the page's `download` attribute or the server's answer. */
|
|
250
|
+
readonly suggestedFilename: string;
|
|
251
|
+
/**
|
|
252
|
+
* Waits for the download to be saved, within the navigation budget or a shorter `{ timeout }`, and gives the absolute
|
|
253
|
+
* path of its file in the run folder. A download the browser stopped fails, saying how much of it arrived.
|
|
254
|
+
*
|
|
255
|
+
* @example const csv = await readFile(await download.path(), 'utf8')
|
|
256
|
+
*/
|
|
257
|
+
path(options?: CallOptions): Promise<string>;
|
|
258
|
+
/**
|
|
259
|
+
* Waits for the download to be saved, as `path()` does, then copies its file to `path`, read against the folder of the
|
|
260
|
+
* file that makes the call, making the folders it needs. The run folder keeps its own copy.
|
|
261
|
+
*
|
|
262
|
+
* @example await download.saveAs('./out/tasks.csv')
|
|
263
|
+
*/
|
|
264
|
+
saveAs(path: string, options?: CallOptions): Promise<void>;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* A file given by its content rather than a path: the name the page reads, its bytes or its text, which is written as
|
|
268
|
+
* UTF-8, and, when given, the type the page must read for it. The browser types a file by the end of its name, so a
|
|
269
|
+
* `mimeType` it does not give the file fails the call.
|
|
270
|
+
*/
|
|
271
|
+
export type FilePayload = {
|
|
272
|
+
readonly name: string;
|
|
273
|
+
readonly mimeType?: string | undefined;
|
|
274
|
+
readonly content: string | Uint8Array;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* The files an input takes: a path, read against the folder of the file that makes the call, as an import is; a file by
|
|
278
|
+
* its content; or a list of them. An empty list clears the input.
|
|
279
|
+
*/
|
|
280
|
+
export type InputFiles = string | FilePayload | readonly (string | FilePayload)[];
|
|
281
|
+
/**
|
|
282
|
+
* Which requests a route answers: a glob of the whole address, query included, where `**` matches any run of characters
|
|
283
|
+
* and `*` any run without a `/`; or a `RegExp` searched for in the address.
|
|
284
|
+
*/
|
|
285
|
+
export type RoutePattern = string | RegExp;
|
|
286
|
+
/**
|
|
287
|
+
* A response a route gives in the network's place: `status`, 200 unless given, `headers`, `contentType`, which sets the
|
|
288
|
+
* `Content-Type` header, and `body`, text written as UTF-8, or bytes.
|
|
289
|
+
*/
|
|
290
|
+
export type RouteFulfil = {
|
|
291
|
+
readonly status?: number | undefined;
|
|
292
|
+
readonly headers?: Readonly<Record<string, string>> | undefined;
|
|
293
|
+
readonly contentType?: string | undefined;
|
|
294
|
+
readonly body?: string | Uint8Array | undefined;
|
|
295
|
+
readonly abort?: never;
|
|
296
|
+
};
|
|
297
|
+
/** A refusal: the request fails as Chrome's network error `abort` names, such as `'connectionrefused'`. */
|
|
298
|
+
export type RouteAbort = {
|
|
299
|
+
readonly abort: AbortReason;
|
|
300
|
+
readonly status?: never;
|
|
301
|
+
readonly headers?: never;
|
|
302
|
+
readonly contentType?: never;
|
|
303
|
+
readonly body?: never;
|
|
304
|
+
};
|
|
305
|
+
/** What a route answers each request it matches with: a response, or a refusal. Never both. */
|
|
306
|
+
export type RouteAnswer = RouteFulfil | RouteAbort;
|
|
118
307
|
/**
|
|
119
308
|
* An Electron app's page in a test: the first window the app opens. It finds, acts and checks as a web page does, and
|
|
120
309
|
* reloads and moves through its history, but it has no address to go to.
|
|
121
310
|
*/
|
|
122
|
-
export type ElectronPage = Omit<Page<false>, 'goto'> & {
|
|
311
|
+
export type ElectronPage = Omit<Page<false>, 'goto' | 'popup' | 'route' | 'unroute'> & {
|
|
123
312
|
readonly goto: RetestTypeError<'An Electron app has no address. Its page is the first window the app opens.'>;
|
|
313
|
+
readonly popup: RetestTypeError<"A test reaches only an Electron app's first window. popup() is for a browser's page.">;
|
|
314
|
+
readonly route: RetestTypeError<"Retest does not answer an Electron app's requests yet. route() is for a browser's page.">;
|
|
315
|
+
readonly unroute: RetestTypeError<"Retest does not answer an Electron app's requests yet. unroute() is for a browser's page.">;
|
|
124
316
|
};
|
|
125
317
|
/** An app's keyboard. Await each press, because an app takes one command at a time. */
|
|
126
318
|
export interface Keyboard {
|
|
@@ -158,7 +350,8 @@ export interface Locator<Touch extends boolean = boolean> extends Finders<Touch>
|
|
|
158
350
|
*/
|
|
159
351
|
nth(index: number): Locator<Touch>;
|
|
160
352
|
/**
|
|
161
|
-
* Replaces the field's value by typing, as a person would. A secret
|
|
353
|
+
* Replaces the field's value by typing, as a person would. A secret, or a code from an inbox's message, is typed by
|
|
354
|
+
* the process that runs Retest.
|
|
162
355
|
*
|
|
163
356
|
* @example await page.getByLabel('Password').fill(secret('password'))
|
|
164
357
|
*/
|
|
@@ -215,6 +408,23 @@ export interface Locator<Touch extends boolean = boolean> extends Finders<Touch>
|
|
|
215
408
|
* @example await page.getByTestId('terms').scroll({ y: 600 })
|
|
216
409
|
*/
|
|
217
410
|
scroll(delta: ScrollDelta, options?: CallOptions): Promise<void>;
|
|
411
|
+
/**
|
|
412
|
+
* Gives an `<input type="file">` the files, in place of those it held, as a person choosing them in the picker
|
|
413
|
+
* would: the page hears its `input` and `change` events. The input must be there and enabled, and need not be
|
|
414
|
+
* visible. A path is read against the folder of the file that makes the call; an empty list clears the input.
|
|
415
|
+
*
|
|
416
|
+
* @example await page.getByLabel('Attachment').setInputFiles('./fixtures/report.pdf')
|
|
417
|
+
*/
|
|
418
|
+
setInputFiles(files: InputFiles, options?: CallOptions): Promise<void>;
|
|
419
|
+
/**
|
|
420
|
+
* Drags the element onto the element `target` finds, once both are visible, stable and not covered, in view
|
|
421
|
+
* together: it presses the mouse at the element's centre, moves it through `steps` positions, 5 unless given, to the
|
|
422
|
+
* target's centre, and releases it there. When the page begins an HTML drag, the browser's drag events carry it to
|
|
423
|
+
* the target, so the page's `drop` handler reads its `dataTransfer`.
|
|
424
|
+
*
|
|
425
|
+
* @example await page.getByText('Write release notes').dragTo(page.getByTestId('done-column'))
|
|
426
|
+
*/
|
|
427
|
+
dragTo(target: Locator, options?: DragOptions): Promise<void>;
|
|
218
428
|
/**
|
|
219
429
|
* Taps the element's centre, on an app whose every target has a touch screen.
|
|
220
430
|
*
|
package/dist/api/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/api/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAAA;AAE/G,yHAAyH;AACzH,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAAA;AAElE;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO;IACtD;;;;OAIG;IACH,WAAW,CA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behind a page. */
|
|
3
|
+
type PageTarget = {
|
|
4
|
+
readonly run: TestRun;
|
|
5
|
+
readonly app: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Adds a route to the app's page: from now on every request of the page whose address `pattern` matches is answered
|
|
9
|
+
* with `answer`, before any route added earlier. Resolves once the page holds it.
|
|
10
|
+
*
|
|
11
|
+
* @example await route(page, 'http://127.0.0.1:4173/api/tasks', { status: 200, contentType: 'application/json', body: '[]' })
|
|
12
|
+
*/
|
|
13
|
+
export declare function route({ run, app }: PageTarget, pattern: unknown, answer: unknown): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Removes every route of the app's page added with `pattern`, written as it was. Resolves once the page holds the change.
|
|
16
|
+
*
|
|
17
|
+
* @example await unroute(page, 'http://127.0.0.1:4173/api/tasks')
|
|
18
|
+
*/
|
|
19
|
+
export declare function unroute({ run, app }: PageTarget, pattern: unknown): Promise<void>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/api/route.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAQ5C,sCAAsC;AACtC,KAAK,UAAU,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAIjE;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhG;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjF"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { textPatternOf } from "../protocol/locator.js";
|
|
2
|
+
import { abortReasons, describeRoutePattern, routeAnswerProblem, routePatternProblem } from "../protocol/routes.js";
|
|
3
|
+
import { isPlainObject } from "../protocol/schema.js";
|
|
4
|
+
import { listWords } from "../shared/list-words.js";
|
|
5
|
+
import { formatValue } from "./format-value.js";
|
|
6
|
+
import { misuse } from "./misuse.js";
|
|
7
|
+
const fulfilKeys = new Set(['status', 'headers', 'contentType', 'body']);
|
|
8
|
+
/**
|
|
9
|
+
* Adds a route to the app's page: from now on every request of the page whose address `pattern` matches is answered
|
|
10
|
+
* with `answer`, before any route added earlier. Resolves once the page holds it.
|
|
11
|
+
*
|
|
12
|
+
* @example await route(page, 'http://127.0.0.1:4173/api/tasks', { status: 200, contentType: 'application/json', body: '[]' })
|
|
13
|
+
*/
|
|
14
|
+
export function route({ run, app }, pattern, answer) {
|
|
15
|
+
const location = run.location();
|
|
16
|
+
const read = readPattern(pattern, 'route', run);
|
|
17
|
+
const record = readAnswer(answer, run);
|
|
18
|
+
return run.changeRoutes({ app, label: `page.route(${describeRoutePattern(read)})`, request: { kind: 'add', pattern: read, answer: record }, location });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Removes every route of the app's page added with `pattern`, written as it was. Resolves once the page holds the change.
|
|
22
|
+
*
|
|
23
|
+
* @example await unroute(page, 'http://127.0.0.1:4173/api/tasks')
|
|
24
|
+
*/
|
|
25
|
+
export function unroute({ run, app }, pattern) {
|
|
26
|
+
const location = run.location();
|
|
27
|
+
const read = readPattern(pattern, 'unroute', run);
|
|
28
|
+
return run.changeRoutes({ app, label: `page.unroute(${describeRoutePattern(read)})`, request: { kind: 'remove', pattern: read }, location });
|
|
29
|
+
}
|
|
30
|
+
function readPattern(pattern, method, run) {
|
|
31
|
+
const read = typeof pattern === 'string' ? pattern : pattern instanceof RegExp ? textPatternOf(pattern) : undefined;
|
|
32
|
+
if (read === undefined)
|
|
33
|
+
throw misuse(`page.${method}() takes a glob of the whole address, such as '**/api/tasks', or a RegExp, received ${formatValue(pattern)}.`, run);
|
|
34
|
+
const problem = routePatternProblem(read, method);
|
|
35
|
+
if (problem !== undefined)
|
|
36
|
+
throw misuse(problem, run);
|
|
37
|
+
return read;
|
|
38
|
+
}
|
|
39
|
+
// An answer is data, since no function crosses to the process that runs the browser: each part is read as the wire
|
|
40
|
+
// carries it, and a body of bytes goes as base64.
|
|
41
|
+
function readAnswer(answer, run) {
|
|
42
|
+
if (!isPlainObject(answer))
|
|
43
|
+
throw misuse(`page.route() takes an answer such as { status: 200, body: 'ok' } or { abort: 'connectionrefused' }, received ${formatValue(answer)}.`, run);
|
|
44
|
+
const given = Object.entries(answer).filter(([, value]) => value !== undefined);
|
|
45
|
+
const unknown = given.find(([key]) => key !== 'abort' && !fulfilKeys.has(key));
|
|
46
|
+
if (unknown !== undefined)
|
|
47
|
+
throw misuse(`page.route() has no answer option ${JSON.stringify(unknown[0])}. An answer takes status, headers, contentType and body, or abort.`, run);
|
|
48
|
+
const parts = Object.fromEntries(given);
|
|
49
|
+
if ('abort' in parts) {
|
|
50
|
+
if (given.length > 1)
|
|
51
|
+
throw misuse('page.route() takes an answer that gives a response or one that aborts the request, not both.', run);
|
|
52
|
+
const reason = abortReasons.find((each) => each === parts['abort']);
|
|
53
|
+
if (reason === undefined)
|
|
54
|
+
throw misuse(`page.route() takes abort as one of ${listWords(abortReasons.map((each) => `'${each}'`), 'or')}, received ${formatValue(parts['abort'])}.`, run);
|
|
55
|
+
return { abort: reason };
|
|
56
|
+
}
|
|
57
|
+
const record = { ...status(parts['status'], run), ...headers(parts['headers'], run), ...contentType(parts['contentType'], run), ...body(parts['body'], run) };
|
|
58
|
+
const problem = routeAnswerProblem(record);
|
|
59
|
+
if (problem !== undefined)
|
|
60
|
+
throw misuse(problem, run);
|
|
61
|
+
return record;
|
|
62
|
+
}
|
|
63
|
+
function status(value, run) {
|
|
64
|
+
if (value === undefined)
|
|
65
|
+
return {};
|
|
66
|
+
if (typeof value !== 'number')
|
|
67
|
+
throw misuse(`page.route() takes status as a number, such as 404, received ${formatValue(value)}.`, run);
|
|
68
|
+
return { status: value };
|
|
69
|
+
}
|
|
70
|
+
function headers(value, run) {
|
|
71
|
+
if (value === undefined)
|
|
72
|
+
return {};
|
|
73
|
+
const refused = () => misuse(`page.route() takes headers as names with text values, such as { 'x-total': '3' }, received ${formatValue(value)}.`, run);
|
|
74
|
+
if (!isPlainObject(value))
|
|
75
|
+
throw refused();
|
|
76
|
+
const read = {};
|
|
77
|
+
for (const [name, header] of Object.entries(value)) {
|
|
78
|
+
if (typeof header !== 'string')
|
|
79
|
+
throw refused();
|
|
80
|
+
read[name] = header;
|
|
81
|
+
}
|
|
82
|
+
return { headers: read };
|
|
83
|
+
}
|
|
84
|
+
function contentType(value, run) {
|
|
85
|
+
if (value === undefined)
|
|
86
|
+
return {};
|
|
87
|
+
if (typeof value !== 'string')
|
|
88
|
+
throw misuse(`page.route() takes contentType as text, such as 'application/json', received ${formatValue(value)}.`, run);
|
|
89
|
+
return { contentType: value };
|
|
90
|
+
}
|
|
91
|
+
function body(value, run) {
|
|
92
|
+
if (value === undefined)
|
|
93
|
+
return {};
|
|
94
|
+
if (typeof value === 'string')
|
|
95
|
+
return { body: value };
|
|
96
|
+
if (value instanceof Uint8Array)
|
|
97
|
+
return { base64: Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString('base64') };
|
|
98
|
+
throw misuse(`page.route() takes a body as text or bytes, received ${formatValue(value)}.`, run);
|
|
99
|
+
}
|
package/dist/api/test-run.d.ts
CHANGED
|
@@ -2,9 +2,16 @@ import type { ObserveAfter, CommandResult, PageCommand } from '../protocol/comma
|
|
|
2
2
|
import type { EvaluationAnswer, EvaluationCall } from '../protocol/evaluation.ts';
|
|
3
3
|
import type { ChildEvent } from '../protocol/events.ts';
|
|
4
4
|
import type { Failure, SourceLocation } from '../protocol/failures.ts';
|
|
5
|
+
import type { DialogAnswer, DialogRecord } from '../protocol/dialogs.ts';
|
|
6
|
+
import type { FilesAnswer, FilesRequest } from '../protocol/files.ts';
|
|
7
|
+
import type { RouteReply, RouteRequest } from '../protocol/routes.ts';
|
|
8
|
+
import type { InboxAnswer, InboxRequest, ReceivedMessageRecord } from '../protocol/inbox.ts';
|
|
9
|
+
import type { LayoutRequest } from '../protocol/layout-checks.ts';
|
|
5
10
|
import type { LocatorRecipe } from '../protocol/locator.ts';
|
|
6
11
|
import type { ChildMessage } from '../protocol/messages.ts';
|
|
12
|
+
import type { ScreenshotRequest } from '../protocol/screenshot.ts';
|
|
7
13
|
import type { Timeouts } from '../protocol/timeouts.ts';
|
|
14
|
+
import type { PopupAnswer, PopupRecord } from '../protocol/popups.ts';
|
|
8
15
|
import type { RunTime } from './run-time.ts';
|
|
9
16
|
import type { RunnableTest } from './test-body.ts';
|
|
10
17
|
import { RetestError } from './failure.ts';
|
|
@@ -27,6 +34,58 @@ export type TestRunOptions = {
|
|
|
27
34
|
/** The clock the test's budgets and durations count on, and the waits assertions poll with. The host's by default. */
|
|
28
35
|
time?: RunTime;
|
|
29
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* A read of an inbox as the test asked for it: the call as the test wrote it, what it asks for, where the test sent it
|
|
39
|
+
* from, and the time it gave itself with `{ timeout }`, when it gave one.
|
|
40
|
+
*/
|
|
41
|
+
export type InboxReading = {
|
|
42
|
+
readonly label: string;
|
|
43
|
+
readonly request: InboxRequest;
|
|
44
|
+
readonly location: SourceLocation | undefined;
|
|
45
|
+
readonly timeoutMs?: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A wait the parent makes about files, as the test asked for it: the call as the test wrote it, what it waits for, where
|
|
49
|
+
* the test sent it from, and its time in milliseconds, before the test's own time left cuts it.
|
|
50
|
+
*/
|
|
51
|
+
export type FilesWaiting = {
|
|
52
|
+
readonly label: string;
|
|
53
|
+
readonly request: FilesRequest;
|
|
54
|
+
readonly location: SourceLocation | undefined;
|
|
55
|
+
readonly timeoutMs: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* A wait for what an action opens on an app's page, as the test asked for it: the app, the call as the test wrote it,
|
|
59
|
+
* where the test sent it from, the time it gave itself with `{ timeout }`, when it gave one, and the action, which the
|
|
60
|
+
* wait runs once the page is armed.
|
|
61
|
+
*/
|
|
62
|
+
export type OpeningWait = {
|
|
63
|
+
readonly app: string;
|
|
64
|
+
readonly label: string;
|
|
65
|
+
readonly location: SourceLocation | undefined;
|
|
66
|
+
readonly timeoutMs?: number | undefined;
|
|
67
|
+
readonly action: () => Promise<unknown>;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* An answer to a dialog the test was given: the app whose page shows it, its id, whether to accept it and the text a
|
|
71
|
+
* prompt takes, the call as the test wrote it and where, and the action that opened it, which the answer waits for.
|
|
72
|
+
*/
|
|
73
|
+
export type DialogAnswering = {
|
|
74
|
+
readonly app: string;
|
|
75
|
+
readonly dialog: string;
|
|
76
|
+
readonly accept: boolean;
|
|
77
|
+
readonly promptText?: string | undefined;
|
|
78
|
+
readonly label: string;
|
|
79
|
+
readonly location: SourceLocation | undefined;
|
|
80
|
+
readonly acted: Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
/** A change to an app's routes, as the test asked for it: the app, the call as the test wrote it, and where it was sent from. */
|
|
83
|
+
export type RouteChange = {
|
|
84
|
+
readonly app: string;
|
|
85
|
+
readonly label: string;
|
|
86
|
+
readonly request: RouteRequest;
|
|
87
|
+
readonly location: SourceLocation | undefined;
|
|
88
|
+
};
|
|
30
89
|
/** How a test ended, as the child reports it. */
|
|
31
90
|
export type Verdict = {
|
|
32
91
|
status: 'passed' | 'failed';
|
|
@@ -35,7 +94,7 @@ export type Verdict = {
|
|
|
35
94
|
durationMs: number;
|
|
36
95
|
};
|
|
37
96
|
type ActionCommand = Exclude<PageCommand, {
|
|
38
|
-
kind: 'observe' | 'observePage';
|
|
97
|
+
kind: 'observe' | 'observePage' | 'observeLayout' | 'observeScreenshot';
|
|
39
98
|
}>;
|
|
40
99
|
/**
|
|
41
100
|
* One test running in the child. It runs the test's hooks and function, sends each app's commands one at a
|
|
@@ -78,6 +137,62 @@ export declare class TestRun {
|
|
|
78
137
|
* earlier test never reaches a later one.
|
|
79
138
|
*/
|
|
80
139
|
requestEvaluation(call: EvaluationCall, location: SourceLocation | undefined): Promise<EvaluationAnswer>;
|
|
140
|
+
/**
|
|
141
|
+
* Asks the parent to read an inbox. The parent reads the mailbox, looks again until a message arrives or the read's
|
|
142
|
+
* time runs out, and answers with the message, its codes and links hidden; `wrap` turns that answer into what the
|
|
143
|
+
* test receives. The read touches no page, so it holds no app, and it starts at once. Its time is its own `timeoutMs`,
|
|
144
|
+
* or the assertion budget, cut to what the test has left. It changes what the next read gives, so it may not run
|
|
145
|
+
* inside the function `expect.poll` calls.
|
|
146
|
+
*/
|
|
147
|
+
readInbox<T>({ label, request, location, timeoutMs }: InboxReading, wrap: (message: ReceivedMessageRecord) => T): Operation<T>;
|
|
148
|
+
resolveInbox(id: number, answer: InboxAnswer): void;
|
|
149
|
+
/**
|
|
150
|
+
* Asks the parent to arm an app's page for the next JavaScript dialog, runs the action once the page is armed, and
|
|
151
|
+
* resolves with what `wrap` makes of the dialog as soon as it opens. The action is still waiting then, since a page
|
|
152
|
+
* holds the input that opened a dialog until the dialog is answered; `wrap` is given the action's own promise, which
|
|
153
|
+
* settles once the action does. An action that fails before any dialog opened fails the wait with its own failure,
|
|
154
|
+
* and the parent stops waiting. A wait that sees no dialog in its time fails, unless its action failed meanwhile,
|
|
155
|
+
* whose failure it gives instead. The wait acts on a page, so it may not run inside the function `expect.poll` calls.
|
|
156
|
+
*/
|
|
157
|
+
waitForDialog<T>(wait: OpeningWait, wrap: (dialog: DialogRecord, acted: Promise<void>) => T): Operation<T>;
|
|
158
|
+
/**
|
|
159
|
+
* As `waitForDialog`, for the next page the action opens: the parent hands it over as an app of its own, and the wait
|
|
160
|
+
* resolves with what `wrap` makes of it once the action is over too, so the next command to the page that opened it
|
|
161
|
+
* never meets the action still running. An action that fails fails the wait with its own failure.
|
|
162
|
+
*/
|
|
163
|
+
waitForPopup<T>(wait: OpeningWait, wrap: (popup: PopupRecord) => T): Operation<T>;
|
|
164
|
+
/**
|
|
165
|
+
* Asks the parent to answer a dialog the test was given, then waits for the action that opened it, so the answer's
|
|
166
|
+
* step ends once its action has. An answer the parent could not give fails, and an action that failed fails it too,
|
|
167
|
+
* with its own failure. It acts on a page, so it may not run inside the function `expect.poll` calls.
|
|
168
|
+
*/
|
|
169
|
+
answerDialog({ app, dialog, accept, promptText, label, location, acted }: DialogAnswering): Operation<void>;
|
|
170
|
+
resolveDialog(id: number, answer: DialogAnswer): void;
|
|
171
|
+
resolvePopup(id: number, answer: PopupAnswer): void;
|
|
172
|
+
/**
|
|
173
|
+
* Asks the parent to wait for what `request` names, runs `action` meanwhile when one is given, and resolves with what
|
|
174
|
+
* `wrap` makes of the parent's answer once the action is over and the parent has answered. The wait holds no app, so
|
|
175
|
+
* the action's own commands go as they would without it; the request goes first, so the parent is waiting before
|
|
176
|
+
* the action's first command arrives. An action that fails fails the wait with its own failure, and the parent lets go
|
|
177
|
+
* of what it armed. A wait with an action acts on a page, so it may not run inside the function `expect.poll` calls.
|
|
178
|
+
*/
|
|
179
|
+
awaitFiles<T>({ label, request, location, timeoutMs }: FilesWaiting, wrap: (answer: Extract<FilesAnswer, {
|
|
180
|
+
ok: true;
|
|
181
|
+
}>) => T | Promise<T>, action?: () => unknown): Operation<T>;
|
|
182
|
+
resolveFiles(id: number, answer: FilesAnswer): void;
|
|
183
|
+
/**
|
|
184
|
+
* Asks the parent to change an app's routes, and resolves once the page holds the change, so the test's next command
|
|
185
|
+
* to the page meets it. It needs the app to itself, as an action does: a request already on its way when the routes
|
|
186
|
+
* change could meet either. Its time is the action budget, cut to what the test has left. It changes what the page's
|
|
187
|
+
* requests get, so it may not run inside the function `expect.poll` calls.
|
|
188
|
+
*/
|
|
189
|
+
changeRoutes({ app, label, request, location }: RouteChange): Operation<void>;
|
|
190
|
+
resolveRoute(id: number, answer: RouteReply): void;
|
|
191
|
+
/**
|
|
192
|
+
* The folder a path a test wrote is read against, as an import's is: that of the file the call came from, or the
|
|
193
|
+
* test's own file when the call's place is unknown.
|
|
194
|
+
*/
|
|
195
|
+
callerFolder(location: SourceLocation | undefined): string;
|
|
81
196
|
resolveEvaluation(id: number, answer: EvaluationAnswer): void;
|
|
82
197
|
emit(event: ChildEvent): void;
|
|
83
198
|
countAssertion(): void;
|
|
@@ -104,6 +219,17 @@ export declare class TestRun {
|
|
|
104
219
|
* change. The look is marked as a check's, as `observe` marks its own.
|
|
105
220
|
*/
|
|
106
221
|
observePage(app: string, timeoutMs: number, location: SourceLocation | undefined, after?: ObserveAfter): Promise<CommandResult>;
|
|
222
|
+
/**
|
|
223
|
+
* Measures an app's page once for a layout assertion: the elements `request` names, and their words when it asks. With
|
|
224
|
+
* `after`, the page first waits for its next change. The look is marked as a check's, as `observe` marks its own.
|
|
225
|
+
*/
|
|
226
|
+
observeLayout(app: string, request: LayoutRequest, timeoutMs: number, location: SourceLocation | undefined, after?: ObserveAfter): Promise<CommandResult>;
|
|
227
|
+
/**
|
|
228
|
+
* Takes a picture of an app's page, or of one element, for a screenshot assertion, and learns its size and how it
|
|
229
|
+
* stands against its baseline; the pixels stay with the parent. `previous` names the look before it in the same check,
|
|
230
|
+
* whose picture this one must match to have settled. The look is marked as a check's, as `observe` marks its own.
|
|
231
|
+
*/
|
|
232
|
+
observeScreenshot(app: string, request: ScreenshotRequest, previous: string | undefined, timeoutMs: number, location: SourceLocation | undefined): Promise<CommandResult>;
|
|
107
233
|
/**
|
|
108
234
|
* Reads an app's page once outside any check, its address and title, as `page.url()` and `page.title()` do inside
|
|
109
235
|
* `read`. No assertion follows such a look, so it is not marked as a check's.
|