@applitools/core 3.6.5 → 3.7.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,6 +1,74 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## [3.7.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@3.6.6...js/core@3.7.0) (2023-08-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * allow providing custom headers for resource fetching ([#1852](https://github.com/applitools/eyes.sdk.javascript1/issues/1852)) ([372cb96](https://github.com/applitools/eyes.sdk.javascript1/commit/372cb96b905a0661c36e2fa10a7855208fb55bb0))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/ufg-client bumped to 1.7.0
14
+ #### Features
15
+
16
+ * allow providing custom headers for resource fetching ([#1852](https://github.com/applitools/eyes.sdk.javascript1/issues/1852)) ([372cb96](https://github.com/applitools/eyes.sdk.javascript1/commit/372cb96b905a0661c36e2fa10a7855208fb55bb0))
17
+
18
+ ## [3.6.6](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@3.6.5...js/core@3.6.6) (2023-08-03)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * populate log event settings with env vars ([#1840](https://github.com/applitools/eyes.sdk.javascript1/issues/1840)) ([0a6af60](https://github.com/applitools/eyes.sdk.javascript1/commit/0a6af60b5b988f59b7adb03f6606b3417fbeb537))
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * @applitools/core-base bumped to 1.5.0
29
+ #### Features
30
+
31
+ * add stuck request retries to all requests to UFG and Eyes ([#1826](https://github.com/applitools/eyes.sdk.javascript1/issues/1826)) ([5884d42](https://github.com/applitools/eyes.sdk.javascript1/commit/5884d428b230e3a832a2110a388ebe63a94006fc))
32
+ * mark session as component ([#1841](https://github.com/applitools/eyes.sdk.javascript1/issues/1841)) ([c579bb6](https://github.com/applitools/eyes.sdk.javascript1/commit/c579bb69de8f3bffc64e73ac8bd4fa646e96eb01))
33
+
34
+
35
+ #### Bug Fixes
36
+
37
+ * populate log event settings with env vars ([#1840](https://github.com/applitools/eyes.sdk.javascript1/issues/1840)) ([0a6af60](https://github.com/applitools/eyes.sdk.javascript1/commit/0a6af60b5b988f59b7adb03f6606b3417fbeb537))
38
+ * @applitools/driver bumped to 1.13.4
39
+ #### Bug Fixes
40
+
41
+ * extract device orientation from a browser for web executions ([d8d4e91](https://github.com/applitools/eyes.sdk.javascript1/commit/d8d4e919965fb9105915e762c397ec2cc57a8a71))
42
+
43
+
44
+
45
+ * @applitools/snippets bumped to 2.4.22
46
+ #### Bug Fixes
47
+
48
+ * improve orientation extraction for ios devices ([378d989](https://github.com/applitools/eyes.sdk.javascript1/commit/378d9894e4fbc7247087ccb8c46266dc4737e2e5))
49
+ * @applitools/ufg-client bumped to 1.6.0
50
+ #### Features
51
+
52
+ * add stuck request retries to all requests to UFG and Eyes ([#1826](https://github.com/applitools/eyes.sdk.javascript1/issues/1826)) ([5884d42](https://github.com/applitools/eyes.sdk.javascript1/commit/5884d428b230e3a832a2110a388ebe63a94006fc))
53
+
54
+
55
+ #### Bug Fixes
56
+
57
+ * improve fetch error experience when fetching from tunnel ([e7d8b49](https://github.com/applitools/eyes.sdk.javascript1/commit/e7d8b49947c07beb27f110cb4952e8c3206469af))
58
+ * @applitools/ec-client bumped to 1.7.4
59
+
60
+ * @applitools/spec-driver-webdriver bumped to 1.0.41
61
+
62
+ * @applitools/nml-client bumped to 1.5.6
63
+
64
+ * @applitools/spec-driver-webdriverio bumped to 1.5.10
65
+
66
+ * @applitools/screenshoter bumped to 3.8.7
67
+
68
+ * @applitools/spec-driver-puppeteer bumped to 1.1.72
69
+
70
+ * @applitools/spec-driver-selenium bumped to 1.5.55
71
+
4
72
 
5
73
  ## [3.6.5](https://github.com/applitools/eyes.sdk.javascript1/compare/js/core@3.6.4...js/core@3.6.5) (2023-07-27)
6
74
 
@@ -33,7 +33,7 @@ function makeCloseBatch({ core, logger: mainLogger }) {
33
33
  (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : (settings.eyesServerUrl = (_d = (_c = (_b = settings.serverUrl) !== null && _b !== void 0 ? _b : utils.general.getEnvValue('EYES_SERVER_URL')) !== null && _c !== void 0 ? _c : utils.general.getEnvValue('SERVER_URL')) !== null && _d !== void 0 ? _d : 'https://eyesapi.applitools.com');
34
34
  (_e = settings.apiKey) !== null && _e !== void 0 ? _e : (settings.apiKey = utils.general.getEnvValue('API_KEY'));
35
35
  });
36
- await core.base.closeBatch({ settings, logger });
36
+ return core.base.closeBatch({ settings, logger });
37
37
  };
38
38
  }
39
39
  exports.makeCloseBatch = makeCloseBatch;
@@ -33,7 +33,7 @@ function makeDeleteTest({ core, logger: mainLogger }) {
33
33
  (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : (settings.eyesServerUrl = (_d = (_c = (_b = settings.serverUrl) !== null && _b !== void 0 ? _b : utils.general.getEnvValue('EYES_SERVER_URL')) !== null && _c !== void 0 ? _c : utils.general.getEnvValue('SERVER_URL')) !== null && _d !== void 0 ? _d : 'https://eyesapi.applitools.com');
34
34
  (_e = settings.apiKey) !== null && _e !== void 0 ? _e : (settings.apiKey = utils.general.getEnvValue('API_KEY'));
35
35
  });
36
- await core.base.deleteTest({ settings, logger });
36
+ return core.base.deleteTest({ settings, logger });
37
37
  };
38
38
  }
39
39
  exports.makeDeleteTest = makeDeleteTest;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.makeLogEvent = void 0;
27
+ const utils = __importStar(require("@applitools/utils"));
28
+ function makeLogEvent({ core, logger: mainLogger }) {
29
+ return async function logEvent({ settings, logger = mainLogger, }) {
30
+ logger = logger.extend(mainLogger, { tags: [`log-event-${utils.general.shortid()}`] });
31
+ (utils.types.isArray(settings) ? settings : [settings]).forEach(settings => {
32
+ var _a, _b, _c, _d, _e;
33
+ (_a = settings.eyesServerUrl) !== null && _a !== void 0 ? _a : (settings.eyesServerUrl = (_d = (_c = (_b = settings.serverUrl) !== null && _b !== void 0 ? _b : utils.general.getEnvValue('EYES_SERVER_URL')) !== null && _c !== void 0 ? _c : utils.general.getEnvValue('SERVER_URL')) !== null && _d !== void 0 ? _d : 'https://eyesapi.applitools.com');
34
+ (_e = settings.apiKey) !== null && _e !== void 0 ? _e : (settings.apiKey = utils.general.getEnvValue('API_KEY'));
35
+ });
36
+ return core.base.logEvent({ settings, logger });
37
+ };
38
+ }
39
+ exports.makeLogEvent = makeLogEvent;
@@ -176,11 +176,14 @@ function makeCheckAndClose({ eyes, storage, target: defaultTarget, spec, signal,
176
176
  snapshot,
177
177
  settings: {
178
178
  renderer,
179
- referer: snapshotUrl,
180
179
  cookies,
180
+ headers: {
181
+ Referer: snapshotUrl,
182
+ 'User-Agent': userAgent,
183
+ ...settings.headers,
184
+ },
181
185
  proxy: eyes.test.eyesServer.proxy,
182
186
  autProxy: settings.autProxy,
183
- userAgent,
184
187
  },
185
188
  logger: rendererLogger,
186
189
  });
package/dist/ufg/check.js CHANGED
@@ -177,11 +177,14 @@ function makeCheck({ eyes, storage, target: defaultTarget, spec, signal, logger:
177
177
  snapshot,
178
178
  settings: {
179
179
  renderer,
180
- referer: snapshotUrl,
181
180
  cookies,
181
+ headers: {
182
+ Referer: snapshotUrl,
183
+ 'User-Agent': userAgent,
184
+ ...settings.headers,
185
+ },
182
186
  proxy: eyes.test.eyesServer.proxy,
183
187
  autProxy: settings.autProxy,
184
- userAgent,
185
188
  },
186
189
  logger: rendererLogger,
187
190
  });
@@ -114,6 +114,10 @@ printStdout = false, isProcess = false, ...handlerOptions } = {}) {
114
114
  const core = await corePromise;
115
115
  return core.deleteTest(options);
116
116
  });
117
+ socket.command('Core.logEvent', async ({ settings }) => {
118
+ const core = await corePromise;
119
+ return core.logEvent({ settings });
120
+ });
117
121
  socket.command('Core.locate', async (options) => {
118
122
  const core = await corePromise;
119
123
  return core.locate(options);
@@ -180,10 +184,6 @@ printStdout = false, isProcess = false, ...handlerOptions } = {}) {
180
184
  socket.command('Debug.getHistory', async () => {
181
185
  return getHistory();
182
186
  });
183
- socket.command('Core.logEvent', async ({ settings }) => {
184
- const core = await corePromise;
185
- core.logEvent({ settings });
186
- });
187
187
  });
188
188
  return { port, close: () => server.close() };
189
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "3.6.5",
3
+ "version": "3.7.0",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -68,19 +68,19 @@
68
68
  ]
69
69
  },
70
70
  "dependencies": {
71
- "@applitools/core-base": "1.4.3",
71
+ "@applitools/core-base": "1.5.0",
72
72
  "@applitools/dom-capture": "11.2.2",
73
73
  "@applitools/dom-snapshot": "4.7.10",
74
- "@applitools/driver": "1.13.3",
75
- "@applitools/ec-client": "1.7.3",
74
+ "@applitools/driver": "1.13.4",
75
+ "@applitools/ec-client": "1.7.4",
76
76
  "@applitools/logger": "2.0.7",
77
- "@applitools/nml-client": "1.5.5",
77
+ "@applitools/nml-client": "1.5.6",
78
78
  "@applitools/req": "1.5.2",
79
- "@applitools/screenshoter": "3.8.6",
80
- "@applitools/snippets": "2.4.21",
79
+ "@applitools/screenshoter": "3.8.7",
80
+ "@applitools/snippets": "2.4.22",
81
81
  "@applitools/socket": "1.1.7",
82
- "@applitools/spec-driver-webdriver": "1.0.40",
83
- "@applitools/ufg-client": "1.5.3",
82
+ "@applitools/spec-driver-webdriver": "1.0.41",
83
+ "@applitools/ufg-client": "1.7.0",
84
84
  "@applitools/utils": "1.5.0",
85
85
  "@types/ws": "8.5.5",
86
86
  "abort-controller": "3.0.0",
@@ -91,10 +91,10 @@
91
91
  "yargs": "17.7.2"
92
92
  },
93
93
  "devDependencies": {
94
- "@applitools/bongo": "^5.3.0",
95
- "@applitools/spec-driver-puppeteer": "^1.1.71",
96
- "@applitools/spec-driver-selenium": "^1.5.54",
97
- "@applitools/spec-driver-webdriverio": "^1.5.9",
94
+ "@applitools/bongo": "^5.4.3",
95
+ "@applitools/spec-driver-puppeteer": "^1.1.72",
96
+ "@applitools/spec-driver-selenium": "^1.5.55",
97
+ "@applitools/spec-driver-webdriverio": "^1.5.10",
98
98
  "@applitools/test-server": "^1.2.2",
99
99
  "@applitools/test-utils": "^1.5.17",
100
100
  "@applitools/tunnel-client": "^1.1.3",
@@ -0,0 +1,12 @@
1
+ import type { MaybeArray } from '@applitools/utils';
2
+ import type { Core, LogEventSettings } from './types';
3
+ import { type Logger } from '@applitools/logger';
4
+ type Options = {
5
+ core: Core<any>;
6
+ logger: Logger;
7
+ };
8
+ export declare function makeLogEvent({ core, logger: mainLogger }: Options): ({ settings, logger, }: {
9
+ settings: MaybeArray<LogEventSettings>;
10
+ logger?: Logger | undefined;
11
+ }) => Promise<void>;
12
+ export {};
@@ -35,6 +35,7 @@ export declare function makeCheckAndClose<TSpec extends SpecType>({ eyes, storag
35
35
  mode?: "Allow" | "Block" | undefined;
36
36
  domains?: string[] | undefined;
37
37
  }) | undefined;
38
+ headers?: Record<string, string> | undefined;
38
39
  } & CloseSettings) | undefined;
39
40
  logger?: Logger | undefined;
40
41
  }) => Promise<void>;
@@ -63,6 +63,7 @@ export type CheckSettings<TSpec extends SpecType> = AutomationCore.CheckSettings
63
63
  mode?: 'Allow' | 'Block';
64
64
  domains?: string[];
65
65
  };
66
+ headers?: Record<string, string>;
66
67
  };
67
68
  export type CheckResult = AutomationCore.CheckResult & {
68
69
  readonly renderer: Renderer;