botium-core 1.15.9 → 1.15.12
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 +215 -55
- package/dist/botium-cjs.js.map +1 -1
- package/dist/botium-es.js +215 -54
- 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/helpers/TranscriptUtils.js +66 -0
- package/src/scripting/Convo.js +9 -0
- package/src/scripting/ScriptingProvider.js +36 -5
- package/src/scripting/logichook/userinput/MediaInput.js +10 -2
- 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/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 +3 -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
|
@@ -50,6 +50,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
50
50
|
assert.equal(context.convos[1].conversation[1].messageText, 'test 2')
|
|
51
51
|
assert.lengthOf(context.utterances, 0)
|
|
52
52
|
})
|
|
53
|
+
|
|
53
54
|
it('should read 2 convos and 2 utterances', async function () {
|
|
54
55
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_2utterances.xlsx'))
|
|
55
56
|
const context = buildContext()
|
|
@@ -72,6 +73,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
72
73
|
assert.equal(context.utterances[0].name, 'TESTUTT1')
|
|
73
74
|
assert.equal(context.utterances[1].name, 'TESTUTT2')
|
|
74
75
|
})
|
|
76
|
+
|
|
75
77
|
it('should read utterances from default worksheet', async function () {
|
|
76
78
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2utterances.xlsx'))
|
|
77
79
|
const context = buildContext()
|
|
@@ -84,6 +86,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
84
86
|
assert.lengthOf(context.convos, 0)
|
|
85
87
|
assert.lengthOf(context.utterances, 2)
|
|
86
88
|
})
|
|
89
|
+
|
|
87
90
|
it('should read 2 utterances', async function () {
|
|
88
91
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2utterances.xlsx'))
|
|
89
92
|
const context = buildContext()
|
|
@@ -99,6 +102,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
99
102
|
assert.equal(context.utterances[0].name, 'TESTUTT1')
|
|
100
103
|
assert.equal(context.utterances[1].name, 'TESTUTT2')
|
|
101
104
|
})
|
|
105
|
+
|
|
102
106
|
it('should read 2 utterances separated by empty lines', async function () {
|
|
103
107
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2utterances_emptylines.xlsx'))
|
|
104
108
|
const context = buildContext()
|
|
@@ -116,6 +120,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
116
120
|
assert.equal(context.utterances[1].name, 'TESTUTT2')
|
|
117
121
|
assert.equal(context.utterances[1].utterances.length, 3)
|
|
118
122
|
})
|
|
123
|
+
|
|
119
124
|
it('should read 2 convos from given region by letter', async function () {
|
|
120
125
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_middle.xlsx'))
|
|
121
126
|
const context = buildContext()
|
|
@@ -133,6 +138,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
133
138
|
assert.equal(context.convos[0].conversation[1].messageText, 'test 2')
|
|
134
139
|
assert.lengthOf(context.utterances, 0)
|
|
135
140
|
})
|
|
141
|
+
|
|
136
142
|
it('should read 2 convos from given region by index', async function () {
|
|
137
143
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_middle.xlsx'))
|
|
138
144
|
const context = buildContext()
|
|
@@ -151,6 +157,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
151
157
|
assert.lengthOf(context.utterances, 0)
|
|
152
158
|
})
|
|
153
159
|
})
|
|
160
|
+
|
|
154
161
|
describe('negating', function () {
|
|
155
162
|
it('should read ! as not', async function () {
|
|
156
163
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_exclamation.xlsx'))
|
|
@@ -164,6 +171,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
164
171
|
assert.equal(context.convos[0].conversation[1].messageText, 'test 2')
|
|
165
172
|
assert.equal(context.convos[0].conversation[1].not, true)
|
|
166
173
|
})
|
|
174
|
+
|
|
167
175
|
it('should read !! as !', async function () {
|
|
168
176
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_two_exclamation.xlsx'))
|
|
169
177
|
const context = buildContext()
|
|
@@ -175,6 +183,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
175
183
|
assert.equal(context.convos[0].conversation[1].messageText, '!test 2')
|
|
176
184
|
assert.equal(context.convos[0].conversation[1].not, false)
|
|
177
185
|
})
|
|
186
|
+
|
|
178
187
|
it('should read n*! as (n-1)*!', async function () {
|
|
179
188
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_four_exclamation.xlsx'))
|
|
180
189
|
const context = buildContext()
|
|
@@ -187,6 +196,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
187
196
|
assert.equal(context.convos[0].conversation[1].messageText, '!!!test 2')
|
|
188
197
|
assert.equal(context.convos[0].conversation[1].not, false)
|
|
189
198
|
})
|
|
199
|
+
|
|
190
200
|
it('should read ! as ! in second line', async function () {
|
|
191
201
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_exclamation_secline.xlsx'))
|
|
192
202
|
const context = buildContext()
|
|
@@ -199,6 +209,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
199
209
|
assert.equal(context.convos[0].conversation[1].not, true)
|
|
200
210
|
})
|
|
201
211
|
})
|
|
212
|
+
|
|
202
213
|
describe('optional', function () {
|
|
203
214
|
it('should read ? as optional', async function () {
|
|
204
215
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_question.xlsx'))
|
|
@@ -212,6 +223,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
212
223
|
assert.equal(context.convos[0].conversation[1].messageText, 'test 2')
|
|
213
224
|
assert.equal(context.convos[0].conversation[1].optional, true)
|
|
214
225
|
})
|
|
226
|
+
|
|
215
227
|
it('should read ?? as ?', async function () {
|
|
216
228
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_two_question.xlsx'))
|
|
217
229
|
const context = buildContext()
|
|
@@ -223,6 +235,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
223
235
|
assert.equal(context.convos[0].conversation[1].messageText, '?test 2')
|
|
224
236
|
assert.equal(context.convos[0].conversation[1].optional, false)
|
|
225
237
|
})
|
|
238
|
+
|
|
226
239
|
it('should read n*? as (n-1)*?', async function () {
|
|
227
240
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_four_question.xlsx'))
|
|
228
241
|
const context = buildContext()
|
|
@@ -235,6 +248,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
235
248
|
assert.equal(context.convos[0].conversation[1].messageText, '???test 2')
|
|
236
249
|
assert.equal(context.convos[0].conversation[1].optional, false)
|
|
237
250
|
})
|
|
251
|
+
|
|
238
252
|
it('should read ? as ? in second line', async function () {
|
|
239
253
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_question_secline.xlsx'))
|
|
240
254
|
const context = buildContext()
|
|
@@ -247,6 +261,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
247
261
|
assert.equal(context.convos[0].conversation[1].optional, true)
|
|
248
262
|
})
|
|
249
263
|
})
|
|
264
|
+
|
|
250
265
|
describe('optional and negate', function () {
|
|
251
266
|
it('should read ?! as optional and not', async function () {
|
|
252
267
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_question_exclamation.xlsx'))
|
|
@@ -260,6 +275,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
260
275
|
assert.equal(context.convos[0].conversation[1].optional, true)
|
|
261
276
|
assert.equal(context.convos[0].conversation[1].not, true)
|
|
262
277
|
})
|
|
278
|
+
|
|
263
279
|
it('should read ??! as ?!', async function () {
|
|
264
280
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_with_two_question_exclamation.xlsx'))
|
|
265
281
|
const context = buildContext()
|
|
@@ -272,6 +288,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
272
288
|
assert.equal(context.convos[0].conversation[1].not, false)
|
|
273
289
|
})
|
|
274
290
|
})
|
|
291
|
+
|
|
275
292
|
describe('logichooks', function () {
|
|
276
293
|
it('should accept logic hook if it is before message', async function () {
|
|
277
294
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_logichook_after.xlsx'))
|
|
@@ -284,6 +301,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
284
301
|
const convo = context.convos[0]
|
|
285
302
|
assert.equal(convo.conversation[0].logicHooks.length, 1)
|
|
286
303
|
})
|
|
304
|
+
|
|
287
305
|
it('should throw error if logic hook is after message', async function () {
|
|
288
306
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_logichook_before.xlsx'))
|
|
289
307
|
const context = buildContextWithPause()
|
|
@@ -324,6 +342,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
324
342
|
assert.equal(context.convos[3].conversation[1].messageText, 'test 4')
|
|
325
343
|
assert.lengthOf(context.utterances, 0)
|
|
326
344
|
})
|
|
345
|
+
|
|
327
346
|
it('should read 2 convos and no utterances in simplified mode forced', async function () {
|
|
328
347
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_simplified_to_force.xlsx'))
|
|
329
348
|
const context = buildContext()
|
|
@@ -343,6 +362,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
343
362
|
assert.equal(context.convos[1].conversation[1].messageText, 'test 4')
|
|
344
363
|
assert.lengthOf(context.utterances, 0)
|
|
345
364
|
})
|
|
365
|
+
|
|
346
366
|
it('should sort convos by position in file', async function () {
|
|
347
367
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_sortorder.xlsx'))
|
|
348
368
|
const context = buildContext()
|
|
@@ -359,6 +379,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
359
379
|
assert.equal(context.convos[3].header.name, 'Convos1-A011')
|
|
360
380
|
assert.equal(context.convos[4].header.name, 'Convos1-A014')
|
|
361
381
|
})
|
|
382
|
+
|
|
362
383
|
it('should fail on intermixing q&a and convo sections', async function () {
|
|
363
384
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_mix_qa_and_convos.xlsx'))
|
|
364
385
|
const context = buildContext()
|
|
@@ -374,6 +395,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
374
395
|
assert.isTrue(err.message.indexOf('Excel sheet "Convos1" invalid. Detected intermixed Q&A sections (for instance A5) and convo sections (for instance A2,B3)') >= 0)
|
|
375
396
|
}
|
|
376
397
|
})
|
|
398
|
+
|
|
377
399
|
it('should read sheet names from filter with full match', async function () {
|
|
378
400
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_sheetnames.xlsx'))
|
|
379
401
|
const context = buildContext()
|
|
@@ -386,6 +408,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
386
408
|
compiler.Compile(scriptBuffer, 'SCRIPTING_TYPE_CONVO')
|
|
387
409
|
assert.lengthOf(context.convos, 2)
|
|
388
410
|
})
|
|
411
|
+
|
|
389
412
|
it('should read sheet names from filter with wildcard', async function () {
|
|
390
413
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_sheetnames.xlsx'))
|
|
391
414
|
const context = buildContext()
|
|
@@ -398,6 +421,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
398
421
|
compiler.Compile(scriptBuffer, 'SCRIPTING_TYPE_CONVO')
|
|
399
422
|
assert.lengthOf(context.convos, 3)
|
|
400
423
|
})
|
|
424
|
+
|
|
401
425
|
it('should read 3 convos with name', async function () {
|
|
402
426
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_with_names.xlsx'))
|
|
403
427
|
const context = buildContext()
|
|
@@ -422,6 +446,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
422
446
|
|
|
423
447
|
assert.lengthOf(context.utterances, 0)
|
|
424
448
|
})
|
|
449
|
+
|
|
425
450
|
it('should read 3 convos with name (forced)', async function () {
|
|
426
451
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_with_names_noheader.xlsx'))
|
|
427
452
|
const context = buildContext()
|
|
@@ -448,6 +473,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
448
473
|
|
|
449
474
|
assert.lengthOf(context.utterances, 0)
|
|
450
475
|
})
|
|
476
|
+
|
|
451
477
|
it('should read 3 convos without name (forced)', async function () {
|
|
452
478
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_without_names.xlsx'))
|
|
453
479
|
const context = buildContext()
|
|
@@ -473,6 +499,7 @@ describe('compiler.compilerxlsx', function () {
|
|
|
473
499
|
|
|
474
500
|
assert.lengthOf(context.utterances, 0)
|
|
475
501
|
})
|
|
502
|
+
|
|
476
503
|
it('should read 3 convos without name (forced) 2', async function () {
|
|
477
504
|
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_without_names_noheader.xlsx'))
|
|
478
505
|
const context = buildContext()
|
|
@@ -310,6 +310,7 @@ describe('connectors.simplerest', function () {
|
|
|
310
310
|
scope.persist(false)
|
|
311
311
|
})
|
|
312
312
|
|
|
313
|
+
/*
|
|
313
314
|
it('error case chat endpoint timeout', async function () {
|
|
314
315
|
const caps = {
|
|
315
316
|
[Capabilities.CONTAINERMODE]: 'simplerest',
|
|
@@ -319,7 +320,7 @@ describe('connectors.simplerest', function () {
|
|
|
319
320
|
}
|
|
320
321
|
const scope = nock('https://mock2.com')
|
|
321
322
|
.get('/endpointTimeout')
|
|
322
|
-
.
|
|
323
|
+
.delay(200)
|
|
323
324
|
.reply(200, {
|
|
324
325
|
status: 'ok'
|
|
325
326
|
})
|
|
@@ -340,6 +341,7 @@ describe('connectors.simplerest', function () {
|
|
|
340
341
|
await container.Clean()
|
|
341
342
|
scope.persist(false)
|
|
342
343
|
})
|
|
344
|
+
*/
|
|
343
345
|
|
|
344
346
|
it('should follow redirect', async function () {
|
|
345
347
|
const caps = {
|