codeceptjs 3.5.9-beta.1 → 3.5.9-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.5.9-beta.1",
3
+ "version": "3.5.9-beta.2",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -80,9 +80,9 @@
80
80
  "chai-string": "^1.5.0",
81
81
  "chalk": "4.1.2",
82
82
  "commander": "11.0.0",
83
+ "convert-cssxpath": "1.0.2",
83
84
  "cross-spawn": "7.0.3",
84
- "css-to-xpath": "0.1.0",
85
- "envinfo": "7.8.1",
85
+ "envinfo": "7.11.0",
86
86
  "escape-string-regexp": "4.0.0",
87
87
  "figures": "3.2.0",
88
88
  "fn-args": "4.0.0",
@@ -91,7 +91,7 @@
91
91
  "html-minifier": "4.0.0",
92
92
  "inquirer": "6.5.2",
93
93
  "joi": "17.11.0",
94
- "js-beautify": "1.14.9",
94
+ "js-beautify": "1.14.11",
95
95
  "lodash.clonedeep": "4.5.0",
96
96
  "lodash.merge": "4.6.2",
97
97
  "mkdirp": "1.0.4",
@@ -458,7 +458,7 @@ declare namespace CodeceptJS {
458
458
  * Switch to the specified context.
459
459
  * @param context - the context to switch to
460
460
  */
461
- _switchToContext(context: any): Promise<any>;
461
+ switchToContext(context: any): Promise<any>;
462
462
  /**
463
463
  * Switches to web context.
464
464
  * If no context is provided switches to the first detected web context
@@ -2761,6 +2761,21 @@ declare namespace CodeceptJS {
2761
2761
  * * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
2762
2762
  * * `keepTraceForPassedTests`: - save trace for passed tests
2763
2763
  *
2764
+ * #### HAR Recording Customization
2765
+ *
2766
+ * A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded.
2767
+ * It contains information about the request and response headers, cookies, content, timings, and more. You can use HAR files to mock network requests in your tests.
2768
+ * HAR will be saved to `output/har`. More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har.
2769
+ *
2770
+ * ```
2771
+ * ...
2772
+ * recordHar: {
2773
+ * mode: 'minimal', // possible values: 'minimal'|'full'.
2774
+ * content: 'embed' // possible values: "omit"|"embed"|"attach".
2775
+ * }
2776
+ * ...
2777
+ * ```
2778
+ *
2764
2779
  * #### Example #1: Wait for 0 network connections.
2765
2780
  *
2766
2781
  * ```js
@@ -3135,6 +3150,21 @@ declare namespace CodeceptJS {
3135
3150
  * ```
3136
3151
  */
3137
3152
  refreshPage(): Promise<any>;
3153
+ /**
3154
+ * Replaying from HAR
3155
+ *
3156
+ * ```js
3157
+ * // Replay API requests from HAR.
3158
+ * // Either use a matching response from the HAR,
3159
+ * // or abort the request if nothing matches.
3160
+ * I.replayFromHar('./output/har/something.har', { url: "*\/**\/api/v1/fruits" });
3161
+ * I.amOnPage('https://demo.playwright.dev/api-mocking');
3162
+ * I.see('CodeceptJS');
3163
+ * ```
3164
+ * @param harFilePath - Path to recorded HAR file
3165
+ * @param [opts] - [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har)
3166
+ */
3167
+ replayFromHar(harFilePath: string, opts?: any): Promise<any>;
3138
3168
  /**
3139
3169
  * Scroll page to the top.
3140
3170
  *
@@ -458,7 +458,7 @@ declare namespace CodeceptJS {
458
458
  * Switch to the specified context.
459
459
  * @param context - the context to switch to
460
460
  */
461
- _switchToContext(context: any): void;
461
+ switchToContext(context: any): void;
462
462
  /**
463
463
  * Switches to web context.
464
464
  * If no context is provided switches to the first detected web context
@@ -2848,6 +2848,7 @@ declare namespace CodeceptJS {
2848
2848
  * @property [ignoreHTTPSErrors] - Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
2849
2849
  * @property [bypassCSP] - bypass Content Security Policy or CSP
2850
2850
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
2851
+ * @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
2851
2852
  */
2852
2853
  type PlaywrightConfig = {
2853
2854
  url?: string;
@@ -2884,6 +2885,7 @@ declare namespace CodeceptJS {
2884
2885
  ignoreHTTPSErrors?: boolean;
2885
2886
  bypassCSP?: boolean;
2886
2887
  highlightElement?: boolean;
2888
+ recordHar?: any;
2887
2889
  };
2888
2890
  /**
2889
2891
  * Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
@@ -2929,6 +2931,21 @@ declare namespace CodeceptJS {
2929
2931
  * * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
2930
2932
  * * `keepTraceForPassedTests`: - save trace for passed tests
2931
2933
  *
2934
+ * #### HAR Recording Customization
2935
+ *
2936
+ * A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded.
2937
+ * It contains information about the request and response headers, cookies, content, timings, and more. You can use HAR files to mock network requests in your tests.
2938
+ * HAR will be saved to `output/har`. More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har.
2939
+ *
2940
+ * ```
2941
+ * ...
2942
+ * recordHar: {
2943
+ * mode: 'minimal', // possible values: 'minimal'|'full'.
2944
+ * content: 'embed' // possible values: "omit"|"embed"|"attach".
2945
+ * }
2946
+ * ...
2947
+ * ```
2948
+ *
2932
2949
  * #### Example #1: Wait for 0 network connections.
2933
2950
  *
2934
2951
  * ```js
@@ -3324,6 +3341,22 @@ declare namespace CodeceptJS {
3324
3341
  * @returns automatically synchronized promise through #recorder
3325
3342
  */
3326
3343
  refreshPage(): void;
3344
+ /**
3345
+ * Replaying from HAR
3346
+ *
3347
+ * ```js
3348
+ * // Replay API requests from HAR.
3349
+ * // Either use a matching response from the HAR,
3350
+ * // or abort the request if nothing matches.
3351
+ * I.replayFromHar('./output/har/something.har', { url: "*\/**\/api/v1/fruits" });
3352
+ * I.amOnPage('https://demo.playwright.dev/api-mocking');
3353
+ * I.see('CodeceptJS');
3354
+ * ```
3355
+ * @param harFilePath - Path to recorded HAR file
3356
+ * @param [opts] - [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har)
3357
+ * @returns Promise<void>
3358
+ */
3359
+ replayFromHar(harFilePath: string, opts?: any): any;
3327
3360
  /**
3328
3361
  * Scroll page to the top.
3329
3362
  *