@applitools/core 2.5.2 → 2.5.4

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
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.5.4 - 2023/4/25
6
+
7
+ ### Features
8
+ ### Bug fixes
9
+ - Fixed issue with hanging requests
10
+
11
+ ## 2.5.3 - 2023/4/20
12
+
13
+ ### Features
14
+ - Add a timeout and max concurrency for fetching resources
15
+ ### Bug fixes
16
+ - Fixed typo in ec custom property
17
+
5
18
  ## 2.5.2 - 2023/4/19
6
19
 
7
20
  ### Features
@@ -40,7 +40,10 @@ function makeMakeManager({ spec, concurrency: defaultConcurrency = utils.general
40
40
  (_c = (_f = settings.batch).id) !== null && _c !== void 0 ? _c : (_f.id = (_d = utils.general.getEnvValue('BATCH_ID')) !== null && _d !== void 0 ? _d : `generated-${utils.general.guid()}`);
41
41
  (_e = settings.agentId) !== null && _e !== void 0 ? _e : (settings.agentId = type === 'ufg' ? defaultAgentId === null || defaultAgentId === void 0 ? void 0 : defaultAgentId.replace(/(\/\d)/, '.visualgrid$1') : defaultAgentId);
42
42
  base !== null && base !== void 0 ? base : (base = (0, core_base_1.makeCore)({ agentId: settings.agentId, concurrency: settings.concurrency, cwd, logger }));
43
- const cores = { ufg: (0, core_2.makeCore)({ spec, base, logger }), classic: (0, core_1.makeCore)({ spec, base, logger }) };
43
+ const cores = {
44
+ ufg: (0, core_2.makeCore)({ spec, base, fetchConcurrency: settings.fetchConcurrency, logger }),
45
+ classic: (0, core_1.makeCore)({ spec, base, logger }),
46
+ };
44
47
  const storage = [];
45
48
  return {
46
49
  openEyes: utils.general.wrap((0, open_eyes_1.makeOpenEyes)({ type, batch: settings.batch, spec, core, cores, logger }), async (openEyes, options) => {
package/dist/open-eyes.js CHANGED
@@ -61,7 +61,7 @@ function makeOpenEyes({ type: defaultType = 'classic', concurrency, batch, core,
61
61
  if (account.ecEnabled) {
62
62
  const environment = await (driver === null || driver === void 0 ? void 0 : driver.getEnvironment());
63
63
  (_r = settings.properties) !== null && _r !== void 0 ? _r : (settings.properties = []);
64
- settings.properties.push({ name: 'Execution cloud', value: (environment === null || environment === void 0 ? void 0 : environment.isEC) ? 'Yes' : 'No' });
64
+ settings.properties.push({ name: 'Execution Cloud', value: (environment === null || environment === void 0 ? void 0 : environment.isEC) ? 'Yes' : 'No' });
65
65
  }
66
66
  core.logEvent({
67
67
  settings: {
package/dist/ufg/core.js CHANGED
@@ -35,7 +35,7 @@ const get_ufg_client_1 = require("./get-ufg-client");
35
35
  const get_nml_client_1 = require("./get-nml-client");
36
36
  const open_eyes_1 = require("./open-eyes");
37
37
  const utils = __importStar(require("@applitools/utils"));
38
- function makeCore({ concurrency, spec, clients, base, agentId = 'core-ufg', cwd = process.cwd(), logger: defaultLogger, }) {
38
+ function makeCore({ concurrency, spec, clients, base, fetchConcurrency, agentId = 'core-ufg', cwd = process.cwd(), logger: defaultLogger, }) {
39
39
  var _a;
40
40
  const logger = (_a = defaultLogger === null || defaultLogger === void 0 ? void 0 : defaultLogger.extend({ label: 'core-ufg' })) !== null && _a !== void 0 ? _a : (0, logger_1.makeLogger)({ label: 'core-ufg' });
41
41
  logger.log(`Core ufg is initialized ${base ? 'with' : 'without'} custom base core`);
@@ -49,7 +49,7 @@ function makeCore({ concurrency, spec, clients, base, agentId = 'core-ufg', cwd
49
49
  locate: (0, locate_1.makeLocate)({ spec, core, logger }),
50
50
  locateText: (0, locate_text_1.makeLocateText)({ spec, core, logger }),
51
51
  extractText: (0, extract_text_1.makeExtractText)({ spec, core, logger }),
52
- getUFGClient: (0, get_ufg_client_1.makeGetUFGClient)({ client: clients === null || clients === void 0 ? void 0 : clients.ufg, logger }),
52
+ getUFGClient: (0, get_ufg_client_1.makeGetUFGClient)({ client: clients === null || clients === void 0 ? void 0 : clients.ufg, fetchConcurrency, logger }),
53
53
  getNMLClient: (0, get_nml_client_1.makeGetNMLClient)({ client: clients === null || clients === void 0 ? void 0 : clients.nml, logger }),
54
54
  openEyes: (0, open_eyes_1.makeOpenEyes)({ spec, core, logger }),
55
55
  };
@@ -26,13 +26,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.makeGetUFGClient = void 0;
27
27
  const ufg_client_1 = require("@applitools/ufg-client");
28
28
  const utils = __importStar(require("@applitools/utils"));
29
- function makeGetUFGClient({ client, logger: defaultLogger }) {
30
- const getUFGClientWithCache = utils.general.cachify(getUFGClient, ([options]) => client ? 'default' : [options.config]);
29
+ function makeGetUFGClient({ client, fetchConcurrency, logger: defaultLogger }) {
30
+ // we are caching by the server config, therefor if the user creates another Runner / manager with the same server config but different
31
+ // fetchConcurrency, it will not take any affect.
32
+ const getUFGClientWithCache = utils.general.cachify(getUFGClient, ([options]) => client ? 'default' : [{ ...options.config, fetchConcurrency: undefined }]);
31
33
  if (client)
32
34
  getUFGClientWithCache.setCachedValue('default', Promise.resolve(client));
33
35
  return getUFGClientWithCache;
34
36
  async function getUFGClient({ config, logger = defaultLogger }) {
35
- return (0, ufg_client_1.makeUFGClient)({ config, logger });
37
+ return (0, ufg_client_1.makeUFGClient)({ config: { ...config, fetchConcurrency }, logger });
36
38
  }
37
39
  }
38
40
  exports.makeGetUFGClient = makeGetUFGClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -75,20 +75,20 @@
75
75
  ]
76
76
  },
77
77
  "dependencies": {
78
- "@applitools/core-base": "1.1.49",
78
+ "@applitools/core-base": "1.1.52",
79
79
  "@applitools/dom-capture": "11.2.1",
80
80
  "@applitools/dom-snapshot": "4.7.9",
81
- "@applitools/driver": "1.11.43",
82
- "@applitools/ec-client": "1.2.23",
83
- "@applitools/logger": "1.1.48",
84
- "@applitools/nml-client": "1.3.47",
85
- "@applitools/req": "1.1.35",
86
- "@applitools/screenshoter": "3.7.38",
81
+ "@applitools/driver": "1.11.46",
82
+ "@applitools/ec-client": "1.2.24",
83
+ "@applitools/logger": "1.1.52",
84
+ "@applitools/nml-client": "1.3.49",
85
+ "@applitools/req": "1.2.2",
86
+ "@applitools/screenshoter": "3.7.39",
87
87
  "@applitools/snippets": "2.4.19",
88
- "@applitools/socket": "1.0.10",
89
- "@applitools/spec-driver-webdriver": "1.0.24",
90
- "@applitools/ufg-client": "1.2.9",
91
- "@applitools/utils": "1.3.32",
88
+ "@applitools/socket": "1.0.13",
89
+ "@applitools/spec-driver-webdriver": "1.0.26",
90
+ "@applitools/ufg-client": "1.2.11",
91
+ "@applitools/utils": "1.3.35",
92
92
  "@types/ws": "8.5.4",
93
93
  "abort-controller": "3.0.0",
94
94
  "chalk": "4.1.2",
@@ -100,10 +100,10 @@
100
100
  "devDependencies": {
101
101
  "@applitools/bongo": "^3.0.3",
102
102
  "@applitools/sdk-coverage-tests": "^3.0.2",
103
- "@applitools/spec-driver-puppeteer": "^1.1.55",
104
- "@applitools/spec-driver-selenium": "^1.5.40",
105
- "@applitools/spec-driver-webdriverio": "^1.4.39",
106
- "@applitools/test-server": "^1.1.28",
103
+ "@applitools/spec-driver-puppeteer": "^1.1.57",
104
+ "@applitools/spec-driver-selenium": "^1.5.41",
105
+ "@applitools/spec-driver-webdriverio": "^1.4.41",
106
+ "@applitools/test-server": "^1.1.31",
107
107
  "@applitools/test-utils": "^1.5.16",
108
108
  "@types/node": "^12.20.55",
109
109
  "@types/selenium-webdriver": "^4.1.2",
package/types/types.d.ts CHANGED
@@ -99,6 +99,7 @@ export interface Eyes<TSpec extends SpecType, TDefaultType extends 'classic' | '
99
99
  }
100
100
  export interface ManagerSettings {
101
101
  concurrency?: number;
102
+ fetchConcurrency?: number;
102
103
  /** @deprecated */
103
104
  legacyConcurrency?: number;
104
105
  agentId?: string;
@@ -13,8 +13,9 @@ type Options<TSpec extends SpecType> = {
13
13
  base?: BaseCore;
14
14
  agentId?: string;
15
15
  concurrency?: number;
16
+ fetchConcurrency?: number;
16
17
  cwd?: string;
17
18
  logger?: Logger;
18
19
  };
19
- export declare function makeCore<TSpec extends SpecType>({ concurrency, spec, clients, base, agentId, cwd, logger: defaultLogger, }: Options<TSpec>): Core<TSpec>;
20
+ export declare function makeCore<TSpec extends SpecType>({ concurrency, spec, clients, base, fetchConcurrency, agentId, cwd, logger: defaultLogger, }: Options<TSpec>): Core<TSpec>;
20
21
  export {};
@@ -1,11 +1,12 @@
1
1
  import { type Logger } from '@applitools/logger';
2
- import { type UFGClient, type UFGRequestsConfig } from '@applitools/ufg-client';
2
+ import { type UFGClient, type UFGClientConfig } from '@applitools/ufg-client';
3
3
  type Options = {
4
4
  client?: UFGClient;
5
5
  logger: Logger;
6
+ fetchConcurrency?: number;
6
7
  };
7
- export declare function makeGetUFGClient({ client, logger: defaultLogger }: Options): (({ config, logger }: {
8
- config: UFGRequestsConfig;
8
+ export declare function makeGetUFGClient({ client, fetchConcurrency, logger: defaultLogger }: Options): (({ config, logger }: {
9
+ config: UFGClientConfig;
9
10
  logger?: Logger | undefined;
10
11
  }) => Promise<UFGClient>) & {
11
12
  getCachedValues(): Promise<UFGClient>[];
@@ -8,8 +8,8 @@ export declare function generateSafeSelectors<TSpec extends SpecType>({ context,
8
8
  originalSelector: null;
9
9
  elementReference: ElementReference<TSpec>;
10
10
  } | {
11
- safeSelector: CommonSelector<never>;
12
- originalSelector: CommonSelector<never> | null;
11
+ safeSelector: CommonSelector;
12
+ originalSelector: CommonSelector | null;
13
13
  elementReference: ElementReference<TSpec>;
14
14
  })[];
15
15
  cleanupGeneratedSelectors: () => Promise<void>;