@smoothdeploy/playwright 1.60.1 → 1.62.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/lib/agents/copilot-setup-steps.yml +2 -2
- package/lib/agents/generateAgents.js +48 -0
- package/lib/cli/reportActions.js +2 -2
- package/lib/cli/testActions.js +2 -0
- package/lib/common/index.js +246 -187
- package/lib/common/index.js.txt +13 -14
- package/lib/errorContext.js +2 -3
- package/lib/index.js +48 -21
- package/lib/loader/loaderProcessEntry.js +1 -1
- package/lib/matchers/expect.js +4830 -4394
- package/lib/matchers/expect.js.LICENSE +87 -140
- package/lib/matchers/expect.js.txt +30 -35
- package/lib/mcp/test/testContext.js +5 -1
- package/lib/program.js +28 -3
- package/lib/runner/index.js +400 -194
- package/lib/runner/index.js.txt +19 -18
- package/lib/transform/babelBundle.js +12899 -11654
- package/lib/transform/babelBundle.js.LICENSE +379 -354
- package/lib/transform/babelBundle.js.txt +39 -39
- package/lib/transform/esmLoader.js +3275 -1154
- package/lib/transform/esmLoader.js.LICENSE +81 -61
- package/lib/transform/esmLoader.js.txt +23 -18
- package/lib/util.js +14 -44
- package/lib/worker/workerProcessEntry.js +60 -1461
- package/lib/worker/workerProcessEntry.js.txt +8 -13
- package/package.json +3 -6
- package/types/test.d.ts +458 -21
- package/types/testReporter.d.ts +79 -4
package/types/test.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions,
|
|
|
19
19
|
export * from 'playwright-core';
|
|
20
20
|
|
|
21
21
|
export type BlobReporterOptions = { outputDir?: string, fileName?: string };
|
|
22
|
-
export type ListReporterOptions = { printSteps?: boolean };
|
|
22
|
+
export type ListReporterOptions = { printSteps?: boolean, printFailuresInline?: boolean };
|
|
23
23
|
export type JUnitReporterOptions = { outputFile?: string, stripANSIControlSequences?: boolean, includeProjectInTestName?: boolean, includeRetries?: boolean };
|
|
24
24
|
export type JsonReporterOptions = { outputFile?: string };
|
|
25
25
|
export type HtmlReporterOptions = {
|
|
@@ -32,6 +32,7 @@ export type HtmlReporterOptions = {
|
|
|
32
32
|
noSnippets?: boolean;
|
|
33
33
|
noCopyPrompt?: boolean;
|
|
34
34
|
doNotInlineAssets?: boolean;
|
|
35
|
+
mergeFiles?: boolean;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export type ReporterDescription = Readonly<
|
|
@@ -237,6 +238,13 @@ interface TestProject<TestArgs = {}, WorkerArgs = {}> {
|
|
|
237
238
|
* for details.
|
|
238
239
|
*/
|
|
239
240
|
pathTemplate?: string;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Default timeout for
|
|
244
|
+
* [expect(page).toHaveScreenshot(name[, options])](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1)
|
|
245
|
+
* in milliseconds, defaults to the global expect timeout. Setting to `0` disables the timeout.
|
|
246
|
+
*/
|
|
247
|
+
timeout?: number;
|
|
240
248
|
};
|
|
241
249
|
|
|
242
250
|
/**
|
|
@@ -1633,6 +1641,31 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
|
|
|
1633
1641
|
*/
|
|
1634
1642
|
retries?: number;
|
|
1635
1643
|
|
|
1644
|
+
/**
|
|
1645
|
+
* Controls when failed tests are retried. Defaults to `'immediate'`.
|
|
1646
|
+
* - `'immediate'` - A failed test is retried as soon as a worker is available, interleaved with the rest of the
|
|
1647
|
+
* run. This is the default.
|
|
1648
|
+
* - `'isolated'` - Retries are run at the end, after all other tests have finished, one by one in a single worker.
|
|
1649
|
+
* This minimizes the interference between retried tests and the rest of the suite, at the expense of the total
|
|
1650
|
+
* run time.
|
|
1651
|
+
*
|
|
1652
|
+
* Learn more about [test retries](https://playwright.dev/docs/test-retries#retries).
|
|
1653
|
+
*
|
|
1654
|
+
* **Usage**
|
|
1655
|
+
*
|
|
1656
|
+
* ```js
|
|
1657
|
+
* // playwright.config.ts
|
|
1658
|
+
* import { defineConfig } from '@playwright/test';
|
|
1659
|
+
*
|
|
1660
|
+
* export default defineConfig({
|
|
1661
|
+
* retries: 2,
|
|
1662
|
+
* retryStrategy: 'isolated',
|
|
1663
|
+
* });
|
|
1664
|
+
* ```
|
|
1665
|
+
*
|
|
1666
|
+
*/
|
|
1667
|
+
retryStrategy?: "immediate"|"isolated";
|
|
1668
|
+
|
|
1636
1669
|
/**
|
|
1637
1670
|
* Shard tests and execute only the selected shard. Specify in the one-based form like `{ total: 5, current: 2 }`.
|
|
1638
1671
|
*
|
|
@@ -2011,11 +2044,25 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|
|
2011
2044
|
* See [testConfig.webServer](https://playwright.dev/docs/api/class-testconfig#test-config-web-server).
|
|
2012
2045
|
*/
|
|
2013
2046
|
webServer: TestConfigWebServer | null;
|
|
2047
|
+
/**
|
|
2048
|
+
* Snapshot of [`process.argv`](https://nodejs.org/api/process.html#processargv) captured in the runner process.
|
|
2049
|
+
* Useful for reading custom command-line arguments — for example, args supplied after the `--` separator (`npx
|
|
2050
|
+
* playwright test -- --build-path=./out`). Playwright does not parse these; consumers are responsible for slicing and
|
|
2051
|
+
* interpreting them with any argument-parsing library.
|
|
2052
|
+
*/
|
|
2053
|
+
argv: Array<string>;
|
|
2054
|
+
|
|
2014
2055
|
/**
|
|
2015
2056
|
* Path to the configuration file used to run the tests. The value is an empty string if no config file was used.
|
|
2016
2057
|
*/
|
|
2017
2058
|
configFile?: string;
|
|
2018
2059
|
|
|
2060
|
+
/**
|
|
2061
|
+
* See
|
|
2062
|
+
* [testConfig.failOnFlakyTests](https://playwright.dev/docs/api/class-testconfig#test-config-fail-on-flaky-tests).
|
|
2063
|
+
*/
|
|
2064
|
+
failOnFlakyTests: boolean;
|
|
2065
|
+
|
|
2019
2066
|
/**
|
|
2020
2067
|
* See [testConfig.forbidOnly](https://playwright.dev/docs/api/class-testconfig#test-config-forbid-only).
|
|
2021
2068
|
*/
|
|
@@ -2674,7 +2721,7 @@ export type TestDetails = {
|
|
|
2674
2721
|
annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
|
|
2675
2722
|
}
|
|
2676
2723
|
|
|
2677
|
-
type TestBody<TestArgs> = (args: TestArgs, testInfo: TestInfo) => Promise<
|
|
2724
|
+
type TestBody<TestArgs> = (args: TestArgs, testInfo: TestInfo) => Promise<unknown> | unknown;
|
|
2678
2725
|
type ConditionBody<TestArgs> = (args: TestArgs) => boolean;
|
|
2679
2726
|
|
|
2680
2727
|
/**
|
|
@@ -6897,6 +6944,61 @@ export interface PlaywrightWorkerOptions {
|
|
|
6897
6944
|
* [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) are ignored.
|
|
6898
6945
|
*/
|
|
6899
6946
|
connectOptions: ConnectOptions | undefined;
|
|
6947
|
+
/**
|
|
6948
|
+
* **NOTE** This option trades test isolation for speed and is intended for component tests that drive a story gallery. Leave
|
|
6949
|
+
* it unset for end-to-end tests - a fresh browser context per test is one of the core guarantees of Playwright Test.
|
|
6950
|
+
*
|
|
6951
|
+
* **Experimental.** When set to `true`, all tests in a worker process run in a single browser context that is reused
|
|
6952
|
+
* between tests, instead of getting a brand new context per test. Defaults to `false`.
|
|
6953
|
+
*
|
|
6954
|
+
* Between tests, Playwright resets the state that component tests typically touch: it clears cookies, cache, local
|
|
6955
|
+
* storage and IndexedDB of visited origins, unregisters service workers, closes extra pages, removes routes, bindings
|
|
6956
|
+
* and init scripts, and re-applies the configured storage state, viewport and emulation options.
|
|
6957
|
+
*
|
|
6958
|
+
* This reset is best-effort, not a guarantee of isolation. State that is **not** reset includes:
|
|
6959
|
+
* - Permissions granted with
|
|
6960
|
+
* [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions)
|
|
6961
|
+
* during a test.
|
|
6962
|
+
* - Runtime changes made through
|
|
6963
|
+
* [browserContext.setGeolocation(geolocation)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-geolocation),
|
|
6964
|
+
* [browserContext.setOffline(offline)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-offline)
|
|
6965
|
+
* and
|
|
6966
|
+
* [browserContext.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-extra-http-headers).
|
|
6967
|
+
* - Browsing history, `window.name` and any browser-process-wide state.
|
|
6968
|
+
*
|
|
6969
|
+
* Additional restrictions:
|
|
6970
|
+
* - The option is ignored when
|
|
6971
|
+
* [testOptions.video](https://playwright.dev/docs/api/class-testoptions#test-options-video) recording is enabled.
|
|
6972
|
+
* - Only a few context options may differ between consecutive tests: `colorScheme`, `forcedColors`,
|
|
6973
|
+
* `reducedMotion`, `contrast`, `screen`, `userAgent`, `viewport` and `testIdAttribute`. Changing any other option
|
|
6974
|
+
* in [test.use(options)](https://playwright.dev/docs/api/class-test#test-use), for example `locale` or
|
|
6975
|
+
* `storageState`, silently forces a fresh context and negates the speedup.
|
|
6976
|
+
* - Do not combine with
|
|
6977
|
+
* [testOptions.connectOptions](https://playwright.dev/docs/api/class-testoptions#test-options-connect-options)
|
|
6978
|
+
* pointing multiple workers at a shared browser - workers would compete for the single reusable context.
|
|
6979
|
+
* - `recordHar` in
|
|
6980
|
+
* [testOptions.contextOptions](https://playwright.dev/docs/api/class-testoptions#test-options-context-options) is
|
|
6981
|
+
* not supported and produces no HAR file.
|
|
6982
|
+
*
|
|
6983
|
+
* **Usage**
|
|
6984
|
+
*
|
|
6985
|
+
* ```js
|
|
6986
|
+
* // playwright.config.ts
|
|
6987
|
+
* import { defineConfig } from '@playwright/test';
|
|
6988
|
+
*
|
|
6989
|
+
* export default defineConfig({
|
|
6990
|
+
* projects: [
|
|
6991
|
+
* {
|
|
6992
|
+
* name: 'components',
|
|
6993
|
+
* testDir: './tests/components',
|
|
6994
|
+
* use: { reuseContext: true },
|
|
6995
|
+
* },
|
|
6996
|
+
* ],
|
|
6997
|
+
* });
|
|
6998
|
+
* ```
|
|
6999
|
+
*
|
|
7000
|
+
*/
|
|
7001
|
+
reuseContext: boolean;
|
|
6900
7002
|
/**
|
|
6901
7003
|
* Whether to automatically capture a screenshot after each test. Defaults to `'off'`.
|
|
6902
7004
|
* - `'off'`: Do not capture screenshots.
|
|
@@ -6944,15 +7046,21 @@ export interface PlaywrightWorkerOptions {
|
|
|
6944
7046
|
resultScreenshots: boolean;
|
|
6945
7047
|
pauseOnFailure: boolean;
|
|
6946
7048
|
/**
|
|
6947
|
-
* Whether to record trace for each test. Defaults to `'off'`.
|
|
7049
|
+
* Whether to record trace for each test. Defaults to `'off'`. The initial run of a test is the "first run";
|
|
7050
|
+
* subsequent runs caused by [retries](https://playwright.dev/docs/test-retries) are "retries".
|
|
6948
7051
|
* - `'off'`: Do not record trace.
|
|
6949
|
-
* - `'on'`: Record trace for
|
|
6950
|
-
* - `'on-first-retry'`: Record
|
|
6951
|
-
* - `'on-all-retries'`: Record
|
|
6952
|
-
* - `'retain-on-failure'`: Record trace for
|
|
6953
|
-
*
|
|
6954
|
-
*
|
|
6955
|
-
*
|
|
7052
|
+
* - `'on'`: Record and keep a trace for every run.
|
|
7053
|
+
* - `'on-first-retry'`: Record and keep a trace only for the first retry of a test.
|
|
7054
|
+
* - `'on-all-retries'`: Record and keep a trace for every retry.
|
|
7055
|
+
* - `'retain-on-failure'`: Record a trace for every run, but keep it only for runs that failed. A failed run's
|
|
7056
|
+
* trace is kept even when a later retry passes.
|
|
7057
|
+
* - `'retain-on-first-failure'`: Record a trace only for the first run of a test (not for retries), and keep it
|
|
7058
|
+
* only if that run failed.
|
|
7059
|
+
* - `'retain-on-failure-and-retries'`: Record a trace for every run, and keep it for any run that failed or that is
|
|
7060
|
+
* a retry.
|
|
7061
|
+
*
|
|
7062
|
+
* See [trace modes](https://playwright.dev/docs/test-use-options#trace-modes) for a side-by-side comparison of what each mode records and
|
|
7063
|
+
* keeps.
|
|
6956
7064
|
*
|
|
6957
7065
|
* For more control, pass an object that specifies `mode` and trace features to enable.
|
|
6958
7066
|
*
|
|
@@ -6973,11 +7081,21 @@ export interface PlaywrightWorkerOptions {
|
|
|
6973
7081
|
*/
|
|
6974
7082
|
trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean, screenshots?: boolean, sources?: boolean, attachments?: boolean };
|
|
6975
7083
|
/**
|
|
6976
|
-
* Whether to record video for each test. Defaults to `'off'`.
|
|
7084
|
+
* Whether to record video for each test. Defaults to `'off'`. The initial run of a test is the "first run";
|
|
7085
|
+
* subsequent runs caused by [retries](https://playwright.dev/docs/test-retries) are "retries".
|
|
6977
7086
|
* - `'off'`: Do not record video.
|
|
6978
|
-
* - `'on'`: Record video for
|
|
6979
|
-
* - `'
|
|
6980
|
-
* - `'on-
|
|
7087
|
+
* - `'on'`: Record and keep a video for every run.
|
|
7088
|
+
* - `'on-first-retry'`: Record and keep a video only for the first retry of a test.
|
|
7089
|
+
* - `'on-all-retries'`: Record and keep a video for every retry.
|
|
7090
|
+
* - `'retain-on-failure'`: Record a video for every run, but keep it only for runs that failed. A failed run's
|
|
7091
|
+
* video is kept even when a later retry passes.
|
|
7092
|
+
* - `'retain-on-first-failure'`: Record a video only for the first run of a test (not for retries), and keep it
|
|
7093
|
+
* only if that run failed.
|
|
7094
|
+
* - `'retain-on-failure-and-retries'`: Record a video for every run, and keep it for any run that failed or that is
|
|
7095
|
+
* a retry.
|
|
7096
|
+
*
|
|
7097
|
+
* See [video modes](https://playwright.dev/docs/test-use-options#video-modes) for a side-by-side comparison of what each mode records and
|
|
7098
|
+
* keeps.
|
|
6981
7099
|
*
|
|
6982
7100
|
* To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be
|
|
6983
7101
|
* equal to [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) scaled
|
|
@@ -7003,12 +7121,12 @@ export interface PlaywrightWorkerOptions {
|
|
|
7003
7121
|
*
|
|
7004
7122
|
* Learn more about [recording video](https://playwright.dev/docs/test-use-options#recording-options).
|
|
7005
7123
|
*/
|
|
7006
|
-
video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize, show?: { actions?: { duration?: number, position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number }, test?: { level?: 'file' | 'title' | 'step', position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number } } };
|
|
7124
|
+
video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize, show?: { actions?: { duration?: number, position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number, cursor?: 'none' | 'pointer' }, test?: { level?: 'file' | 'title' | 'step', position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number } } };
|
|
7007
7125
|
}
|
|
7008
7126
|
|
|
7009
7127
|
export type ScreenshotMode = 'off' | 'on' | 'only-on-failure' | 'on-first-failure';
|
|
7010
7128
|
export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure' | 'retain-on-failure-and-retries';
|
|
7011
|
-
export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry';
|
|
7129
|
+
export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure' | 'retain-on-failure-and-retries';
|
|
7012
7130
|
/**
|
|
7013
7131
|
* Playwright Test provides many options to configure test environment,
|
|
7014
7132
|
* [Browser](https://playwright.dev/docs/api/class-browser),
|
|
@@ -7597,7 +7715,7 @@ export interface PlaywrightTestOptions {
|
|
|
7597
7715
|
/**
|
|
7598
7716
|
* Custom attribute to be used in
|
|
7599
7717
|
* [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used
|
|
7600
|
-
* by default.
|
|
7718
|
+
* by default. To match elements with any of several attributes, pass them as a comma-separated list.
|
|
7601
7719
|
*
|
|
7602
7720
|
* **Usage**
|
|
7603
7721
|
*
|
|
@@ -7612,6 +7730,19 @@ export interface PlaywrightTestOptions {
|
|
|
7612
7730
|
* });
|
|
7613
7731
|
* ```
|
|
7614
7732
|
*
|
|
7733
|
+
* Multiple attributes:
|
|
7734
|
+
*
|
|
7735
|
+
* ```js
|
|
7736
|
+
* // playwright.config.ts
|
|
7737
|
+
* import { defineConfig } from '@playwright/test';
|
|
7738
|
+
*
|
|
7739
|
+
* export default defineConfig({
|
|
7740
|
+
* use: {
|
|
7741
|
+
* testIdAttribute: 'data-pw,data-ti',
|
|
7742
|
+
* },
|
|
7743
|
+
* });
|
|
7744
|
+
* ```
|
|
7745
|
+
*
|
|
7615
7746
|
*/
|
|
7616
7747
|
testIdAttribute: string;
|
|
7617
7748
|
}
|
|
@@ -7666,6 +7797,12 @@ export interface PlaywrightWorkerArgs {
|
|
|
7666
7797
|
browser: Browser;
|
|
7667
7798
|
}
|
|
7668
7799
|
|
|
7800
|
+
type StoryProps<Story> =
|
|
7801
|
+
Story extends (props: infer Props) => any ? Props :
|
|
7802
|
+
Story extends new (...args: any[]) => { $props: infer Props } ? Props :
|
|
7803
|
+
Story extends new (props: infer Props, ...args: any[]) => any ? Props :
|
|
7804
|
+
Story;
|
|
7805
|
+
|
|
7669
7806
|
/**
|
|
7670
7807
|
* Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to
|
|
7671
7808
|
* establish environment for each test, giving the test everything it needs and nothing else.
|
|
@@ -7757,6 +7894,48 @@ export interface PlaywrightTestArgs {
|
|
|
7757
7894
|
*
|
|
7758
7895
|
*/
|
|
7759
7896
|
request: APIRequestContext;
|
|
7897
|
+
/**
|
|
7898
|
+
* Mounts a component story and returns a [Locator](https://playwright.dev/docs/api/class-locator) pointing to the
|
|
7899
|
+
* root element the story was rendered into. Scope your queries from the returned locator:
|
|
7900
|
+
* `component.getByRole('button')`, not `page.getByRole('button')`.
|
|
7901
|
+
*
|
|
7902
|
+
* A **story** is a small wrapper component that embeds the component under test in one specific scenario: hard-coded
|
|
7903
|
+
* props, mock data, providers, recorded callbacks. Stories are rendered by a **gallery** page that you implement and
|
|
7904
|
+
* serve at [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). The
|
|
7905
|
+
* gallery exposes `window.mount(params)` and `window.unmount()` functions that render a story into its root element.
|
|
7906
|
+
* Each call to [fixtures.mount(storyId[, props])](https://playwright.dev/docs/api/class-fixtures#fixtures-mount)
|
|
7907
|
+
* navigates to [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) and
|
|
7908
|
+
* calls `window.mount()` with the story id and props, so tests are fully isolated from each other.
|
|
7909
|
+
*
|
|
7910
|
+
* **Usage**
|
|
7911
|
+
*
|
|
7912
|
+
* ```js
|
|
7913
|
+
* test('click should expand', async ({ mount }) => {
|
|
7914
|
+
* const component = await mount('components/Expandable/Stateful');
|
|
7915
|
+
* await component.getByRole('button').click();
|
|
7916
|
+
* await expect(component.getByTestId('expanded')).toHaveValue('true');
|
|
7917
|
+
* });
|
|
7918
|
+
* ```
|
|
7919
|
+
*
|
|
7920
|
+
* Pass the story type as a template argument to type-check the props:
|
|
7921
|
+
*
|
|
7922
|
+
* ```js
|
|
7923
|
+
* import type { WithTitle } from './Button.story';
|
|
7924
|
+
*
|
|
7925
|
+
* test('renders the title', async ({ mount }) => {
|
|
7926
|
+
* const component = await mount<typeof WithTitle>('Button/WithTitle', { title: 'Hello' });
|
|
7927
|
+
* await expect(component).toContainText('Hello');
|
|
7928
|
+
* });
|
|
7929
|
+
* ```
|
|
7930
|
+
*
|
|
7931
|
+
* The returned locator is augmented with two methods:
|
|
7932
|
+
* - `update(props)` - re-renders the same story with new props without remounting, preserving component state;
|
|
7933
|
+
* - `unmount()` - unmounts the story.
|
|
7934
|
+
* @param storyId Identifier of the story to mount, as resolved by the gallery page. Conventionally, the story file path plus the
|
|
7935
|
+
* exported story name, for example `'components/Button/Primary'`.
|
|
7936
|
+
* @param props Optional plain, serializable props passed to the story.
|
|
7937
|
+
*/
|
|
7938
|
+
mount: <Story = Record<string, any>>(storyId: string, props?: StoryProps<Story>) => Promise<Locator & { update(props?: StoryProps<Story>): Promise<void>, unmount(): Promise<void> }>;
|
|
7760
7939
|
}
|
|
7761
7940
|
|
|
7762
7941
|
type ExcludeProps<A, B> = {
|
|
@@ -8558,7 +8737,7 @@ type PollMatchers<R, T, ExtendedMatchers> = {
|
|
|
8558
8737
|
|
|
8559
8738
|
export type Expect<ExtendedMatchers = {}> = {
|
|
8560
8739
|
<T = unknown>(actual: T, messageOrOptions?: string | { message?: string }): MakeMatchers<void, T, ExtendedMatchers>;
|
|
8561
|
-
soft: <
|
|
8740
|
+
soft: Expect<ExtendedMatchers>;
|
|
8562
8741
|
poll: <T = unknown>(actual: () => T | Promise<T>, messageOrOptions?: string | { message?: string, timeout?: number, intervals?: number[] }) => PollMatchers<Promise<void>, T, ExtendedMatchers>;
|
|
8563
8742
|
extend<MoreMatchers extends Record<string, (this: ExpectMatcherState, receiver: any, ...args: any[]) => MatcherReturnType | Promise<MatcherReturnType>>>(matchers: MoreMatchers): Expect<ExtendedMatchers & MoreMatchers>;
|
|
8564
8743
|
configure: (configuration: {
|
|
@@ -8620,7 +8799,6 @@ export function mergeExpects<List extends any[]>(...expects: List): MergedExpect
|
|
|
8620
8799
|
export { };
|
|
8621
8800
|
|
|
8622
8801
|
|
|
8623
|
-
|
|
8624
8802
|
/**
|
|
8625
8803
|
* The [APIResponseAssertions](https://playwright.dev/docs/api/class-apiresponseassertions) class provides assertion
|
|
8626
8804
|
* methods that can be used to make assertions about the
|
|
@@ -8697,6 +8875,13 @@ interface LocatorAssertions {
|
|
|
8697
8875
|
toBeAttached(options?: {
|
|
8698
8876
|
attached?: boolean;
|
|
8699
8877
|
|
|
8878
|
+
/**
|
|
8879
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
8880
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
8881
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
8882
|
+
*/
|
|
8883
|
+
signal?: AbortSignal;
|
|
8884
|
+
|
|
8700
8885
|
/**
|
|
8701
8886
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8702
8887
|
*/
|
|
@@ -8731,6 +8916,13 @@ interface LocatorAssertions {
|
|
|
8731
8916
|
*/
|
|
8732
8917
|
indeterminate?: boolean;
|
|
8733
8918
|
|
|
8919
|
+
/**
|
|
8920
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
8921
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
8922
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
8923
|
+
*/
|
|
8924
|
+
signal?: AbortSignal;
|
|
8925
|
+
|
|
8734
8926
|
/**
|
|
8735
8927
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8736
8928
|
*/
|
|
@@ -8754,6 +8946,13 @@ interface LocatorAssertions {
|
|
|
8754
8946
|
* @param options
|
|
8755
8947
|
*/
|
|
8756
8948
|
toBeDisabled(options?: {
|
|
8949
|
+
/**
|
|
8950
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
8951
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
8952
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
8953
|
+
*/
|
|
8954
|
+
signal?: AbortSignal;
|
|
8955
|
+
|
|
8757
8956
|
/**
|
|
8758
8957
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8759
8958
|
*/
|
|
@@ -8775,6 +8974,13 @@ interface LocatorAssertions {
|
|
|
8775
8974
|
toBeEditable(options?: {
|
|
8776
8975
|
editable?: boolean;
|
|
8777
8976
|
|
|
8977
|
+
/**
|
|
8978
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
8979
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
8980
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
8981
|
+
*/
|
|
8982
|
+
signal?: AbortSignal;
|
|
8983
|
+
|
|
8778
8984
|
/**
|
|
8779
8985
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8780
8986
|
*/
|
|
@@ -8795,6 +9001,13 @@ interface LocatorAssertions {
|
|
|
8795
9001
|
* @param options
|
|
8796
9002
|
*/
|
|
8797
9003
|
toBeEmpty(options?: {
|
|
9004
|
+
/**
|
|
9005
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9006
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9007
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9008
|
+
*/
|
|
9009
|
+
signal?: AbortSignal;
|
|
9010
|
+
|
|
8798
9011
|
/**
|
|
8799
9012
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8800
9013
|
*/
|
|
@@ -8816,6 +9029,13 @@ interface LocatorAssertions {
|
|
|
8816
9029
|
toBeEnabled(options?: {
|
|
8817
9030
|
enabled?: boolean;
|
|
8818
9031
|
|
|
9032
|
+
/**
|
|
9033
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9034
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9035
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9036
|
+
*/
|
|
9037
|
+
signal?: AbortSignal;
|
|
9038
|
+
|
|
8819
9039
|
/**
|
|
8820
9040
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8821
9041
|
*/
|
|
@@ -8835,6 +9055,13 @@ interface LocatorAssertions {
|
|
|
8835
9055
|
* @param options
|
|
8836
9056
|
*/
|
|
8837
9057
|
toBeFocused(options?: {
|
|
9058
|
+
/**
|
|
9059
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9060
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9061
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9062
|
+
*/
|
|
9063
|
+
signal?: AbortSignal;
|
|
9064
|
+
|
|
8838
9065
|
/**
|
|
8839
9066
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8840
9067
|
*/
|
|
@@ -8855,6 +9082,13 @@ interface LocatorAssertions {
|
|
|
8855
9082
|
* @param options
|
|
8856
9083
|
*/
|
|
8857
9084
|
toBeHidden(options?: {
|
|
9085
|
+
/**
|
|
9086
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9087
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9088
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9089
|
+
*/
|
|
9090
|
+
signal?: AbortSignal;
|
|
9091
|
+
|
|
8858
9092
|
/**
|
|
8859
9093
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8860
9094
|
*/
|
|
@@ -8887,6 +9121,13 @@ interface LocatorAssertions {
|
|
|
8887
9121
|
*/
|
|
8888
9122
|
ratio?: number;
|
|
8889
9123
|
|
|
9124
|
+
/**
|
|
9125
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9126
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9127
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9128
|
+
*/
|
|
9129
|
+
signal?: AbortSignal;
|
|
9130
|
+
|
|
8890
9131
|
/**
|
|
8891
9132
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8892
9133
|
*/
|
|
@@ -8920,6 +9161,13 @@ interface LocatorAssertions {
|
|
|
8920
9161
|
* @param options
|
|
8921
9162
|
*/
|
|
8922
9163
|
toBeVisible(options?: {
|
|
9164
|
+
/**
|
|
9165
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9166
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9167
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9168
|
+
*/
|
|
9169
|
+
signal?: AbortSignal;
|
|
9170
|
+
|
|
8923
9171
|
/**
|
|
8924
9172
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8925
9173
|
*/
|
|
@@ -8967,6 +9215,13 @@ interface LocatorAssertions {
|
|
|
8967
9215
|
* @param options
|
|
8968
9216
|
*/
|
|
8969
9217
|
toContainClass(expected: string|ReadonlyArray<string>, options?: {
|
|
9218
|
+
/**
|
|
9219
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9220
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9221
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9222
|
+
*/
|
|
9223
|
+
signal?: AbortSignal;
|
|
9224
|
+
|
|
8970
9225
|
/**
|
|
8971
9226
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
8972
9227
|
*/
|
|
@@ -9034,6 +9289,13 @@ interface LocatorAssertions {
|
|
|
9034
9289
|
*/
|
|
9035
9290
|
ignoreCase?: boolean;
|
|
9036
9291
|
|
|
9292
|
+
/**
|
|
9293
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9294
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9295
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9296
|
+
*/
|
|
9297
|
+
signal?: AbortSignal;
|
|
9298
|
+
|
|
9037
9299
|
/**
|
|
9038
9300
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9039
9301
|
*/
|
|
@@ -9067,6 +9329,13 @@ interface LocatorAssertions {
|
|
|
9067
9329
|
*/
|
|
9068
9330
|
ignoreCase?: boolean;
|
|
9069
9331
|
|
|
9332
|
+
/**
|
|
9333
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9334
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9335
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9336
|
+
*/
|
|
9337
|
+
signal?: AbortSignal;
|
|
9338
|
+
|
|
9070
9339
|
/**
|
|
9071
9340
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9072
9341
|
*/
|
|
@@ -9095,6 +9364,13 @@ interface LocatorAssertions {
|
|
|
9095
9364
|
*/
|
|
9096
9365
|
ignoreCase?: boolean;
|
|
9097
9366
|
|
|
9367
|
+
/**
|
|
9368
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9369
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9370
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9371
|
+
*/
|
|
9372
|
+
signal?: AbortSignal;
|
|
9373
|
+
|
|
9098
9374
|
/**
|
|
9099
9375
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9100
9376
|
*/
|
|
@@ -9123,6 +9399,13 @@ interface LocatorAssertions {
|
|
|
9123
9399
|
*/
|
|
9124
9400
|
ignoreCase?: boolean;
|
|
9125
9401
|
|
|
9402
|
+
/**
|
|
9403
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9404
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9405
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9406
|
+
*/
|
|
9407
|
+
signal?: AbortSignal;
|
|
9408
|
+
|
|
9126
9409
|
/**
|
|
9127
9410
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9128
9411
|
*/
|
|
@@ -9151,6 +9434,13 @@ interface LocatorAssertions {
|
|
|
9151
9434
|
*/
|
|
9152
9435
|
ignoreCase?: boolean;
|
|
9153
9436
|
|
|
9437
|
+
/**
|
|
9438
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9439
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9440
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9441
|
+
*/
|
|
9442
|
+
signal?: AbortSignal;
|
|
9443
|
+
|
|
9154
9444
|
/**
|
|
9155
9445
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9156
9446
|
*/
|
|
@@ -9172,6 +9462,13 @@ interface LocatorAssertions {
|
|
|
9172
9462
|
* @param options
|
|
9173
9463
|
*/
|
|
9174
9464
|
toHaveAttribute(name: string, options?: {
|
|
9465
|
+
/**
|
|
9466
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9467
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9468
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9469
|
+
*/
|
|
9470
|
+
signal?: AbortSignal;
|
|
9471
|
+
|
|
9175
9472
|
/**
|
|
9176
9473
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9177
9474
|
*/
|
|
@@ -9208,6 +9505,13 @@ interface LocatorAssertions {
|
|
|
9208
9505
|
* @param options
|
|
9209
9506
|
*/
|
|
9210
9507
|
toHaveClass(expected: string|RegExp|ReadonlyArray<string|RegExp>, options?: {
|
|
9508
|
+
/**
|
|
9509
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9510
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9511
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9512
|
+
*/
|
|
9513
|
+
signal?: AbortSignal;
|
|
9514
|
+
|
|
9211
9515
|
/**
|
|
9212
9516
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9213
9517
|
*/
|
|
@@ -9228,6 +9532,13 @@ interface LocatorAssertions {
|
|
|
9228
9532
|
* @param options
|
|
9229
9533
|
*/
|
|
9230
9534
|
toHaveCount(count: number, options?: {
|
|
9535
|
+
/**
|
|
9536
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9537
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9538
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9539
|
+
*/
|
|
9540
|
+
signal?: AbortSignal;
|
|
9541
|
+
|
|
9231
9542
|
/**
|
|
9232
9543
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9233
9544
|
*/
|
|
@@ -9255,6 +9566,13 @@ interface LocatorAssertions {
|
|
|
9255
9566
|
*/
|
|
9256
9567
|
pseudo?: "before"|"after";
|
|
9257
9568
|
|
|
9569
|
+
/**
|
|
9570
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9571
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9572
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9573
|
+
*/
|
|
9574
|
+
signal?: AbortSignal;
|
|
9575
|
+
|
|
9258
9576
|
/**
|
|
9259
9577
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9260
9578
|
*/
|
|
@@ -9276,6 +9594,13 @@ interface LocatorAssertions {
|
|
|
9276
9594
|
* @param options
|
|
9277
9595
|
*/
|
|
9278
9596
|
toHaveId(id: string|RegExp, options?: {
|
|
9597
|
+
/**
|
|
9598
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9599
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9600
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9601
|
+
*/
|
|
9602
|
+
signal?: AbortSignal;
|
|
9603
|
+
|
|
9279
9604
|
/**
|
|
9280
9605
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9281
9606
|
*/
|
|
@@ -9298,6 +9623,13 @@ interface LocatorAssertions {
|
|
|
9298
9623
|
* @param options
|
|
9299
9624
|
*/
|
|
9300
9625
|
toHaveJSProperty(name: string, value: any, options?: {
|
|
9626
|
+
/**
|
|
9627
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9628
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9629
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9630
|
+
*/
|
|
9631
|
+
signal?: AbortSignal;
|
|
9632
|
+
|
|
9301
9633
|
/**
|
|
9302
9634
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9303
9635
|
*/
|
|
@@ -9322,6 +9654,13 @@ interface LocatorAssertions {
|
|
|
9322
9654
|
* @param options
|
|
9323
9655
|
*/
|
|
9324
9656
|
toHaveRole(role: "alert"|"alertdialog"|"application"|"article"|"banner"|"blockquote"|"button"|"caption"|"cell"|"checkbox"|"code"|"columnheader"|"combobox"|"complementary"|"contentinfo"|"definition"|"deletion"|"dialog"|"directory"|"document"|"emphasis"|"feed"|"figure"|"form"|"generic"|"grid"|"gridcell"|"group"|"heading"|"img"|"insertion"|"link"|"list"|"listbox"|"listitem"|"log"|"main"|"marquee"|"math"|"meter"|"menu"|"menubar"|"menuitem"|"menuitemcheckbox"|"menuitemradio"|"navigation"|"none"|"note"|"option"|"paragraph"|"presentation"|"progressbar"|"radio"|"radiogroup"|"region"|"row"|"rowgroup"|"rowheader"|"scrollbar"|"search"|"searchbox"|"separator"|"slider"|"spinbutton"|"status"|"strong"|"subscript"|"superscript"|"switch"|"tab"|"table"|"tablist"|"tabpanel"|"term"|"textbox"|"time"|"timer"|"toolbar"|"tooltip"|"tree"|"treegrid"|"treeitem", options?: {
|
|
9657
|
+
/**
|
|
9658
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9659
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9660
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9661
|
+
*/
|
|
9662
|
+
signal?: AbortSignal;
|
|
9663
|
+
|
|
9325
9664
|
/**
|
|
9326
9665
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9327
9666
|
*/
|
|
@@ -9337,10 +9676,14 @@ interface LocatorAssertions {
|
|
|
9337
9676
|
* ```js
|
|
9338
9677
|
* const locator = page.getByRole('button');
|
|
9339
9678
|
* await expect(locator).toHaveScreenshot('image.png');
|
|
9679
|
+
*
|
|
9680
|
+
* // Store the snapshot in the WebP format.
|
|
9681
|
+
* await expect(locator).toHaveScreenshot('image.webp');
|
|
9340
9682
|
* ```
|
|
9341
9683
|
*
|
|
9342
9684
|
* Note that screenshot assertions only work with Playwright test runner.
|
|
9343
|
-
* @param name Snapshot name.
|
|
9685
|
+
* @param name Snapshot name. Must have a `.png` or `.webp` extension, the screenshot is captured in the corresponding format.
|
|
9686
|
+
* Both formats are lossless.
|
|
9344
9687
|
* @param options
|
|
9345
9688
|
*/
|
|
9346
9689
|
toHaveScreenshot(name: string|ReadonlyArray<string>, options?: {
|
|
@@ -9402,6 +9745,13 @@ interface LocatorAssertions {
|
|
|
9402
9745
|
*/
|
|
9403
9746
|
scale?: "css"|"device";
|
|
9404
9747
|
|
|
9748
|
+
/**
|
|
9749
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9750
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9751
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9752
|
+
*/
|
|
9753
|
+
signal?: AbortSignal;
|
|
9754
|
+
|
|
9405
9755
|
/**
|
|
9406
9756
|
* File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic
|
|
9407
9757
|
* elements, make elements invisible or change their properties to help you creating repeatable screenshots. This
|
|
@@ -9426,6 +9776,9 @@ interface LocatorAssertions {
|
|
|
9426
9776
|
* This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
|
|
9427
9777
|
* screenshot with the expectation.
|
|
9428
9778
|
*
|
|
9779
|
+
* The snapshot is stored in the PNG format. To store it in the WebP format instead, pass a snapshot name with the
|
|
9780
|
+
* `.webp` extension.
|
|
9781
|
+
*
|
|
9429
9782
|
* **Usage**
|
|
9430
9783
|
*
|
|
9431
9784
|
* ```js
|
|
@@ -9495,6 +9848,13 @@ interface LocatorAssertions {
|
|
|
9495
9848
|
*/
|
|
9496
9849
|
scale?: "css"|"device";
|
|
9497
9850
|
|
|
9851
|
+
/**
|
|
9852
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9853
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9854
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9855
|
+
*/
|
|
9856
|
+
signal?: AbortSignal;
|
|
9857
|
+
|
|
9498
9858
|
/**
|
|
9499
9859
|
* File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic
|
|
9500
9860
|
* elements, make elements invisible or change their properties to help you creating repeatable screenshots. This
|
|
@@ -9575,6 +9935,13 @@ interface LocatorAssertions {
|
|
|
9575
9935
|
*/
|
|
9576
9936
|
ignoreCase?: boolean;
|
|
9577
9937
|
|
|
9938
|
+
/**
|
|
9939
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9940
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9941
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9942
|
+
*/
|
|
9943
|
+
signal?: AbortSignal;
|
|
9944
|
+
|
|
9578
9945
|
/**
|
|
9579
9946
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9580
9947
|
*/
|
|
@@ -9601,6 +9968,13 @@ interface LocatorAssertions {
|
|
|
9601
9968
|
* @param options
|
|
9602
9969
|
*/
|
|
9603
9970
|
toHaveValue(value: string|RegExp, options?: {
|
|
9971
|
+
/**
|
|
9972
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
9973
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
9974
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
9975
|
+
*/
|
|
9976
|
+
signal?: AbortSignal;
|
|
9977
|
+
|
|
9604
9978
|
/**
|
|
9605
9979
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9606
9980
|
*/
|
|
@@ -9633,6 +10007,13 @@ interface LocatorAssertions {
|
|
|
9633
10007
|
* @param options
|
|
9634
10008
|
*/
|
|
9635
10009
|
toHaveValues(values: ReadonlyArray<string|RegExp>, options?: {
|
|
10010
|
+
/**
|
|
10011
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10012
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10013
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10014
|
+
*/
|
|
10015
|
+
signal?: AbortSignal;
|
|
10016
|
+
|
|
9636
10017
|
/**
|
|
9637
10018
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9638
10019
|
*/
|
|
@@ -9656,6 +10037,13 @@ interface LocatorAssertions {
|
|
|
9656
10037
|
* @param options
|
|
9657
10038
|
*/
|
|
9658
10039
|
toMatchAriaSnapshot(expected: string, options?: {
|
|
10040
|
+
/**
|
|
10041
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10042
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10043
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10044
|
+
*/
|
|
10045
|
+
signal?: AbortSignal;
|
|
10046
|
+
|
|
9659
10047
|
/**
|
|
9660
10048
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9661
10049
|
*/
|
|
@@ -9684,6 +10072,13 @@ interface LocatorAssertions {
|
|
|
9684
10072
|
*/
|
|
9685
10073
|
name?: string;
|
|
9686
10074
|
|
|
10075
|
+
/**
|
|
10076
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10077
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10078
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10079
|
+
*/
|
|
10080
|
+
signal?: AbortSignal;
|
|
10081
|
+
|
|
9687
10082
|
/**
|
|
9688
10083
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9689
10084
|
*/
|
|
@@ -9729,10 +10124,14 @@ interface PageAssertions {
|
|
|
9729
10124
|
*
|
|
9730
10125
|
* ```js
|
|
9731
10126
|
* await expect(page).toHaveScreenshot('image.png');
|
|
10127
|
+
*
|
|
10128
|
+
* // Store the snapshot in the WebP format.
|
|
10129
|
+
* await expect(page).toHaveScreenshot('image.webp');
|
|
9732
10130
|
* ```
|
|
9733
10131
|
*
|
|
9734
10132
|
* Note that screenshot assertions only work with Playwright test runner.
|
|
9735
|
-
* @param name Snapshot name.
|
|
10133
|
+
* @param name Snapshot name. Must have a `.png` or `.webp` extension, the screenshot is captured in the corresponding format.
|
|
10134
|
+
* Both formats are lossless.
|
|
9736
10135
|
* @param options
|
|
9737
10136
|
*/
|
|
9738
10137
|
toHaveScreenshot(name: string|ReadonlyArray<string>, options?: PageAssertionsToHaveScreenshotOptions): Promise<void>;
|
|
@@ -9741,6 +10140,9 @@ interface PageAssertions {
|
|
|
9741
10140
|
* This function will wait until two consecutive page screenshots yield the same result, and then compare the last
|
|
9742
10141
|
* screenshot with the expectation.
|
|
9743
10142
|
*
|
|
10143
|
+
* The snapshot is stored in the PNG format. To store it in the WebP format instead, pass a snapshot name with the
|
|
10144
|
+
* `.webp` extension.
|
|
10145
|
+
*
|
|
9744
10146
|
* **Usage**
|
|
9745
10147
|
*
|
|
9746
10148
|
* ```js
|
|
@@ -9765,6 +10167,13 @@ interface PageAssertions {
|
|
|
9765
10167
|
* @param options
|
|
9766
10168
|
*/
|
|
9767
10169
|
toHaveTitle(titleOrRegExp: string|RegExp, options?: {
|
|
10170
|
+
/**
|
|
10171
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10172
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10173
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10174
|
+
*/
|
|
10175
|
+
signal?: AbortSignal;
|
|
10176
|
+
|
|
9768
10177
|
/**
|
|
9769
10178
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9770
10179
|
*/
|
|
@@ -9810,6 +10219,13 @@ interface PageAssertions {
|
|
|
9810
10219
|
*/
|
|
9811
10220
|
ignoreCase?: boolean;
|
|
9812
10221
|
|
|
10222
|
+
/**
|
|
10223
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10224
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10225
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10226
|
+
*/
|
|
10227
|
+
signal?: AbortSignal;
|
|
10228
|
+
|
|
9813
10229
|
/**
|
|
9814
10230
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9815
10231
|
*/
|
|
@@ -9833,6 +10249,13 @@ interface PageAssertions {
|
|
|
9833
10249
|
* @param options
|
|
9834
10250
|
*/
|
|
9835
10251
|
toMatchAriaSnapshot(expected: string, options?: {
|
|
10252
|
+
/**
|
|
10253
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10254
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10255
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10256
|
+
*/
|
|
10257
|
+
signal?: AbortSignal;
|
|
10258
|
+
|
|
9836
10259
|
/**
|
|
9837
10260
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9838
10261
|
*/
|
|
@@ -9861,6 +10284,13 @@ interface PageAssertions {
|
|
|
9861
10284
|
*/
|
|
9862
10285
|
name?: string;
|
|
9863
10286
|
|
|
10287
|
+
/**
|
|
10288
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10289
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10290
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10291
|
+
*/
|
|
10292
|
+
signal?: AbortSignal;
|
|
10293
|
+
|
|
9864
10294
|
/**
|
|
9865
10295
|
* Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
|
|
9866
10296
|
*/
|
|
@@ -10316,6 +10746,13 @@ export interface PageAssertionsToHaveScreenshotOptions {
|
|
|
10316
10746
|
*/
|
|
10317
10747
|
scale?: "css"|"device";
|
|
10318
10748
|
|
|
10749
|
+
/**
|
|
10750
|
+
* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
|
|
10751
|
+
* assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
|
|
10752
|
+
* retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
|
|
10753
|
+
*/
|
|
10754
|
+
signal?: AbortSignal;
|
|
10755
|
+
|
|
10319
10756
|
/**
|
|
10320
10757
|
* File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic
|
|
10321
10758
|
* elements, make elements invisible or change their properties to help you creating repeatable screenshots. This
|