playwright 1.62.1 → 1.65.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.
@@ -351,6 +351,7 @@ export interface JSONReportTestResult {
351
351
 
352
352
  export interface JSONReportTestStep {
353
353
  title: string;
354
+ subtitle?: string;
354
355
  duration: number;
355
356
  error: TestError | undefined;
356
357
  steps?: JSONReportTestStep[];
@@ -749,8 +750,8 @@ export interface TestResult {
749
750
  }
750
751
 
751
752
  /**
752
- * Controls which tests will run and their expected status. A [TestRun](https://playwright.dev/docs/api/class-testrun)
753
- * is available during
753
+ * Controls which tests will run and their expected status, and provides information about suite execution modes. A
754
+ * [TestRun](https://playwright.dev/docs/api/class-testrun) is available during
754
755
  * [reporter.preprocess(params)](https://playwright.dev/docs/api/class-reporter#reporter-preprocess). Setup and
755
756
  * teardown projects cannot be changed.
756
757
  */
@@ -778,6 +779,26 @@ export interface TestRun {
778
779
  */
779
780
  fixme(test: TestCase|Suite, reason?: string): void;
780
781
 
782
+ /**
783
+ * Returns the execution mode configured for a suite with
784
+ * [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure),
785
+ * [test.describe.serial([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-serial)
786
+ * or
787
+ * [test.describe.parallel([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe-parallel).
788
+ * If the suite does not configure a mode, it inherits its parent's mode. Project suites use `"parallel"` when
789
+ * [testProject.fullyParallel](https://playwright.dev/docs/api/class-testproject#test-project-fully-parallel) is
790
+ * enabled, and `"default"` otherwise. The root suite uses `"default"`.
791
+ *
792
+ * An explicit `"default"` suite does not inherit `"parallel"` from its parent: its tests run in order in the same
793
+ * worker. The mode alone does not describe complete test groups, which also depend on worker fixtures and hooks.
794
+ *
795
+ * This method can only be called during
796
+ * [reporter.preprocess(params)](https://playwright.dev/docs/api/class-reporter#reporter-preprocess), and can also
797
+ * inspect setup and teardown projects.
798
+ * @param suite Suite to inspect.
799
+ */
800
+ mode(suite: Suite): "serial"|"parallel"|"default";
801
+
781
802
  /**
782
803
  * Skips a test or every test in a suite. The test bodies are not executed and the tests are reported as skipped.
783
804
  * @param test Test or suite to skip.
@@ -875,6 +896,34 @@ export interface TestStep {
875
896
  */
876
897
  location?: Location;
877
898
 
899
+ /**
900
+ * Step-dependent parameters, when available. For example, steps produced by the Playwright API calls contain the
901
+ * target `locator` and the call arguments such as `url`, while
902
+ * [test.step(title, body[, options])](https://playwright.dev/docs/api/class-test#test-step) steps contain the
903
+ * parameters passed by the test author.
904
+ *
905
+ * ```js
906
+ * // { locator: 'getByRole(\'button\')' }
907
+ * await page.getByRole('button').click();
908
+ *
909
+ * // { url: 'https://example.com' }
910
+ * await page.goto('https://example.com');
911
+ *
912
+ * // { locator: 'getByLabel(\'Password\')', value: 'secret' }
913
+ * await page.getByLabel('Password').fill('secret');
914
+ *
915
+ * // { orderId: 42 }
916
+ * await test.step('checkout', async () => {
917
+ * // ...
918
+ * }, { params: { orderId: 42 } });
919
+ * ```
920
+ *
921
+ * To keep the reports small, Playwright API calls only report a curated set of arguments per call, and long string
922
+ * values are truncated. Unbounded arguments such as the page content, evaluated expressions or request bodies are
923
+ * never reported.
924
+ */
925
+ params?: { [key: string]: any; };
926
+
878
927
  /**
879
928
  * Parent step, if any.
880
929
  */
@@ -891,7 +940,29 @@ export interface TestStep {
891
940
  steps: Array<TestStep>;
892
941
 
893
942
  /**
894
- * User-friendly test step title.
943
+ * User-friendly test step subtitle that complements the title, when available. For Playwright API calls, it is the
944
+ * target locator or the navigation url. For example, a `Click` step has the clicked locator as a subtitle.
945
+ * [test.step(title, body[, options])](https://playwright.dev/docs/api/class-test#test-step) steps carry the subtitle
946
+ * passed by the test author. User interfaces typically render the subtitle next to the title or on a separate line.
947
+ *
948
+ * ```js
949
+ * // title `Click`, subtitle `getByRole('button')`
950
+ * await page.getByRole('button').click();
951
+ *
952
+ * // title `Navigate`, subtitle `example.com/index.html`
953
+ * await page.goto('https://example.com/index.html');
954
+ *
955
+ * // title `Add to cart`, subtitle `SKU 42`
956
+ * await test.step('Add to cart', async () => {
957
+ * // ...
958
+ * }, { subtitle: 'SKU 42' });
959
+ * ```
960
+ *
961
+ */
962
+ subtitle?: string;
963
+
964
+ /**
965
+ * User-friendly test step title, for example `Click` or `Navigate`.
895
966
  */
896
967
  title: string;
897
968
  }
package/jsx-runtime.js DELETED
@@ -1,42 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- function jsx(type, props, key) {
18
- return {
19
- __pw_type: 'jsx',
20
- type,
21
- props,
22
- key,
23
- };
24
- }
25
-
26
- function jsxs(type, props, key) {
27
- return {
28
- __pw_type: 'jsx',
29
- type,
30
- props,
31
- key,
32
- };
33
- }
34
-
35
- // this is used in <></> notation
36
- const Fragment = { __pw_jsx_fragment: true };
37
-
38
- module.exports = {
39
- Fragment,
40
- jsx,
41
- jsxs,
42
- };
package/jsx-runtime.mjs DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import jsxRuntime from './jsx-runtime.js';
18
-
19
- export const jsx = jsxRuntime.jsx;
20
- export const jsxs = jsxRuntime.jsxs;
21
- export const Fragment = jsxRuntime.Fragment;