suitest-js-api 3.3.0 → 3.4.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/lib/chains/openAppChain.js +11 -2
- package/lib/composers/deepLinkComposer.js +26 -0
- package/lib/composers/index.js +2 -0
- package/lib/constants/composer.js +1 -0
- package/lib/validation/validators.js +2 -0
- package/package.json +2 -2
- package/typeDefinition/OpenAppChain.d.ts +4 -2
- package/typeDefinition/modifiers.d.ts +4 -0
|
@@ -9,6 +9,7 @@ const {
|
|
|
9
9
|
cloneComposer,
|
|
10
10
|
gettersComposer,
|
|
11
11
|
makeToJSONComposer,
|
|
12
|
+
deepLinkComposer,
|
|
12
13
|
} = require('../composers');
|
|
13
14
|
const {
|
|
14
15
|
invalidInputMessage,
|
|
@@ -16,7 +17,7 @@ const {
|
|
|
16
17
|
const {validate, validators} = require('../validation');
|
|
17
18
|
const {getRequestType} = require('../utils/socketChainHelper');
|
|
18
19
|
|
|
19
|
-
const
|
|
20
|
+
const openAppChainFactory = (classInstance) => {
|
|
20
21
|
const toJSON = data => {
|
|
21
22
|
const socketMessage = {
|
|
22
23
|
type: getRequestType(data, false),
|
|
@@ -33,6 +34,10 @@ const openAppChainFactary = (classInstance) => {
|
|
|
33
34
|
socketMessage.request.launchMode = data.launchMode;
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
if (data.deepLink) {
|
|
38
|
+
socketMessage.request.deepLink = data.deepLink;
|
|
39
|
+
}
|
|
40
|
+
|
|
36
41
|
return socketMessage;
|
|
37
42
|
};
|
|
38
43
|
|
|
@@ -67,6 +72,10 @@ const openAppChainFactary = (classInstance) => {
|
|
|
67
72
|
output.push(launchModeComposer);
|
|
68
73
|
}
|
|
69
74
|
|
|
75
|
+
if (!data.deepLink) {
|
|
76
|
+
output.push(deepLinkComposer);
|
|
77
|
+
}
|
|
78
|
+
|
|
70
79
|
return output;
|
|
71
80
|
};
|
|
72
81
|
|
|
@@ -88,4 +97,4 @@ const openAppChainFactary = (classInstance) => {
|
|
|
88
97
|
};
|
|
89
98
|
};
|
|
90
99
|
|
|
91
|
-
module.exports =
|
|
100
|
+
module.exports = openAppChainFactory;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const {makeModifierComposer} = require('../utils/makeComposer');
|
|
2
|
+
const composers = require('../constants/composer');
|
|
3
|
+
const {validate, validators} = require('../validation');
|
|
4
|
+
const {invalidInputMessage} = require('../texts');
|
|
5
|
+
|
|
6
|
+
const METHOD_NAME = 'deepLink';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Defines launchMode method
|
|
10
|
+
*/
|
|
11
|
+
const deepLinkComposer = makeModifierComposer(
|
|
12
|
+
composers.DEEP_LINK,
|
|
13
|
+
[METHOD_NAME],
|
|
14
|
+
(_, meta, value) => {
|
|
15
|
+
return {
|
|
16
|
+
...meta,
|
|
17
|
+
deepLink: validate(
|
|
18
|
+
validators.NON_EMPTY_STRING,
|
|
19
|
+
value,
|
|
20
|
+
invalidInputMessage(METHOD_NAME, 'wrong argument'),
|
|
21
|
+
),
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
module.exports = deepLinkComposer;
|
package/lib/composers/index.js
CHANGED
|
@@ -44,6 +44,7 @@ const swipeComposer = require('./swipeComposer');
|
|
|
44
44
|
const handleComposer = require('./handleComposer');
|
|
45
45
|
const attributesComposer = require('./attributesComposer');
|
|
46
46
|
const cssPropsComposer = require('./cssPropsComposer');
|
|
47
|
+
const deepLinkComposer = require('./deepLinkComposer');
|
|
47
48
|
|
|
48
49
|
module.exports = {
|
|
49
50
|
abandonComposer,
|
|
@@ -94,4 +95,5 @@ module.exports = {
|
|
|
94
95
|
handleComposer,
|
|
95
96
|
attributesComposer,
|
|
96
97
|
cssPropsComposer,
|
|
98
|
+
deepLinkComposer,
|
|
97
99
|
};
|
|
@@ -209,6 +209,7 @@ const allowedUntilConditionChainTypes = [
|
|
|
209
209
|
'location',
|
|
210
210
|
'network',
|
|
211
211
|
'video',
|
|
212
|
+
'psVideo',
|
|
212
213
|
];
|
|
213
214
|
|
|
214
215
|
const allowedUntilConditionChainNames = [
|
|
@@ -219,6 +220,7 @@ const allowedUntilConditionChainNames = [
|
|
|
219
220
|
'location',
|
|
220
221
|
'networkRequest',
|
|
221
222
|
'video',
|
|
223
|
+
'psVideo',
|
|
222
224
|
];
|
|
223
225
|
|
|
224
226
|
const getSubjectType = path(['request', 'condition', 'subject', 'type']);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suitest-js-api",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "git@github.com:SuitestAutomation/suitest-js-api.git",
|
|
6
6
|
"author": "Suitest <hello@suite.st>",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@suitest/smst-to-text": "^4.4.3",
|
|
88
|
-
"@suitest/translate": "^4.
|
|
88
|
+
"@suitest/translate": "^4.5.1",
|
|
89
89
|
"@types/node": "^14.0.10",
|
|
90
90
|
"ajv": "^6.12.2",
|
|
91
91
|
"ansi-regex": "^5.0.0",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AbstractChain,
|
|
3
3
|
BaseChain,
|
|
4
|
-
LaunchModeModifier
|
|
4
|
+
LaunchModeModifier,
|
|
5
|
+
DeepLinkModifier,
|
|
5
6
|
} from './modifiers';
|
|
6
7
|
|
|
7
8
|
export interface OpenAppChain extends
|
|
8
9
|
BaseChain<OpenAppChain, OpenAppEvalResult, OpenAppAbandonedChain>,
|
|
9
|
-
LaunchModeModifier<OpenAppChain
|
|
10
|
+
LaunchModeModifier<OpenAppChain>,
|
|
11
|
+
DeepLinkModifier<OpenAppChain>
|
|
10
12
|
{}
|
|
11
13
|
|
|
12
14
|
interface OpenAppAbandonedChain extends AbstractChain {}
|