suitest-js-api 3.11.0 → 3.11.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.
- package/index.d.ts +1 -0
- package/lib/api/webSockets.js +16 -0
- package/lib/commands/pairDevice.js +11 -1
- package/lib/commands/startRecording.js +5 -1
- package/lib/texts.js +2 -1
- package/lib/utils/sessionStarter.js +1 -0
- package/lib/validation/elementPropTypes.js +1 -1
- package/package.json +1 -1
- /package/typeDefinition/{RunTestChain.ts → RunTestChain.d.ts} +0 -0
package/index.d.ts
CHANGED
package/lib/api/webSockets.js
CHANGED
|
@@ -16,6 +16,18 @@ const {getInfoErrorMessage} = require('../utils/socketErrorMessages');
|
|
|
16
16
|
const {translateNotStartedReason} = require('../utils/translateResults');
|
|
17
17
|
const logLevels = require('../../lib/constants/logLevels');
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @description print log message that comes from BE side with proper log level
|
|
21
|
+
* @param {import('../../suitest').logger} logger - logger object from SUITEST_API
|
|
22
|
+
* @param {{type: 'log', subtype: 'info' | 'warn' | 'error', data: string[]}} content - BE message
|
|
23
|
+
*/
|
|
24
|
+
const printBackendLogMessage = (logger, content) => {
|
|
25
|
+
const loggerMethodName = content.subtype in logger ? content.subtype : 'log';
|
|
26
|
+
const message = content.data.join('\n') + '\n';
|
|
27
|
+
|
|
28
|
+
logger[loggerMethodName](message);
|
|
29
|
+
};
|
|
30
|
+
|
|
19
31
|
const webSocketsFactory = (self) => {
|
|
20
32
|
const {config, logger} = self;
|
|
21
33
|
|
|
@@ -112,6 +124,10 @@ const webSocketsFactory = (self) => {
|
|
|
112
124
|
return logger.log(content.data.join('\n'));
|
|
113
125
|
}
|
|
114
126
|
|
|
127
|
+
if (content.type === 'log') {
|
|
128
|
+
printBackendLogMessage(logger, content);
|
|
129
|
+
}
|
|
130
|
+
|
|
115
131
|
// display application logs
|
|
116
132
|
if (isConsole) {
|
|
117
133
|
return logger.appOutput(content.subtype, content.data, content.timestamp);
|
|
@@ -7,8 +7,14 @@
|
|
|
7
7
|
const wsContentTypes = require('../api/wsContentTypes');
|
|
8
8
|
const {validate, validators} = require('../validation');
|
|
9
9
|
const chainPromise = require('../utils/chainPromise');
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
invalidInputMessage,
|
|
12
|
+
connectedToDevice,
|
|
13
|
+
connectingToDevice,
|
|
14
|
+
launcherWrongDeviceId,
|
|
15
|
+
} = require('../texts');
|
|
11
16
|
const {getDevicesDetails} = require('../utils/getDeviceInfo');
|
|
17
|
+
const {recordingUrlInfo} = require('../texts');
|
|
12
18
|
const SuitestError = require('../utils/SuitestError');
|
|
13
19
|
|
|
14
20
|
/**
|
|
@@ -60,6 +66,10 @@ async function pairDevice(
|
|
|
60
66
|
|
|
61
67
|
logger.log(connectedToDevice(deviceName, deviceId));
|
|
62
68
|
|
|
69
|
+
if (recordingOption === 'autostart' && res.recordingUrl) {
|
|
70
|
+
logger.log(recordingUrlInfo(res.recordingUrl));
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
return res;
|
|
64
74
|
}
|
|
65
75
|
|
|
@@ -26,8 +26,12 @@ async function startRecording({webSockets, authContext, logger}, recordingSettin
|
|
|
26
26
|
const response = await webSockets.send(authedContent);
|
|
27
27
|
|
|
28
28
|
if (response.result === 'success') {
|
|
29
|
-
logger.log(startRecordingMessage());
|
|
29
|
+
logger.log(startRecordingMessage(response.recordingUrl));
|
|
30
|
+
|
|
31
|
+
return response.recordingUrl;
|
|
30
32
|
}
|
|
33
|
+
|
|
34
|
+
return undefined;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
module.exports = chainPromise(startRecording);
|
package/lib/texts.js
CHANGED
|
@@ -214,6 +214,7 @@ ${leaves}`,
|
|
|
214
214
|
cliTimestamp: () => `Logger timestamp format. Use "${timestamp.none}" to disable. [default: "${timestamp.default}"]. This string is processed with momentJS.`,
|
|
215
215
|
cliConfig: () => 'Config file to override default config.',
|
|
216
216
|
cliRecordingOption: () => 'Enables recording of test session',
|
|
217
|
-
startRecordingMessage: () =>
|
|
217
|
+
startRecordingMessage: (recordingUrl) => `Recording started. Recording URL: ${recordingUrl}`,
|
|
218
|
+
recordingUrlInfo: (recordingUrl) => `Recording URL: ${recordingUrl}`,
|
|
218
219
|
stopRecordingMessage: () => 'Recording stopped',
|
|
219
220
|
};
|
|
@@ -43,7 +43,7 @@ const ELEMENT_PROP_TYPES = {
|
|
|
43
43
|
[ELEMENT_PROP.LEFT]: 'number',
|
|
44
44
|
[ELEMENT_PROP.MARGIN]: 'string',
|
|
45
45
|
[ELEMENT_PROP.NAME]: 'string',
|
|
46
|
-
[ELEMENT_PROP.OPACITY]: '
|
|
46
|
+
[ELEMENT_PROP.OPACITY]: 'number',
|
|
47
47
|
[ELEMENT_PROP.PACKAGE_NAME]: 'string',
|
|
48
48
|
[ELEMENT_PROP.PADDING]: 'string',
|
|
49
49
|
[ELEMENT_PROP.PIVOT_X]: 'number',
|
package/package.json
CHANGED
|
File without changes
|