@applitools/core 2.3.4 → 2.3.6

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,20 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.3.6 - 2023/2/17
6
+
7
+ ### Features
8
+ ### Bug fixes
9
+ - Update some type declarations
10
+
11
+ ## 2.3.5 - 2023/2/17
12
+
13
+ ### Features
14
+ - Improve logging in core server
15
+ ### Bug fixes
16
+ - Fixed issue when core server was hanging if any command was called immediately after `Core.makeCore` command
17
+ - Fixed issue when `StaticDriver` and `StaticElement` were not recognized as a valid driver or element objects
18
+
5
19
  ## 2.3.4 - 2023/2/16
6
20
 
7
21
  ### Features
@@ -19,11 +19,18 @@ printStdout = false, ...handlerOptions } = {}) {
19
19
  var _a, _b;
20
20
  const logDirname = (_a = process.env.APPLITOOLS_LOG_DIR) !== null && _a !== void 0 ? _a : path_1.default.resolve(os_1.default.tmpdir(), `applitools-logs`);
21
21
  const baseLogger = (0, logger_1.makeLogger)({
22
- handler: { type: 'rolling file', name: 'eyes', dirname: logDirname },
23
- label: 'eyes',
22
+ handler: { type: 'rolling file', name: 'universal', dirname: logDirname },
23
+ label: 'core-universal',
24
24
  level: 'info',
25
25
  colors: false,
26
26
  });
27
+ baseLogger.log('Core universal is going to be initialized with options', {
28
+ debug,
29
+ shutdownMode,
30
+ idleTimeout,
31
+ printStdout,
32
+ ...handlerOptions,
33
+ });
27
34
  const { server, port } = await (0, ws_server_1.makeServer)({ ...handlerOptions, debug });
28
35
  // eslint-disable-next-line no-console
29
36
  console.log(port); // NOTE: this is a part of the generic protocol
@@ -34,7 +41,7 @@ printStdout = false, ...handlerOptions } = {}) {
34
41
  }
35
42
  if (!printStdout)
36
43
  process.stdout.write = () => true; // NOTE: prevent any write to stdout
37
- baseLogger.log('Universal core is initialized on port', port);
44
+ baseLogger.log('Core universal is started on port', port);
38
45
  let idle;
39
46
  let serverClosed = false;
40
47
  if (shutdownMode === 'stdin') {
@@ -76,7 +83,7 @@ printStdout = false, ...handlerOptions } = {}) {
76
83
  },
77
84
  });
78
85
  logger.console.log(`Logs saved in: ${logDirname}`);
79
- const core = await socket.wait('Core.makeCore', ({ agentId, cwd, spec }) => {
86
+ const corePromise = socket.wait('Core.makeCore', ({ agentId, cwd, spec }) => {
80
87
  return (0, core_1.makeCore)({
81
88
  agentId: `eyes-universal/${require('../../package.json').version}/${agentId}`,
82
89
  spec: spec === 'webdriver' ? spec_driver_webdriver_1.default : (0, spec_driver_1.makeSpec)({ socket, spec }),
@@ -85,36 +92,46 @@ printStdout = false, ...handlerOptions } = {}) {
85
92
  });
86
93
  });
87
94
  socket.command('Core.getAccountInfo', async (options) => {
95
+ const core = await corePromise;
88
96
  return core.getAccountInfo(options);
89
97
  });
90
98
  socket.command('Core.getViewportSize', async (options) => {
91
99
  var _a;
100
+ const core = await corePromise;
92
101
  return (_a = core.getViewportSize) === null || _a === void 0 ? void 0 : _a.call(core, options);
93
102
  });
94
103
  socket.command('Core.setViewportSize', async (options) => {
95
104
  var _a;
105
+ const core = await corePromise;
96
106
  return (_a = core.setViewportSize) === null || _a === void 0 ? void 0 : _a.call(core, options);
97
107
  });
98
108
  socket.command('Core.closeBatch', async (options) => {
109
+ const core = await corePromise;
99
110
  return core.closeBatch(options);
100
111
  });
101
112
  socket.command('Core.deleteTest', async (options) => {
113
+ const core = await corePromise;
102
114
  return core.deleteTest(options);
103
115
  });
104
116
  socket.command('Core.locate', async (options) => {
117
+ const core = await corePromise;
105
118
  return core.locate(options);
106
119
  });
107
120
  socket.command('Core.locateText', async (options) => {
121
+ const core = await corePromise;
108
122
  return core.locateText(options);
109
123
  });
110
124
  socket.command('Core.extractText', async (options) => {
125
+ const core = await corePromise;
111
126
  return core.extractText(options);
112
127
  });
113
128
  socket.command('Core.makeECClient', async (options) => {
129
+ const core = await corePromise;
114
130
  const client = await core.makeECClient(options);
115
131
  return { url: client.url };
116
132
  });
117
133
  socket.command('Core.makeManager', async (options) => {
134
+ const core = await corePromise;
118
135
  return refer.ref(await core.makeManager(options));
119
136
  });
120
137
  socket.command('EyesManager.openEyes', async ({ manager, ...options }) => {
@@ -133,6 +150,10 @@ printStdout = false, ...handlerOptions } = {}) {
133
150
  var _a;
134
151
  return (_a = refer.deref(eyes)) === null || _a === void 0 ? void 0 : _a.check(options);
135
152
  });
153
+ socket.command('Eyes.checkAndClose', async ({ eyes, ...options }) => {
154
+ var _a;
155
+ return (_a = refer.deref(eyes)) === null || _a === void 0 ? void 0 : _a.checkAndClose(options);
156
+ });
136
157
  socket.command('Eyes.close', async ({ eyes, ...options }) => {
137
158
  var _a;
138
159
  return (_a = refer.deref(eyes)) === null || _a === void 0 ? void 0 : _a.close(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -76,15 +76,15 @@
76
76
  "@applitools/core-base": "1.1.38",
77
77
  "@applitools/dom-capture": "11.2.1",
78
78
  "@applitools/dom-snapshot": "4.7.3",
79
- "@applitools/driver": "1.11.31",
80
- "@applitools/ec-client": "1.2.9",
79
+ "@applitools/driver": "1.11.32",
80
+ "@applitools/ec-client": "1.2.10",
81
81
  "@applitools/logger": "1.1.46",
82
82
  "@applitools/nml-client": "1.3.35",
83
83
  "@applitools/req": "1.1.30",
84
84
  "@applitools/screenshoter": "3.7.27",
85
85
  "@applitools/snippets": "2.4.15",
86
- "@applitools/socket": "1.0.7",
87
- "@applitools/spec-driver-webdriver": "1.0.10",
86
+ "@applitools/socket": "1.0.8",
87
+ "@applitools/spec-driver-webdriver": "1.0.12",
88
88
  "@applitools/ufg-client": "1.1.26",
89
89
  "@applitools/utils": "1.3.30",
90
90
  "@types/ws": "8.5.4",
@@ -98,9 +98,9 @@
98
98
  },
99
99
  "devDependencies": {
100
100
  "@applitools/bongo": "^2.2.5",
101
- "@applitools/spec-driver-puppeteer": "^1.1.43",
102
- "@applitools/spec-driver-selenium": "^1.5.28",
103
- "@applitools/spec-driver-webdriverio": "^1.4.26",
101
+ "@applitools/spec-driver-puppeteer": "^1.1.44",
102
+ "@applitools/spec-driver-selenium": "^1.5.29",
103
+ "@applitools/spec-driver-webdriverio": "^1.4.27",
104
104
  "@applitools/test-server": "^1.1.26",
105
105
  "@applitools/test-utils": "^1.5.12",
106
106
  "@types/mocha": "^9.1.1",
@@ -9,7 +9,7 @@ export declare function generateSafeSelectors<TSpec extends SpecType>({ context,
9
9
  elementReference: ElementReference<TSpec>;
10
10
  } | {
11
11
  safeSelector: CommonSelector<never>;
12
- originalSelector: import("@applitools/driver").Selector<never> | null;
12
+ originalSelector: CommonSelector<never> | null;
13
13
  elementReference: ElementReference<TSpec>;
14
14
  })[];
15
15
  cleanupGeneratedSelectors: () => Promise<void>;