@applitools/eyes-playwright 1.36.4 → 1.37.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/CHANGELOG.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.37.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.36.5...js/eyes-playwright@1.37.0) (2025-03-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * allow fully to be sent from the configuration object ([#2867](https://github.com/Applitools-Dev/sdk/issues/2867)) ([e8e7fbc](https://github.com/Applitools-Dev/sdk/commit/e8e7fbcb545e9bab899691d8d136b69f4a67e0d8))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/utils bumped to 1.8.0
14
+ #### Features
15
+
16
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
17
+ * @applitools/dom-snapshot bumped to 4.11.17
18
+ #### Bug Fixes
19
+
20
+ * input range value render issue - add input range to need map list ([#2866](https://github.com/Applitools-Dev/sdk/issues/2866)) ([6b3c113](https://github.com/Applitools-Dev/sdk/commit/6b3c113ab3068fc89b3d3917a12fc51bad66ca97))
21
+
22
+
23
+
24
+ * @applitools/socket bumped to 1.2.3
25
+
26
+ * @applitools/driver bumped to 1.21.0
27
+ #### Features
28
+
29
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
30
+
31
+
32
+
33
+ * @applitools/spec-driver-playwright bumped to 1.5.9
34
+
35
+ * @applitools/screenshoter bumped to 3.11.0
36
+ #### Features
37
+
38
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
39
+
40
+
41
+
42
+ * @applitools/req bumped to 1.7.9
43
+
44
+ * @applitools/image bumped to 1.1.18
45
+
46
+ * @applitools/nml-client bumped to 1.8.27
47
+
48
+ * @applitools/ufg-client bumped to 1.16.8
49
+
50
+ * @applitools/core-base bumped to 1.22.3
51
+ #### Bug Fixes
52
+
53
+ * reject openCheckAndClose on request failures ([#2870](https://github.com/Applitools-Dev/sdk/issues/2870)) ([1d12d60](https://github.com/Applitools-Dev/sdk/commit/1d12d60991e8f222002273d5447702158f1cba84))
54
+
55
+
56
+
57
+ * @applitools/core bumped to 4.34.0
58
+ #### Features
59
+
60
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
61
+ * offline results state granularity ([#2872](https://github.com/Applitools-Dev/sdk/issues/2872)) ([c5f6e4e](https://github.com/Applitools-Dev/sdk/commit/c5f6e4ed87c4855704ce1a6c568393a35b677c1d))
62
+
63
+
64
+ #### Bug Fixes
65
+
66
+ * reject openCheckAndClose on request failures ([#2870](https://github.com/Applitools-Dev/sdk/issues/2870)) ([1d12d60](https://github.com/Applitools-Dev/sdk/commit/1d12d60991e8f222002273d5447702158f1cba84))
67
+
68
+
69
+
70
+ * @applitools/logger bumped to 2.1.2
71
+
72
+ * @applitools/dom-capture bumped to 11.5.5
73
+
74
+ * @applitools/spec-driver-webdriver bumped to 1.2.1
75
+
76
+ * @applitools/spec-driver-selenium bumped to 1.5.97
77
+
78
+ * @applitools/spec-driver-puppeteer bumped to 1.4.26
79
+
80
+ * @applitools/tunnel-client bumped to 1.6.4
81
+
82
+ * @applitools/ec-client bumped to 1.10.7
83
+
84
+ * @applitools/eyes bumped to 1.33.0
85
+ #### Features
86
+
87
+ * allow fully to be sent from the configuration object ([#2867](https://github.com/Applitools-Dev/sdk/issues/2867)) ([e8e7fbc](https://github.com/Applitools-Dev/sdk/commit/e8e7fbcb545e9bab899691d8d136b69f4a67e0d8))
88
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
89
+ * offline results state granularity ([#2872](https://github.com/Applitools-Dev/sdk/issues/2872)) ([c5f6e4e](https://github.com/Applitools-Dev/sdk/commit/c5f6e4ed87c4855704ce1a6c568393a35b677c1d))
90
+
91
+
92
+
93
+
94
+ ## [1.36.5](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.36.4...js/eyes-playwright@1.36.5) (2025-03-13)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * playwright 1.50 report failing due to a new attachments step ([#2840](https://github.com/Applitools-Dev/sdk/issues/2840)) ([07a466f](https://github.com/Applitools-Dev/sdk/commit/07a466f1ddd42eb5b50ac2e19ae7e79d9dae4701))
100
+ * playwright bad import of configuration ([#2837](https://github.com/Applitools-Dev/sdk/issues/2837)) ([cec8dee](https://github.com/Applitools-Dev/sdk/commit/cec8deed06788029baf63f156c5d84002d7168fb))
101
+
102
+
103
+ ### Dependencies
104
+
105
+ * @applitools/spec-driver-webdriver bumped to 1.2.0
106
+ #### Features
107
+
108
+ * support HTTPS_PROXY and HTTP_PROXY environment variables ([#2795](https://github.com/Applitools-Dev/sdk/issues/2795)) ([226ae08](https://github.com/Applitools-Dev/sdk/commit/226ae08627381a1212df8b938c6576e82c777914))
109
+ * @applitools/core bumped to 4.33.0
110
+ #### Features
111
+
112
+ * support HTTPS_PROXY and HTTP_PROXY environment variables ([#2795](https://github.com/Applitools-Dev/sdk/issues/2795)) ([226ae08](https://github.com/Applitools-Dev/sdk/commit/226ae08627381a1212df8b938c6576e82c777914))
113
+
114
+
115
+
116
+ * @applitools/screenshoter bumped to 3.10.7
117
+
118
+ * @applitools/nml-client bumped to 1.8.26
119
+
120
+ * @applitools/ec-client bumped to 1.10.6
121
+
122
+ * @applitools/eyes bumped to 1.32.7
123
+
124
+
3
125
  ## [1.36.4](https://github.com/Applitools-Dev/sdk/compare/js/eyes-playwright@1.36.3...js/eyes-playwright@1.36.4) (2025-03-06)
4
126
 
5
127
 
@@ -6,12 +6,14 @@ const index_1 = require("../index");
6
6
  const eyesConfiguration_1 = require("./defaults/eyesConfiguration");
7
7
  const url_1 = require("url");
8
8
  async function getEyes({ testInfo, eyesConfig, eyesRunner, page, }) {
9
- var _a, _b, _c, _d;
9
+ var _a, _b, _c, _d, _e;
10
10
  if (page.__eyes) {
11
11
  return page.__eyes;
12
12
  }
13
13
  const { configFile } = testInfo.config;
14
- const playwrightConfig = (_b = (_a = ((configFile ? await import((0, url_1.pathToFileURL)(configFile).href) : {}))) === null || _a === void 0 ? void 0 : _a.use) === null || _b === void 0 ? void 0 : _b.eyesConfig;
14
+ const playwrightConfigModule = configFile ? await import((0, url_1.pathToFileURL)(configFile).href) : {};
15
+ const playwrightConfig = ((_a = playwrightConfigModule === null || playwrightConfigModule === void 0 ? void 0 : playwrightConfigModule.use) === null || _a === void 0 ? void 0 : _a.eyesConfig) ||
16
+ ((_c = (_b = playwrightConfigModule === null || playwrightConfigModule === void 0 ? void 0 : playwrightConfigModule.default) === null || _b === void 0 ? void 0 : _b.use) === null || _c === void 0 ? void 0 : _c.eyesConfig);
15
17
  const projectConfig = testInfo.project.use.eyesConfig;
16
18
  const configuration = (0, eyesConfiguration_1.getFinalEyesConfiguration)({
17
19
  playwrightConfig,
@@ -30,7 +32,7 @@ async function getEyes({ testInfo, eyesConfig, eyesRunner, page, }) {
30
32
  dontCloseBatches: true,
31
33
  ...configuration,
32
34
  });
33
- addLogHandlers(eyes, (_d = (_c = eyesConfig.logConfig) !== null && _c !== void 0 ? _c : projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.logConfig) !== null && _d !== void 0 ? _d : playwrightConfig === null || playwrightConfig === void 0 ? void 0 : playwrightConfig.logConfig, testInfo);
35
+ addLogHandlers(eyes, (_e = (_d = eyesConfig.logConfig) !== null && _d !== void 0 ? _d : projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.logConfig) !== null && _e !== void 0 ? _e : playwrightConfig === null || playwrightConfig === void 0 ? void 0 : playwrightConfig.logConfig, testInfo);
34
36
  eyes.open = makeStep('eyes.open', eyes.open.bind(eyes));
35
37
  eyes.check = makeStep('eyes.check', eyes.check.bind(eyes));
36
38
  eyes.close = makeStep('eyes.close', eyes.close.bind(eyes));
@@ -55,9 +55,16 @@ class EyesReporter extends HtmlReporter {
55
55
  if (index > -1) {
56
56
  const internalId = result.attachments[index].body.toString();
57
57
  this.internalIds.push(internalId);
58
- result.attachments.splice(index, 1);
58
+ this.removeInternalIdAttachment(result);
59
59
  }
60
60
  }
61
+ removeInternalIdAttachment(result) {
62
+ var _a;
63
+ const index = result.attachments ? result.attachments.findIndex(a => a.name === 'internalId') : -1;
64
+ if (index > -1)
65
+ (_a = result.attachments) === null || _a === void 0 ? void 0 : _a.splice(index, 1);
66
+ result.steps.forEach(step => this.removeInternalIdAttachment(step));
67
+ }
61
68
  async onEnd(result) {
62
69
  await super.onEnd(result);
63
70
  const testResultsMap = {};
@@ -6,7 +6,7 @@ const index_1 = require("./index");
6
6
  const getEyes_1 = require("./getEyes");
7
7
  exports.expect = test_1.expect.extend({
8
8
  async toHaveScreenshot(pageOrLocator, nameOrOptions = {}, optOptions = {}) {
9
- var _a, _b, _c, _d, _e;
9
+ var _a, _b, _c, _d, _e, _f;
10
10
  const testInfo = index_1.test.info();
11
11
  if (!testInfo) {
12
12
  throw new Error(`toHaveScreenshot() must be called during the test`);
@@ -127,7 +127,7 @@ exports.expect = test_1.expect.extend({
127
127
  ? nameOrOptions.name
128
128
  : undefined,
129
129
  region: locator !== null && locator !== void 0 ? locator : options.clip,
130
- fully: options.fullPage,
130
+ fully: (_f = options.fullPage) !== null && _f !== void 0 ? _f : configuration.fully,
131
131
  ignoreRegions: options.mask,
132
132
  });
133
133
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-playwright",
3
- "version": "1.36.4",
3
+ "version": "1.37.0",
4
4
  "description": "Applitools Eyes SDK for Playwright",
5
5
  "keywords": [
6
6
  "eyes-playwright",
@@ -51,17 +51,17 @@
51
51
  "build:report": "rollup --config src/fixture/build/rollup.config.ts --configPlugin typescript && cp src/fixture/reporterStyle.css dist/fixture && cp -R src/fixture/images dist/fixture",
52
52
  "build:cli": "cp -R src/fixture/example dist/fixture",
53
53
  "generate:tests": "NODE_OPTIONS='--experimental-import-meta-resolve --experimental-loader=@applitools/generic/dist/code-loader.js' generic ./test/generic/config.mjs",
54
- "test": "APPLITOOLS_SHOW_LOGS=true APPLITOOLS_LOG_FILE=\"./logs/$(uuidgen).log\" APPLITOOLS_BATCH_NAME='JS Tests: eyes-playwright' APPLITOOLS_BATCH_ID=$(uuidgen) run --top-level mocha './**/*.spec.{js,ts}' --parallel --jobs ${MOCHA_JOBS:-15} --exit",
55
- "test:coverage": "APPLITOOLS_SHOW_LOGS=true APPLITOOLS_LOG_FILE=\"./logs/$(uuidgen).log\" APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-playwright' APPLITOOLS_BATCH_ID=$(uuidgen) MOCHA_GROUP=coverage run --top-level mocha './test/generated-coverage/*.spec.js' --parallel --jobs ${MOCHA_JOBS:-15} --exit",
54
+ "test": "APPLITOOLS_SHOW_LOGS=true APPLITOOLS_LOG_FILE=\"./logs/$(uuidgen).log\" APPLITOOLS_BATCH_NAME='JS Tests: eyes-playwright' APPLITOOLS_BATCH_ID=$(uuidgen) run --top-level mocha './test/*.spec.{js,ts}' --exit",
55
+ "test:coverage": "APPLITOOLS_SHOW_LOGS=true APPLITOOLS_LOG_FILE=\"./logs/$(uuidgen).log\" APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-playwright' APPLITOOLS_BATCH_ID=$(uuidgen) MOCHA_GROUP=coverage run --top-level mocha './test/generated-coverage/*.spec.js' --parallel --jobs ${MOCHA_JOBS:-8} --exit",
56
56
  "test:fixture": "APPLITOOLS_SHOW_LOGS=true APPLITOOLS_LOG_FILE=\"./logs/$(npx uuid).log\" APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-playwright-fixture' APPLITOOLS_BATCH_ID=$(npx uuid) run playwright test",
57
57
  "setup": "run playwright:setup",
58
58
  "playwright:setup": "yarn playwright install --with-deps chromium firefox webkit",
59
59
  "up:framework": "echo \"$(jq '.devDependencies.playwright = $ENV.APPLITOOLS_FRAMEWORK_VERSION' ./package.json)\" > ./package.json"
60
60
  },
61
61
  "dependencies": {
62
- "@applitools/eyes": "1.32.6",
63
- "@applitools/spec-driver-playwright": "1.5.8",
64
- "@applitools/utils": "1.7.8",
62
+ "@applitools/eyes": "1.33.0",
63
+ "@applitools/spec-driver-playwright": "1.5.9",
64
+ "@applitools/utils": "1.8.0",
65
65
  "@inquirer/prompts": "7.0.1",
66
66
  "chalk": "4.1.2",
67
67
  "yargs": "17.7.2"
package/types/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export type SpecType = {
8
8
  element: Element;
9
9
  selector: Selector;
10
10
  secondary: never;
11
+ userFunction: unknown;
11
12
  };
12
13
  export class Eyes {
13
14
  static setViewportSize: (driver: Driver, viewportSize: RectangleSize) => Promise<void>;
@@ -273,7 +274,7 @@ export type CheckSettingsAutomationPlain = {
273
274
  useSystemScreenshot?: undefined | boolean;
274
275
  hooks?: undefined | { beforeCaptureScreenshot: string; };
275
276
  timeout?: undefined | number;
276
- waitBeforeCapture?: undefined | number;
277
+ waitBeforeCapture?: undefined | number | (() => Promise<void>);
277
278
  lazyLoad?: undefined | boolean | { scrollLength?: undefined | number; waitingTime?: undefined | number; maxAmountToScroll?: undefined | number; };
278
279
  };
279
280
  export class CheckSettingsAutomation {
@@ -309,6 +310,7 @@ export class CheckSettingsAutomation {
309
310
  useSystemScreenshot(useSystemScreenshot?: undefined | boolean): CheckSettingsAutomation;
310
311
  timeout(timeout: number): CheckSettingsAutomation;
311
312
  waitBeforeCapture(waitBeforeCapture: number): CheckSettingsAutomation;
313
+ waitBeforeCapture(waitBeforeCapture: (() => Promise<void>)): CheckSettingsAutomation;
312
314
  lazyLoad(options?: undefined | boolean): CheckSettingsAutomation;
313
315
  lazyLoad(options?: undefined | { scrollLength?: undefined | number; waitingTime?: undefined | number; maxAmountToScroll?: undefined | number; }): CheckSettingsAutomation;
314
316
  densityMetrics(options: { scaleRatio?: undefined | number; xdpi?: undefined | number; ydpi?: undefined | number; }): CheckSettingsAutomation;
@@ -483,6 +485,7 @@ export type ConfigurationPlain = {
483
485
  enablePatterns?: undefined | boolean;
484
486
  environmentName?: undefined | string;
485
487
  forceFullPageScreenshot?: undefined | boolean;
488
+ fully?: undefined | boolean;
486
489
  gitMergeBaseTimestamp?: undefined | string;
487
490
  latestCommitInfo?: undefined | { timestamp: string; sha: string; };
488
491
  hideCaret?: undefined | boolean;
@@ -519,7 +522,7 @@ export type ConfigurationPlain = {
519
522
  useDom?: undefined | boolean;
520
523
  viewportSize?: undefined | RectangleSizePlain;
521
524
  visualGridOptions?: undefined | Record<string, any>;
522
- waitBeforeCapture?: undefined | number;
525
+ waitBeforeCapture?: undefined | number | (() => Promise<void>);
523
526
  waitBeforeScreenshots?: undefined | number;
524
527
  };
525
528
  export class Configuration implements Required<ConfigurationPlain> {
@@ -809,14 +812,19 @@ export class Configuration implements Required<ConfigurationPlain> {
809
812
  getVisualGridOptions(): { [key: string]: any; };
810
813
  setVisualGridOptions(visualGridOptions: { [key: string]: any; }): Configuration;
811
814
  setVisualGridOption(key: string, value: any): Configuration;
812
- get waitBeforeCapture(): number;
813
- set waitBeforeCapture(waitBeforeCapture: number);
814
- getWaitBeforeCapture(): number;
815
+ get waitBeforeCapture(): number | (() => Promise<void>);
816
+ set waitBeforeCapture(waitBeforeCapture: number | (() => Promise<void>));
817
+ getWaitBeforeCapture(): number | (() => Promise<void>);
815
818
  setWaitBeforeCapture(waitBeforeCapture: number): Configuration;
819
+ setWaitBeforeCapture(waitBeforeCapture: (() => Promise<void>)): Configuration;
816
820
  get waitBeforeScreenshots(): number;
817
821
  set waitBeforeScreenshots(waitBeforeScreenshots: number);
818
822
  getWaitBeforeScreenshots(): number;
819
823
  setWaitBeforeScreenshots(waitBeforeScreenshots: number): Configuration;
824
+ get fully(): boolean;
825
+ set fully(fully: boolean);
826
+ getFully(): boolean;
827
+ setFully(fully: boolean): Configuration;
820
828
  }
821
829
  export class BatchClose {
822
830
  static close(settings: { batchIds: Array<string>; serverUrl: string; apiKey: string; proxy?: undefined | ProxySettingsPlain; }): Promise<void>;