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.
Files changed (84) hide show
  1. package/dist/botium-cjs.js +91 -51
  2. package/dist/botium-cjs.js.map +1 -1
  3. package/dist/botium-es.js +91 -50
  4. package/dist/botium-es.js.map +1 -1
  5. package/package.json +35 -40
  6. package/src/BotDriver.js +1 -1
  7. package/src/Events.js +1 -3
  8. package/src/containers/GridContainer.js +0 -4
  9. package/src/mocks/BotiumMockScripting.js +3 -0
  10. package/src/scripting/Convo.js +10 -0
  11. package/src/utils/boolean.js +39 -0
  12. package/test/compiler/compilercsv.spec.js +34 -0
  13. package/test/compiler/compilermarkdown.spec.js +11 -0
  14. package/test/compiler/compilertxt.spec.js +21 -0
  15. package/test/compiler/compilerxlsx.spec.js +27 -0
  16. package/test/compiler/precompilerjson.spec.js +1 -0
  17. package/test/compiler/precompilermarkdownrasa.spec.js +1 -0
  18. package/test/connectors/pluginconnectorcontainer.spec.js +1 -0
  19. package/test/connectors/simplerest.spec.js +3 -1
  20. package/test/convo/failure.spec.js +1 -0
  21. package/test/convo/fillAndApplyScriptingMemory.spec.js +56 -0
  22. package/test/convo/partialconvo.spec.js +3 -0
  23. package/test/convo/retry.spec.js +9 -0
  24. package/test/convo/retryasserter.spec.js +9 -0
  25. package/test/convo/transcript.spec.js +33 -0
  26. package/test/convo/tree.spec.js +5 -0
  27. package/test/driver/capabilities.spec.js +16 -0
  28. package/test/helpers/capabilitiesutils.spec.js +8 -0
  29. package/test/helpers/transcriptutils.spec.js +1 -0
  30. package/test/hooks/customhooks.spec.js +3 -0
  31. package/test/logichooks/hookfromsrc.spec.js +3 -0
  32. package/test/logichooks/textfromhook.spec.js +1 -0
  33. package/test/plugins/plugins.spec.js +3 -0
  34. package/test/scripting/asserters/buttonsAsserter.spec.js +15 -0
  35. package/test/scripting/asserters/cardsAsserter.spec.js +12 -0
  36. package/test/scripting/asserters/convoStepParameters.spec.js +11 -0
  37. package/test/scripting/asserters/entitiesAsserter.spec.js +1 -0
  38. package/test/scripting/asserters/entityValuesAsserter.spec.js +7 -0
  39. package/test/scripting/asserters/formsAsserter.spec.js +10 -0
  40. package/test/scripting/asserters/intentAsserter.spec.js +4 -0
  41. package/test/scripting/asserters/intentUniqueAsserter.spec.js +2 -0
  42. package/test/scripting/asserters/jsonpathAsserter.spec.js +25 -0
  43. package/test/scripting/asserters/mediaAsserter.spec.js +20 -0
  44. package/test/scripting/asserters/responseLengthAsserter.spec.js +4 -0
  45. package/test/scripting/asserters/textAsserter.spec.js +1 -0
  46. package/test/scripting/asserters/textContainsAllAsserter.spec.js +1 -0
  47. package/test/scripting/asserters/textContainsAnyAsserter.spec.js +1 -0
  48. package/test/scripting/asserters/textEqualsAsserter.spec.js +1 -0
  49. package/test/scripting/asserters/textRegexpAllAsserter.spec.js +1 -0
  50. package/test/scripting/asserters/textRegexpAnyAsserter.spec.js +1 -0
  51. package/test/scripting/asserters/textWildcardAllAsserter.spec.js +1 -0
  52. package/test/scripting/asserters/textWildcardAnyAsserter.spec.js +1 -0
  53. package/test/scripting/asserters/textWildcardExactAllAsserter.spec.js +1 -0
  54. package/test/scripting/asserters/textWildcardExactAnyAsserter.spec.js +1 -0
  55. package/test/scripting/asserters/werAsserter.spec.js +6 -0
  56. package/test/scripting/logichooks/convos/scripting_memory_resolved_args.convo.txt +11 -0
  57. package/test/scripting/logichooks/customConditionalStepLogicHook.spec.js +2 -0
  58. package/test/scripting/logichooks/localvsglobal.spec.js +1 -0
  59. package/test/scripting/logichooks/pauseLogic.spec.js +4 -0
  60. package/test/scripting/logichooks/setClearScriptingMemory.spec.js +17 -0
  61. package/test/scripting/logichooks/updateCustom.spec.js +2 -0
  62. package/test/scripting/matching/matchingmode.spec.js +48 -0
  63. package/test/scripting/scriptingModificator.spec.js +1 -0
  64. package/test/scripting/scriptingmemory/fillScriptingMemoryFromFile.spec.js +4 -0
  65. package/test/scripting/scriptingmemory/regexp.spec.js +1 -0
  66. package/test/scripting/scriptingmemory/useScriptingMemoryForAssertion.spec.js +3 -0
  67. package/test/scripting/txt/decompile.spec.js +20 -0
  68. package/test/scripting/userinputs/buttonInputConvos.spec.js +1 -0
  69. package/test/scripting/userinputs/defaultUserInputs.spec.js +13 -0
  70. package/test/scripting/userinputs/mediaInputConvos.spec.js +10 -0
  71. package/test/scripting/utteranceexpansion/associateByIndex.spec.js +2 -0
  72. package/test/security/allowUnsafe.spec.js +5 -0
  73. package/test/utils.spec.js +2 -0
  74. package/samples/postman/Botium Agent Sample.postman_collection.json +0 -834
  75. package/samples/postman/README.md +0 -5
  76. package/samples/postman/botiumFluent.js +0 -37
  77. package/src/grid/agent/AgentWorker.js +0 -204
  78. package/src/grid/agent/agent.js +0 -96
  79. package/src/grid/agent/agentworkerpool.js +0 -58
  80. package/src/grid/agent/routes.js +0 -353
  81. package/src/grid/agent/swagger.json +0 -327
  82. package/src/grid/agent/swaggerDef.json +0 -8
  83. package/src/grid/agent/views/index.html +0 -39
  84. package/test/grid/agent/client.js +0 -65
@@ -30,6 +30,7 @@ describe('scripting.userinputs.mediaInputConvos', function () {
30
30
  this.compiler = driver.BuildCompiler()
31
31
  this.container = await driver.Build()
32
32
  })
33
+
33
34
  afterEach(async function () {
34
35
  this.container && await this.container.Clean()
35
36
  })
@@ -82,6 +83,7 @@ describe('scripting.userinputs.mediaInputConvos', function () {
82
83
  assert.isTrue(transcript.steps[0].actual.media[1].downloadUri.endsWith('test/scripting/userinputs/convos/test2.jpg'))
83
84
  assert.equal(transcript.steps[0].actual.media[1].mimeType, 'image/jpeg')
84
85
  })
86
+
85
87
  it('should expand media list in user message', async function () {
86
88
  this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'medialist.convo.txt')
87
89
  this.compiler.ExpandConvos()
@@ -92,6 +94,7 @@ describe('scripting.userinputs.mediaInputConvos', function () {
92
94
  assert.equal(this.compiler.convos[1].conversation[0].userInputs[0].args[0], 'test2.jpg')
93
95
  assert.equal(this.compiler.convos[2].conversation[0].userInputs[0].args[0], 'test3.jpg')
94
96
  })
97
+
95
98
  it('should expand media wc from convoDir in user message', async function () {
96
99
  this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'mediawc.convo.txt')
97
100
  this.compiler.ExpandConvos()
@@ -148,6 +151,7 @@ MEDIA ${mediaUri}
148
151
  this.compiler = driver.BuildCompiler()
149
152
  this.container = await driver.Build()
150
153
  })
154
+
151
155
  afterEach(async function () {
152
156
  this.container && await this.container.Clean()
153
157
  })
@@ -205,6 +209,7 @@ MEDIA ${mediaUri}
205
209
  this.compiler = driver.BuildCompiler()
206
210
  this.container = await driver.Build()
207
211
  })
212
+
208
213
  afterEach(async function () {
209
214
  this.container && await this.container.Clean()
210
215
  })
@@ -221,6 +226,7 @@ MEDIA ${mediaUri}
221
226
  assert.equal(transcript.steps[0].actual.media[0].downloadUri, 'https://www.google.at/botium.png')
222
227
  assert.equal(transcript.steps[0].actual.media[0].mimeType, 'image/png')
223
228
  })
229
+
224
230
  it('should add media with default baseUri in user message', async function () {
225
231
  this.compiler.ReadScript(path.resolve(__dirname, 'convos'), 'media.convo.txt')
226
232
  assert.equal(this.compiler.convos.length, 1)
@@ -258,6 +264,7 @@ MEDIA ${mediaUri}
258
264
  this.compiler = driver.BuildCompiler()
259
265
  this.container = await driver.Build()
260
266
  })
267
+
261
268
  afterEach(async function () {
262
269
  this.container && await this.container.Clean()
263
270
  })
@@ -297,6 +304,7 @@ MEDIA ${mediaUri}
297
304
  this.compiler = driver.BuildCompiler()
298
305
  this.container = await driver.Build()
299
306
  })
307
+
300
308
  afterEach(async function () {
301
309
  this.container && await this.container.Clean()
302
310
  })
@@ -393,6 +401,7 @@ MEDIA ${mediaUri}
393
401
  this.compiler = driver.BuildCompiler()
394
402
  this.container = await driver.Build()
395
403
  })
404
+
396
405
  afterEach(async function () {
397
406
  this.container && await this.container.Clean()
398
407
  })
@@ -430,6 +439,7 @@ MEDIA ${mediaUri}
430
439
  this.compiler = driver.BuildCompiler()
431
440
  this.container = await driver.Build()
432
441
  })
442
+
433
443
  afterEach(async function () {
434
444
  this.container && await this.container.Clean()
435
445
  })
@@ -81,6 +81,7 @@ describe('scripting.utteranceexpansion.associateByIndex', function () {
81
81
  assert.equal(scriptingProvider.convos[4].header.name, 'test convo/UTT_HELLO-L3/UTT_GOODBYE-L5')
82
82
  assert.deepEqual(scriptingProvider.convos[4].conversation.length, 6)
83
83
  })
84
+
84
85
  it('should associate media by index', async function () {
85
86
  const scriptingProvider = new ScriptingProvider(CAPS)
86
87
  await scriptingProvider.Build()
@@ -151,6 +152,7 @@ describe('scripting.utteranceexpansion.associateByIndex', function () {
151
152
  assert.equal(scriptingProvider.convos[4].header.name, 'test convo/MEDIA-step0voice2.wav/MEDIA-step2voice5.wav')
152
153
  assert.deepEqual(scriptingProvider.convos[4].conversation.length, 6)
153
154
  })
155
+
154
156
  it('should associate utterance and media by index', async function () {
155
157
  const scriptingProvider = new ScriptingProvider(CAPS)
156
158
  await scriptingProvider.Build()
@@ -46,6 +46,7 @@ describe('security.allowUnsafe', function () {
46
46
  [Capabilities.SECURITY_ALLOW_UNSAFE]: false
47
47
  }, () => null)
48
48
  })
49
+
49
50
  it('should not accept file hook in safe mode', async function () {
50
51
  try {
51
52
  HookUtils.getHook({
@@ -57,12 +58,14 @@ describe('security.allowUnsafe', function () {
57
58
  assert.isTrue(err.message.indexOf('invalid') >= 0)
58
59
  }
59
60
  })
61
+
60
62
  it('should accept file hook from safe dir in unsafe mode', async function () {
61
63
  HookUtils.getHook({
62
64
  [Capabilities.SECURITY_ALLOW_UNSAFE]: true,
63
65
  [Capabilities.SAFEDIR]: 'test/security/'
64
66
  }, 'resources/hook-as-file.js')
65
67
  })
68
+
66
69
  it('should not accept file hook from outside safe dir', async function () {
67
70
  try {
68
71
  HookUtils.getHook({
@@ -74,6 +77,7 @@ describe('security.allowUnsafe', function () {
74
77
  assert.isTrue(err.message.indexOf('invalid') >= 0)
75
78
  }
76
79
  })
80
+
77
81
  it('should accept require hook in unsafe mode', async function () {
78
82
  HookUtils.getHook({
79
83
  [Capabilities.SECURITY_ALLOW_UNSAFE]: true
@@ -161,6 +165,7 @@ describe('security.allowUnsafe', function () {
161
165
  })
162
166
  await driver.Build()
163
167
  })
168
+
164
169
  it('should create any connector from safedir', async function () {
165
170
  const driver = new BotDriver({
166
171
  [Capabilities.SAFEDIR]: 'test/security/',
@@ -40,9 +40,11 @@ describe('utils', function () {
40
40
  it('should format seconds', function () {
41
41
  assert.equal(formatTimeout(2000), '2s')
42
42
  })
43
+
43
44
  it('should format milliseconds', function () {
44
45
  assert.equal(formatTimeout(800), '800ms')
45
46
  })
47
+
46
48
  it('should format seconds and milliseconds', function () {
47
49
  assert.equal(formatTimeout(2400), '2s 400ms')
48
50
  })