@gravity-ui/playwright-tools 1.1.1 → 1.1.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.
@@ -14,7 +14,7 @@ const fixtureFunction = async ({ baseURL: rawBaseURL, page, }, { shouldUpdate, f
14
14
  });
15
15
  const update = Boolean(shouldUpdate);
16
16
  const url = urlMatcherBuilder(baseURL);
17
- await (0, har_1.initDumps)(page, testInfo, {
17
+ const finalUpdate = await (0, har_1.initDumps)(page, testInfo, {
18
18
  dumpsFilePath,
19
19
  forceUpdateIfHarMissing,
20
20
  updateTimeout,
@@ -22,7 +22,7 @@ const fixtureFunction = async ({ baseURL: rawBaseURL, page, }, { shouldUpdate, f
22
22
  url,
23
23
  zip,
24
24
  });
25
- await use(!update);
25
+ await use(!finalUpdate);
26
26
  };
27
27
  function mockNetworkFixtureBuilder({ shouldUpdate, forceUpdateIfHarMissing, updateTimeout, zip = true, url, dumpsFilePath, optionallyEnabled, ...harPatcherParams }) {
28
28
  const mockNetworkFixture = async ({ baseURL, page }, use, testInfo) => {
package/har/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { addHarRecorderTransform } from './addHarRecorderTransform';
7
7
  export type { FlushTransformFunction } from './addFlushTransform';
8
8
  export { addFlushTransform } from './addFlushTransform';
9
9
  export { clearHeaders } from './clearHeaders';
10
+ export type { InitDumpsOptions } from './initDumps';
10
11
  export { initDumps } from './initDumps';
11
12
  export { replaceBaseUrlInEntry } from './replaceBaseUrlInEntry';
12
13
  export { setExtraHash } from './setExtraHash';
@@ -49,5 +49,6 @@ export type InitDumpsOptions = {
49
49
  };
50
50
  /**
51
51
  * Makes the necessary preparations for saving query dumps
52
+ * @returns boolean - true if update mode is active, false if mock mode is active
52
53
  */
53
- export declare function initDumps(page: Page, testInfo: TestInfo, { dumpsFilePath: dumpsFilePathBuilder, rootPath, forceUpdateIfHarMissing, updateTimeout, notFound, url, zip, update, }?: InitDumpsOptions): Promise<void>;
54
+ export declare function initDumps(page: Page, testInfo: TestInfo, { dumpsFilePath: dumpsFilePathBuilder, rootPath, forceUpdateIfHarMissing, updateTimeout, notFound, url, zip, update, }?: InitDumpsOptions): Promise<boolean>;
package/har/initDumps.js CHANGED
@@ -6,6 +6,7 @@ const node_path_1 = require("node:path");
6
6
  const dumpsFilePathBulders_1 = require("./dumpsFilePathBulders");
7
7
  /**
8
8
  * Makes the necessary preparations for saving query dumps
9
+ * @returns boolean - true if update mode is active, false if mock mode is active
9
10
  */
10
11
  async function initDumps(page, testInfo, { dumpsFilePath: dumpsFilePathBuilder = dumpsFilePathBulders_1.defaultDumpsFilePathBuilder, rootPath, forceUpdateIfHarMissing = false, updateTimeout, notFound = 'abort', url, zip = true, update = false, } = {}) {
11
12
  let harPath;
@@ -32,4 +33,5 @@ async function initDumps(page, testInfo, { dumpsFilePath: dumpsFilePathBuilder =
32
33
  notFound,
33
34
  url,
34
35
  });
36
+ return update;
35
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/playwright-tools",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Tools for Playwright Test",
5
5
  "keywords": [
6
6
  "playwright",