botium-core 1.15.10 → 1.15.13
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/dist/botium-cjs.js +91 -51
- package/dist/botium-cjs.js.map +1 -1
- package/dist/botium-es.js +91 -50
- package/dist/botium-es.js.map +1 -1
- package/package.json +35 -40
- package/src/BotDriver.js +1 -1
- package/src/Events.js +1 -3
- package/src/containers/GridContainer.js +0 -4
- package/src/mocks/BotiumMockScripting.js +3 -0
- package/src/scripting/Convo.js +10 -0
- package/src/utils/boolean.js +39 -0
- package/test/compiler/compilercsv.spec.js +34 -0
- package/test/compiler/compilermarkdown.spec.js +11 -0
- package/test/compiler/compilertxt.spec.js +21 -0
- package/test/compiler/compilerxlsx.spec.js +27 -0
- package/test/compiler/precompilerjson.spec.js +1 -0
- package/test/compiler/precompilermarkdownrasa.spec.js +1 -0
- package/test/connectors/pluginconnectorcontainer.spec.js +1 -0
- package/test/connectors/simplerest.spec.js +3 -1
- package/test/convo/failure.spec.js +1 -0
- package/test/convo/fillAndApplyScriptingMemory.spec.js +56 -0
- package/test/convo/partialconvo.spec.js +3 -0
- package/test/convo/retry.spec.js +9 -0
- package/test/convo/retryasserter.spec.js +9 -0
- package/test/convo/transcript.spec.js +33 -0
- package/test/convo/tree.spec.js +5 -0
- package/test/driver/capabilities.spec.js +16 -0
- package/test/helpers/capabilitiesutils.spec.js +8 -0
- package/test/helpers/transcriptutils.spec.js +1 -0
- package/test/hooks/customhooks.spec.js +3 -0
- package/test/logichooks/hookfromsrc.spec.js +3 -0
- package/test/logichooks/textfromhook.spec.js +1 -0
- package/test/plugins/plugins.spec.js +3 -0
- package/test/scripting/asserters/buttonsAsserter.spec.js +15 -0
- package/test/scripting/asserters/cardsAsserter.spec.js +12 -0
- package/test/scripting/asserters/convoStepParameters.spec.js +11 -0
- package/test/scripting/asserters/entitiesAsserter.spec.js +1 -0
- package/test/scripting/asserters/entityValuesAsserter.spec.js +7 -0
- package/test/scripting/asserters/formsAsserter.spec.js +10 -0
- package/test/scripting/asserters/intentAsserter.spec.js +4 -0
- package/test/scripting/asserters/intentUniqueAsserter.spec.js +2 -0
- package/test/scripting/asserters/jsonpathAsserter.spec.js +25 -0
- package/test/scripting/asserters/mediaAsserter.spec.js +20 -0
- package/test/scripting/asserters/responseLengthAsserter.spec.js +4 -0
- package/test/scripting/asserters/textAsserter.spec.js +1 -0
- package/test/scripting/asserters/textContainsAllAsserter.spec.js +1 -0
- package/test/scripting/asserters/textContainsAnyAsserter.spec.js +1 -0
- package/test/scripting/asserters/textEqualsAsserter.spec.js +1 -0
- package/test/scripting/asserters/textRegexpAllAsserter.spec.js +1 -0
- package/test/scripting/asserters/textRegexpAnyAsserter.spec.js +1 -0
- package/test/scripting/asserters/textWildcardAllAsserter.spec.js +1 -0
- package/test/scripting/asserters/textWildcardAnyAsserter.spec.js +1 -0
- package/test/scripting/asserters/textWildcardExactAllAsserter.spec.js +1 -0
- package/test/scripting/asserters/textWildcardExactAnyAsserter.spec.js +1 -0
- package/test/scripting/asserters/werAsserter.spec.js +6 -0
- package/test/scripting/logichooks/convos/scripting_memory_resolved_args.convo.txt +11 -0
- package/test/scripting/logichooks/customConditionalStepLogicHook.spec.js +2 -0
- package/test/scripting/logichooks/localvsglobal.spec.js +1 -0
- package/test/scripting/logichooks/pauseLogic.spec.js +4 -0
- package/test/scripting/logichooks/setClearScriptingMemory.spec.js +17 -0
- package/test/scripting/logichooks/updateCustom.spec.js +2 -0
- package/test/scripting/matching/matchingmode.spec.js +48 -0
- package/test/scripting/scriptingModificator.spec.js +1 -0
- package/test/scripting/scriptingmemory/fillScriptingMemoryFromFile.spec.js +4 -0
- package/test/scripting/scriptingmemory/regexp.spec.js +1 -0
- package/test/scripting/scriptingmemory/useScriptingMemoryForAssertion.spec.js +3 -0
- package/test/scripting/txt/decompile.spec.js +20 -0
- package/test/scripting/userinputs/buttonInputConvos.spec.js +1 -0
- package/test/scripting/userinputs/defaultUserInputs.spec.js +13 -0
- package/test/scripting/userinputs/mediaInputConvos.spec.js +10 -0
- package/test/scripting/utteranceexpansion/associateByIndex.spec.js +2 -0
- package/test/security/allowUnsafe.spec.js +5 -0
- package/test/utils.spec.js +2 -0
- package/samples/postman/Botium Agent Sample.postman_collection.json +0 -834
- package/samples/postman/README.md +0 -5
- package/samples/postman/botiumFluent.js +0 -37
- package/src/grid/agent/AgentWorker.js +0 -204
- package/src/grid/agent/agent.js +0 -96
- package/src/grid/agent/agentworkerpool.js +0 -58
- package/src/grid/agent/routes.js +0 -353
- package/src/grid/agent/swagger.json +0 -327
- package/src/grid/agent/swaggerDef.json +0 -8
- package/src/grid/agent/views/index.html +0 -39
- package/test/grid/agent/client.js +0 -65
|
@@ -28,6 +28,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
28
28
|
this.compiler = driver.BuildCompiler()
|
|
29
29
|
this.container = await driver.Build()
|
|
30
30
|
})
|
|
31
|
+
|
|
31
32
|
afterEach(async function () {
|
|
32
33
|
this.container && await this.container.Clean()
|
|
33
34
|
})
|
|
@@ -56,6 +57,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
56
57
|
this.compiler = driver.BuildCompiler()
|
|
57
58
|
this.container = await driver.Build()
|
|
58
59
|
})
|
|
60
|
+
|
|
59
61
|
afterEach(async function () {
|
|
60
62
|
this.container && await this.container.Clean()
|
|
61
63
|
})
|
|
@@ -64,9 +66,11 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
64
66
|
this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'regex.convo.txt')
|
|
65
67
|
await this.compiler.convos[0].Run(this.container)
|
|
66
68
|
})
|
|
69
|
+
|
|
67
70
|
it('should match case sensitive response', async function () {
|
|
68
71
|
assert.isTrue(this.compiler.Match('This is a long text', 'This .*'))
|
|
69
72
|
})
|
|
73
|
+
|
|
70
74
|
it('should not match uppercase response', async function () {
|
|
71
75
|
assert.isFalse(this.compiler.Match('THIS is a long text', 'This .*'))
|
|
72
76
|
})
|
|
@@ -83,6 +87,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
83
87
|
this.compiler = driver.BuildCompiler()
|
|
84
88
|
this.container = await driver.Build()
|
|
85
89
|
})
|
|
90
|
+
|
|
86
91
|
afterEach(async function () {
|
|
87
92
|
this.container && await this.container.Clean()
|
|
88
93
|
})
|
|
@@ -91,12 +96,15 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
91
96
|
this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'regex.convo.txt')
|
|
92
97
|
await this.compiler.convos[0].Run(this.container)
|
|
93
98
|
})
|
|
99
|
+
|
|
94
100
|
it('should match case sensitive response', async function () {
|
|
95
101
|
assert.isTrue(this.compiler.Match('This is a long text', 'This .*'))
|
|
96
102
|
})
|
|
103
|
+
|
|
97
104
|
it('should match uppercase response', async function () {
|
|
98
105
|
assert.isTrue(this.compiler.Match('THIS is a long text', 'This .*'))
|
|
99
106
|
})
|
|
107
|
+
|
|
100
108
|
it('should not match if pattern is not matching', async function () {
|
|
101
109
|
assert.isFalse(this.compiler.Match('This is a long text', 'notthere .*'))
|
|
102
110
|
})
|
|
@@ -113,6 +121,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
113
121
|
this.compiler = driver.BuildCompiler()
|
|
114
122
|
this.container = await driver.Build()
|
|
115
123
|
})
|
|
124
|
+
|
|
116
125
|
afterEach(async function () {
|
|
117
126
|
this.container && await this.container.Clean()
|
|
118
127
|
})
|
|
@@ -120,9 +129,11 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
120
129
|
it('should match case sensitive response', async function () {
|
|
121
130
|
assert.isTrue(this.compiler.Match('This is a long text', 'is a'))
|
|
122
131
|
})
|
|
132
|
+
|
|
123
133
|
it('should not match uppercase response', async function () {
|
|
124
134
|
assert.isFalse(this.compiler.Match('This is a long text', 'IS A'))
|
|
125
135
|
})
|
|
136
|
+
|
|
126
137
|
it('should not match if pattern is not matching', async function () {
|
|
127
138
|
assert.isFalse(this.compiler.Match('This is a long text', 'notthere'))
|
|
128
139
|
})
|
|
@@ -139,6 +150,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
139
150
|
this.compiler = driver.BuildCompiler()
|
|
140
151
|
this.container = await driver.Build()
|
|
141
152
|
})
|
|
153
|
+
|
|
142
154
|
afterEach(async function () {
|
|
143
155
|
this.container && await this.container.Clean()
|
|
144
156
|
})
|
|
@@ -146,18 +158,23 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
146
158
|
it('should match response with substring', async function () {
|
|
147
159
|
assert.isTrue(this.compiler.Match('Interesting...', 'Interesting'))
|
|
148
160
|
})
|
|
161
|
+
|
|
149
162
|
it('should match long response with wildcard', async function () {
|
|
150
163
|
assert.isTrue(this.compiler.Match('this is a long text', 'this is a * text'))
|
|
151
164
|
})
|
|
165
|
+
|
|
152
166
|
it('should match very long response with wildcard', async function () {
|
|
153
167
|
assert.isTrue(this.compiler.Match('this is a long text this is a long text this is a long text this is a long text', 'this is a * text this is a * text this is a * text'))
|
|
154
168
|
})
|
|
169
|
+
|
|
155
170
|
it('should not match long uppcercase response with wildcard', async function () {
|
|
156
171
|
assert.isFalse(this.compiler.Match('THIS IS A LONG TEXT', 'this is a * text'))
|
|
157
172
|
})
|
|
173
|
+
|
|
158
174
|
it('should match very long response with very long wildcard', async function () {
|
|
159
175
|
assert.isTrue(this.compiler.Match('begin this is a long text this is a long text this is a long text this is a long text end', 'begin * end'))
|
|
160
176
|
})
|
|
177
|
+
|
|
161
178
|
it('should not allow more than 10 wildcards in a string', async function () {
|
|
162
179
|
try {
|
|
163
180
|
this.compiler.Match('some text', 'begin * * * * * * * * * * * end')
|
|
@@ -166,6 +183,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
166
183
|
assert.equal(err.message, 'Maximum number of 10 wildcards supported.')
|
|
167
184
|
}
|
|
168
185
|
})
|
|
186
|
+
|
|
169
187
|
it('should not match if pattern is not matching', async function () {
|
|
170
188
|
assert.isFalse(this.compiler.Match('This is a long text', '*notthere*'))
|
|
171
189
|
})
|
|
@@ -182,6 +200,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
182
200
|
this.compiler = driver.BuildCompiler()
|
|
183
201
|
this.container = await driver.Build()
|
|
184
202
|
})
|
|
203
|
+
|
|
185
204
|
afterEach(async function () {
|
|
186
205
|
this.container && await this.container.Clean()
|
|
187
206
|
})
|
|
@@ -189,15 +208,19 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
189
208
|
it('should match response with substring', async function () {
|
|
190
209
|
assert.isTrue(this.compiler.Match('You said: So.....', 'so...'))
|
|
191
210
|
})
|
|
211
|
+
|
|
192
212
|
it('should match long response with wildcard', async function () {
|
|
193
213
|
assert.isTrue(this.compiler.Match('this is a long text', 'this is a * text'))
|
|
194
214
|
})
|
|
215
|
+
|
|
195
216
|
it('should match long uppcercase response with wildcard', async function () {
|
|
196
217
|
assert.isTrue(this.compiler.Match('THIS IS A LONG TEXT', 'this is a * text'))
|
|
197
218
|
})
|
|
219
|
+
|
|
198
220
|
it('should not match if pattern is not matching', async function () {
|
|
199
221
|
assert.isFalse(this.compiler.Match('This is a long text', '*notthere*'))
|
|
200
222
|
})
|
|
223
|
+
|
|
201
224
|
it('should match response with utterances list', async function () {
|
|
202
225
|
this.compiler.scriptingEvents.assertBotResponse('So.....', [
|
|
203
226
|
'lol',
|
|
@@ -225,6 +248,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
225
248
|
this.compiler = driver.BuildCompiler()
|
|
226
249
|
this.container = await driver.Build()
|
|
227
250
|
})
|
|
251
|
+
|
|
228
252
|
afterEach(async function () {
|
|
229
253
|
this.container && await this.container.Clean()
|
|
230
254
|
})
|
|
@@ -232,18 +256,23 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
232
256
|
it('should not match response with substring', async function () {
|
|
233
257
|
assert.isFalse(this.compiler.Match('Interesting...', 'Interesting'))
|
|
234
258
|
})
|
|
259
|
+
|
|
235
260
|
it('should match long response with wildcard', async function () {
|
|
236
261
|
assert.isTrue(this.compiler.Match('this is a long text', 'this is a * text'))
|
|
237
262
|
})
|
|
263
|
+
|
|
238
264
|
it('should match very long response with wildcard', async function () {
|
|
239
265
|
assert.isTrue(this.compiler.Match('this is a long text this is a long text this is a long text this is a long text', 'this is a * text this is a * text this is a * text this is a * text'))
|
|
240
266
|
})
|
|
267
|
+
|
|
241
268
|
it('should not match long uppcercase response with wildcard', async function () {
|
|
242
269
|
assert.isFalse(this.compiler.Match('THIS IS A LONG TEXT', 'this is a * text'))
|
|
243
270
|
})
|
|
271
|
+
|
|
244
272
|
it('should match very long response with very long wildcard', async function () {
|
|
245
273
|
assert.isTrue(this.compiler.Match('begin this is a long text this is a long text this is a long text this is a long text end', 'begin * end'))
|
|
246
274
|
})
|
|
275
|
+
|
|
247
276
|
it('should not allow more than 10 wildcards in a string', async function () {
|
|
248
277
|
try {
|
|
249
278
|
this.compiler.Match('some text', 'begin * * * * * * * * * * * end')
|
|
@@ -252,6 +281,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
252
281
|
assert.equal(err.message, 'Maximum number of 10 wildcards supported.')
|
|
253
282
|
}
|
|
254
283
|
})
|
|
284
|
+
|
|
255
285
|
it('should not match if pattern is not matching', async function () {
|
|
256
286
|
assert.isFalse(this.compiler.Match('This is a long text', '*notthere*'))
|
|
257
287
|
})
|
|
@@ -268,6 +298,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
268
298
|
this.compiler = driver.BuildCompiler()
|
|
269
299
|
this.container = await driver.Build()
|
|
270
300
|
})
|
|
301
|
+
|
|
271
302
|
afterEach(async function () {
|
|
272
303
|
this.container && await this.container.Clean()
|
|
273
304
|
})
|
|
@@ -275,9 +306,11 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
275
306
|
it('should match case sensitive response', async function () {
|
|
276
307
|
assert.isTrue(this.compiler.Match('This is a long text', 'This is a long text'))
|
|
277
308
|
})
|
|
309
|
+
|
|
278
310
|
it('should not match uppercase response', async function () {
|
|
279
311
|
assert.isFalse(this.compiler.Match('This is a long text', 'THIS is a long text'))
|
|
280
312
|
})
|
|
313
|
+
|
|
281
314
|
it('should not match for partial match', async function () {
|
|
282
315
|
assert.isFalse(this.compiler.Match('This is a long text', 'long'))
|
|
283
316
|
})
|
|
@@ -294,6 +327,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
294
327
|
this.compiler = driver.BuildCompiler()
|
|
295
328
|
this.container = await driver.Build()
|
|
296
329
|
})
|
|
330
|
+
|
|
297
331
|
afterEach(async function () {
|
|
298
332
|
this.container && await this.container.Clean()
|
|
299
333
|
})
|
|
@@ -301,9 +335,11 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
301
335
|
it('should match case sensitive response', async function () {
|
|
302
336
|
assert.isTrue(this.compiler.Match('This is a long text', 'This is a long text'))
|
|
303
337
|
})
|
|
338
|
+
|
|
304
339
|
it('should match uppercase response', async function () {
|
|
305
340
|
assert.isTrue(this.compiler.Match('This is a long text', 'THIS is a long text'))
|
|
306
341
|
})
|
|
342
|
+
|
|
307
343
|
it('should not match for partial match', async function () {
|
|
308
344
|
assert.isFalse(this.compiler.Match('This is a long text', 'long'))
|
|
309
345
|
})
|
|
@@ -321,6 +357,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
321
357
|
this.compiler = driver.BuildCompiler()
|
|
322
358
|
this.container = await driver.Build()
|
|
323
359
|
})
|
|
360
|
+
|
|
324
361
|
afterEach(async function () {
|
|
325
362
|
this.container && await this.container.Clean()
|
|
326
363
|
})
|
|
@@ -329,6 +366,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
329
366
|
assert.isFalse(this.compiler.Match('test 123', 'tast 123'))
|
|
330
367
|
})
|
|
331
368
|
})
|
|
369
|
+
|
|
332
370
|
describe('wer.lowthreshold (percentage)', function () {
|
|
333
371
|
beforeEach(async function () {
|
|
334
372
|
const myCaps = {
|
|
@@ -341,6 +379,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
341
379
|
this.compiler = driver.BuildCompiler()
|
|
342
380
|
this.container = await driver.Build()
|
|
343
381
|
})
|
|
382
|
+
|
|
344
383
|
afterEach(async function () {
|
|
345
384
|
this.container && await this.container.Clean()
|
|
346
385
|
})
|
|
@@ -362,6 +401,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
362
401
|
this.compiler = driver.BuildCompiler()
|
|
363
402
|
this.container = await driver.Build()
|
|
364
403
|
})
|
|
404
|
+
|
|
365
405
|
afterEach(async function () {
|
|
366
406
|
this.container && await this.container.Clean()
|
|
367
407
|
})
|
|
@@ -370,6 +410,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
370
410
|
assert.isTrue(this.compiler.Match('test 123', 'tast 123'))
|
|
371
411
|
})
|
|
372
412
|
})
|
|
413
|
+
|
|
373
414
|
describe('wer.highthreshold (percentage)', function () {
|
|
374
415
|
beforeEach(async function () {
|
|
375
416
|
const myCaps = {
|
|
@@ -382,6 +423,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
382
423
|
this.compiler = driver.BuildCompiler()
|
|
383
424
|
this.container = await driver.Build()
|
|
384
425
|
})
|
|
426
|
+
|
|
385
427
|
afterEach(async function () {
|
|
386
428
|
this.container && await this.container.Clean()
|
|
387
429
|
})
|
|
@@ -403,6 +445,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
403
445
|
this.compiler = driver.BuildCompiler()
|
|
404
446
|
this.container = await driver.Build()
|
|
405
447
|
})
|
|
448
|
+
|
|
406
449
|
afterEach(async function () {
|
|
407
450
|
this.container && await this.container.Clean()
|
|
408
451
|
})
|
|
@@ -411,6 +454,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
411
454
|
assert.isFalse(this.compiler.Match('This is an example', '* that are * hot'))
|
|
412
455
|
})
|
|
413
456
|
})
|
|
457
|
+
|
|
414
458
|
describe('wer.lowthreshold.wildcard (percentage)', function () {
|
|
415
459
|
beforeEach(async function () {
|
|
416
460
|
const myCaps = {
|
|
@@ -423,6 +467,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
423
467
|
this.compiler = driver.BuildCompiler()
|
|
424
468
|
this.container = await driver.Build()
|
|
425
469
|
})
|
|
470
|
+
|
|
426
471
|
afterEach(async function () {
|
|
427
472
|
this.container && await this.container.Clean()
|
|
428
473
|
})
|
|
@@ -444,6 +489,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
444
489
|
this.compiler = driver.BuildCompiler()
|
|
445
490
|
this.container = await driver.Build()
|
|
446
491
|
})
|
|
492
|
+
|
|
447
493
|
afterEach(async function () {
|
|
448
494
|
this.container && await this.container.Clean()
|
|
449
495
|
})
|
|
@@ -452,6 +498,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
452
498
|
assert.isTrue(this.compiler.Match('this is an example', 'this is * sample'))
|
|
453
499
|
})
|
|
454
500
|
})
|
|
501
|
+
|
|
455
502
|
describe('wer.highthreshold.wildcard (percentage)', function () {
|
|
456
503
|
beforeEach(async function () {
|
|
457
504
|
const myCaps = {
|
|
@@ -464,6 +511,7 @@ describe('scripting.matching.matchingmode', function () {
|
|
|
464
511
|
this.compiler = driver.BuildCompiler()
|
|
465
512
|
this.container = await driver.Build()
|
|
466
513
|
})
|
|
514
|
+
|
|
467
515
|
afterEach(async function () {
|
|
468
516
|
this.container && await this.container.Clean()
|
|
469
517
|
})
|
|
@@ -30,6 +30,7 @@ describe('scriptingModificator.assertions', function () {
|
|
|
30
30
|
}
|
|
31
31
|
})
|
|
32
32
|
})
|
|
33
|
+
|
|
33
34
|
it('should use assertConvoNotStep for "not" modificator and fail with generic handler', async function () {
|
|
34
35
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
35
36
|
await scriptingProvider.Build()
|
|
@@ -32,6 +32,7 @@ describe('scripting.scriptingmemory.fillingScriptingMemoryFromFile', function ()
|
|
|
32
32
|
this.compiler = driver.BuildCompiler()
|
|
33
33
|
this.container = await driver.Build()
|
|
34
34
|
})
|
|
35
|
+
|
|
35
36
|
afterEach(async function () {
|
|
36
37
|
this.container && await this.container.Clean()
|
|
37
38
|
})
|
|
@@ -315,6 +316,7 @@ describe('scripting.scriptingmemory.fillingScriptingMemoryFromFile', function ()
|
|
|
315
316
|
this.compiler = driver.BuildCompiler()
|
|
316
317
|
this.container = await driver.Build()
|
|
317
318
|
})
|
|
319
|
+
|
|
318
320
|
afterEach(async function () {
|
|
319
321
|
this.container && await this.container.Clean()
|
|
320
322
|
})
|
|
@@ -340,6 +342,7 @@ describe('scripting.scriptingmemory.fillingScriptingMemoryFromFile', function ()
|
|
|
340
342
|
this.compiler = driver.BuildCompiler()
|
|
341
343
|
this.container = await driver.Build()
|
|
342
344
|
})
|
|
345
|
+
|
|
343
346
|
afterEach(async function () {
|
|
344
347
|
this.container && await this.container.Clean()
|
|
345
348
|
})
|
|
@@ -369,6 +372,7 @@ describe('scripting.scriptingmemory.fillingScriptingMemoryFromFile', function ()
|
|
|
369
372
|
this.compiler = driver.BuildCompiler()
|
|
370
373
|
this.container = await driver.Build()
|
|
371
374
|
})
|
|
375
|
+
|
|
372
376
|
afterEach(async function () {
|
|
373
377
|
this.container && await this.container.Clean()
|
|
374
378
|
})
|
|
@@ -61,6 +61,7 @@ describe('scripting.scriptingmemory.useScriptingMemoryForAssertion', function ()
|
|
|
61
61
|
this.compiler = driver.BuildCompiler()
|
|
62
62
|
this.container = await driver.Build()
|
|
63
63
|
})
|
|
64
|
+
|
|
64
65
|
afterEach(async function () {
|
|
65
66
|
this.container && await this.container.Clean()
|
|
66
67
|
})
|
|
@@ -90,6 +91,7 @@ describe('scripting.scriptingmemory.useScriptingMemoryForAssertion', function ()
|
|
|
90
91
|
this.compiler = driver.BuildCompiler()
|
|
91
92
|
this.container = await driver.Build()
|
|
92
93
|
})
|
|
94
|
+
|
|
93
95
|
afterEach(async function () {
|
|
94
96
|
this.container && await this.container.Clean()
|
|
95
97
|
})
|
|
@@ -123,6 +125,7 @@ describe('scripting.scriptingmemory.useScriptingMemoryForAssertion', function ()
|
|
|
123
125
|
this.compiler = driver.BuildCompiler()
|
|
124
126
|
this.container = await driver.Build()
|
|
125
127
|
})
|
|
128
|
+
|
|
126
129
|
afterEach(async function () {
|
|
127
130
|
this.container && await this.container.Clean()
|
|
128
131
|
})
|
|
@@ -34,6 +34,7 @@ botText
|
|
|
34
34
|
`
|
|
35
35
|
)
|
|
36
36
|
})
|
|
37
|
+
|
|
37
38
|
it('should decompile convo with negated messageText', async function () {
|
|
38
39
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
39
40
|
await scriptingProvider.Build()
|
|
@@ -59,6 +60,7 @@ botText
|
|
|
59
60
|
`
|
|
60
61
|
)
|
|
61
62
|
})
|
|
63
|
+
|
|
62
64
|
it('should decompile convo with optional messageText', async function () {
|
|
63
65
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
64
66
|
await scriptingProvider.Build()
|
|
@@ -91,6 +93,7 @@ botText2
|
|
|
91
93
|
`
|
|
92
94
|
)
|
|
93
95
|
})
|
|
96
|
+
|
|
94
97
|
it('should decompile convo with optional and negated messageText', async function () {
|
|
95
98
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
96
99
|
await scriptingProvider.Build()
|
|
@@ -126,6 +129,7 @@ botText2
|
|
|
126
129
|
`
|
|
127
130
|
)
|
|
128
131
|
})
|
|
132
|
+
|
|
129
133
|
it('should fail decompile convo with mixed optional step', async function () {
|
|
130
134
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
131
135
|
await scriptingProvider.Build()
|
|
@@ -152,6 +156,7 @@ botText2
|
|
|
152
156
|
assert.equal(err.message, 'Step 1: Failed to decompile conversation. Mixed optional flag is not allowed inside one step.')
|
|
153
157
|
}
|
|
154
158
|
})
|
|
159
|
+
|
|
155
160
|
it('should decompile logichook', async function () {
|
|
156
161
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
157
162
|
await scriptingProvider.Build()
|
|
@@ -178,6 +183,7 @@ PAUSE 100
|
|
|
178
183
|
`
|
|
179
184
|
)
|
|
180
185
|
})
|
|
186
|
+
|
|
181
187
|
it('should decompile logichook without message', async function () {
|
|
182
188
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
183
189
|
await scriptingProvider.Build()
|
|
@@ -202,6 +208,7 @@ PAUSE 100
|
|
|
202
208
|
`
|
|
203
209
|
)
|
|
204
210
|
})
|
|
211
|
+
|
|
205
212
|
it('should decompile logichook with message null', async function () {
|
|
206
213
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
207
214
|
await scriptingProvider.Build()
|
|
@@ -227,6 +234,7 @@ PAUSE 100
|
|
|
227
234
|
`
|
|
228
235
|
)
|
|
229
236
|
})
|
|
237
|
+
|
|
230
238
|
it('should decompile button asserter', async function () {
|
|
231
239
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
232
240
|
await scriptingProvider.Build()
|
|
@@ -259,6 +267,7 @@ BUTTONS buttontext|buttontext 2
|
|
|
259
267
|
`
|
|
260
268
|
)
|
|
261
269
|
})
|
|
270
|
+
|
|
262
271
|
it('should decompile button asserter with negation', async function () {
|
|
263
272
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
264
273
|
await scriptingProvider.Build()
|
|
@@ -283,6 +292,7 @@ BUTTONS buttontext|buttontext 2
|
|
|
283
292
|
`
|
|
284
293
|
)
|
|
285
294
|
})
|
|
295
|
+
|
|
286
296
|
it('should decompile optional button asserter', async function () {
|
|
287
297
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
288
298
|
await scriptingProvider.Build()
|
|
@@ -314,6 +324,7 @@ botText
|
|
|
314
324
|
`
|
|
315
325
|
)
|
|
316
326
|
})
|
|
327
|
+
|
|
317
328
|
it('should decompile optional button asserter with negation', async function () {
|
|
318
329
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
319
330
|
await scriptingProvider.Build()
|
|
@@ -345,6 +356,7 @@ botText
|
|
|
345
356
|
`
|
|
346
357
|
)
|
|
347
358
|
})
|
|
359
|
+
|
|
348
360
|
it('should decompile button asserter with numeric text', async function () {
|
|
349
361
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
350
362
|
await scriptingProvider.Build()
|
|
@@ -372,6 +384,7 @@ BUTTONS 123|456
|
|
|
372
384
|
`
|
|
373
385
|
)
|
|
374
386
|
})
|
|
387
|
+
|
|
375
388
|
it('should decompile media asserter', async function () {
|
|
376
389
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
377
390
|
await scriptingProvider.Build()
|
|
@@ -396,6 +409,7 @@ MEDIA test1.png|test2.png
|
|
|
396
409
|
`
|
|
397
410
|
)
|
|
398
411
|
})
|
|
412
|
+
|
|
399
413
|
it('should decompile custom asserter', async function () {
|
|
400
414
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
401
415
|
await scriptingProvider.Build()
|
|
@@ -420,6 +434,7 @@ myasserter arg1|arg2
|
|
|
420
434
|
`
|
|
421
435
|
)
|
|
422
436
|
})
|
|
437
|
+
|
|
423
438
|
it('should decompile button user input', async function () {
|
|
424
439
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
425
440
|
await scriptingProvider.Build()
|
|
@@ -445,6 +460,7 @@ BUTTON buttonpayload|buttontext
|
|
|
445
460
|
`
|
|
446
461
|
)
|
|
447
462
|
})
|
|
463
|
+
|
|
448
464
|
it('should decompile button with object payload user input', async function () {
|
|
449
465
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
450
466
|
await scriptingProvider.Build()
|
|
@@ -475,6 +491,7 @@ BUTTON {"bp":"buttonpayload"}|buttontext
|
|
|
475
491
|
`
|
|
476
492
|
)
|
|
477
493
|
})
|
|
494
|
+
|
|
478
495
|
it('should decompile media user input', async function () {
|
|
479
496
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
480
497
|
await scriptingProvider.Build()
|
|
@@ -499,6 +516,7 @@ MEDIA test1.png
|
|
|
499
516
|
`
|
|
500
517
|
)
|
|
501
518
|
})
|
|
519
|
+
|
|
502
520
|
it('should decompile media with base64 in bot response', async function () {
|
|
503
521
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
504
522
|
await scriptingProvider.Build()
|
|
@@ -613,6 +631,7 @@ CARDS text of card2
|
|
|
613
631
|
`
|
|
614
632
|
)
|
|
615
633
|
})
|
|
634
|
+
|
|
616
635
|
it('should decompile custom user input', async function () {
|
|
617
636
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
618
637
|
await scriptingProvider.Build()
|
|
@@ -639,6 +658,7 @@ CUSTOMINPUT arg1|arg2
|
|
|
639
658
|
`
|
|
640
659
|
)
|
|
641
660
|
})
|
|
661
|
+
|
|
642
662
|
it('should escape pipe in args', async function () {
|
|
643
663
|
const scriptingProvider = new ScriptingProvider(DefaultCapabilities)
|
|
644
664
|
await scriptingProvider.Build()
|
|
@@ -17,6 +17,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
17
17
|
meMsg: {}
|
|
18
18
|
})
|
|
19
19
|
})
|
|
20
|
+
|
|
20
21
|
it('wrong number of args', async function () {
|
|
21
22
|
const bi = new ButtonInput()
|
|
22
23
|
try {
|
|
@@ -31,6 +32,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
31
32
|
assert.instanceOf(err, Error)
|
|
32
33
|
}
|
|
33
34
|
})
|
|
35
|
+
|
|
34
36
|
it('empty argument list', async function () {
|
|
35
37
|
const bi = new ButtonInput()
|
|
36
38
|
try {
|
|
@@ -44,6 +46,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
44
46
|
assert.instanceOf(err, Error)
|
|
45
47
|
}
|
|
46
48
|
})
|
|
49
|
+
|
|
47
50
|
it('should set button in message as payload', async function () {
|
|
48
51
|
const bi = new ButtonInput()
|
|
49
52
|
|
|
@@ -69,6 +72,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
69
72
|
convo: { sourceTag: { filename: '' } }
|
|
70
73
|
})
|
|
71
74
|
})
|
|
75
|
+
|
|
72
76
|
it('correct number of args with buffer', async function () {
|
|
73
77
|
const mi = new MediaInput()
|
|
74
78
|
await mi.setUserInput({
|
|
@@ -78,6 +82,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
78
82
|
convo: { sourceTag: { filename: '' } }
|
|
79
83
|
})
|
|
80
84
|
})
|
|
85
|
+
|
|
81
86
|
it('wrong number of args', async function () {
|
|
82
87
|
const mi = new MediaInput()
|
|
83
88
|
return mi.setUserInput({
|
|
@@ -91,6 +96,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
91
96
|
assert.instanceOf(err, Error)
|
|
92
97
|
})
|
|
93
98
|
})
|
|
99
|
+
|
|
94
100
|
it('empty argument list', async function () {
|
|
95
101
|
const mi = new MediaInput()
|
|
96
102
|
return mi.setUserInput({
|
|
@@ -103,6 +109,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
103
109
|
assert.instanceOf(err, Error)
|
|
104
110
|
})
|
|
105
111
|
})
|
|
112
|
+
|
|
106
113
|
it('should set media in message', async function () {
|
|
107
114
|
const mi = new MediaInput({}, { SECURITY_ALLOW_UNSAFE: true })
|
|
108
115
|
|
|
@@ -134,6 +141,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
134
141
|
convo: { sourceTag: { filename: '' } }
|
|
135
142
|
})
|
|
136
143
|
})
|
|
144
|
+
|
|
137
145
|
it('wrong number of args', async function () {
|
|
138
146
|
const mi = new FormInput()
|
|
139
147
|
return mi.setUserInput({
|
|
@@ -147,6 +155,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
147
155
|
assert.instanceOf(err, Error)
|
|
148
156
|
})
|
|
149
157
|
})
|
|
158
|
+
|
|
150
159
|
it('empty argument list', async function () {
|
|
151
160
|
const mi = new FormInput()
|
|
152
161
|
return mi.setUserInput({
|
|
@@ -159,6 +168,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
159
168
|
assert.instanceOf(err, Error)
|
|
160
169
|
})
|
|
161
170
|
})
|
|
171
|
+
|
|
162
172
|
it('should set form boolean in message', async function () {
|
|
163
173
|
const mi = new FormInput()
|
|
164
174
|
|
|
@@ -179,6 +189,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
179
189
|
assert.equal(meMsg.forms[0].name, 'NAME1')
|
|
180
190
|
assert.isTrue(meMsg.forms[0].value)
|
|
181
191
|
})
|
|
192
|
+
|
|
182
193
|
it('should set form value in message', async function () {
|
|
183
194
|
const mi = new FormInput()
|
|
184
195
|
|
|
@@ -199,6 +210,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
199
210
|
assert.equal(meMsg.forms[0].name, 'NAME1')
|
|
200
211
|
assert.equal(meMsg.forms[0].value, 'VALUE1')
|
|
201
212
|
})
|
|
213
|
+
|
|
202
214
|
it('should set form values in message', async function () {
|
|
203
215
|
const mi = new FormInput()
|
|
204
216
|
|
|
@@ -222,6 +234,7 @@ describe('scripting.userinputs.defaultUserInputs', function () {
|
|
|
222
234
|
assert.equal(meMsg.forms[0].value[0], 'VALUE1')
|
|
223
235
|
assert.equal(meMsg.forms[0].value[1], 'VALUE2')
|
|
224
236
|
})
|
|
237
|
+
|
|
225
238
|
it('should set multiple form value in message', async function () {
|
|
226
239
|
const mi = new FormInput()
|
|
227
240
|
|