botium-core 1.13.1 → 1.13.4

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 (56) hide show
  1. package/.eslintrc.js +6 -3
  2. package/dist/botium-cjs.js +291 -86
  3. package/dist/botium-cjs.js.map +1 -1
  4. package/dist/botium-es.js +290 -86
  5. package/dist/botium-es.js.map +1 -1
  6. package/package.json +3 -1
  7. package/src/Capabilities.js +4 -1
  8. package/src/Defaults.js +4 -0
  9. package/src/containers/plugins/SimpleRestContainer.js +23 -16
  10. package/src/grid/inbound/proxy.js +2 -1
  11. package/src/mocks/BotiumMockScripting.js +1 -0
  12. package/src/scripting/Convo.js +16 -10
  13. package/src/scripting/MatchFunctions.js +10 -0
  14. package/src/scripting/ScriptingProvider.js +162 -69
  15. package/src/scripting/logichook/LogicHookConsts.js +1 -1
  16. package/src/scripting/logichook/asserter/WerAsserter.js +59 -0
  17. package/src/scripting/logichook/logichooks/UpdateCustomLogicHook.js +3 -2
  18. package/test/compiler/compilercsv.spec.js +104 -3
  19. package/test/compiler/compilerjson.spec.js +0 -2
  20. package/test/compiler/compilerxlsx.spec.js +1 -1
  21. package/test/compiler/convos/csv/utterances_liveperson2.csv +12 -0
  22. package/test/connectors/simplerest.spec.js +1012 -969
  23. package/test/convo/fillAndApplyScriptingMemory.spec.js +804 -785
  24. package/test/convo/partialconvo.spec.js +345 -339
  25. package/test/driver/capabilities.spec.js +156 -151
  26. package/test/logichooks/hookfromsrc.spec.js +79 -73
  27. package/test/plugins/plugins.spec.js +44 -42
  28. package/test/scripting/asserters/buttonsAsserter.spec.js +257 -240
  29. package/test/scripting/asserters/cardsAsserter.spec.js +214 -212
  30. package/test/scripting/asserters/convos/wer_threshold_nok.yml +7 -0
  31. package/test/scripting/asserters/convos/wer_threshold_ok.yml +7 -0
  32. package/test/scripting/asserters/intentConfidenceAsserter.spec.js +34 -35
  33. package/test/scripting/asserters/jsonpathAsserter.spec.js +307 -308
  34. package/test/scripting/asserters/mediaAsserter.spec.js +236 -234
  35. package/test/scripting/asserters/werAsserter.spec.js +51 -0
  36. package/test/scripting/logichooks/setClearScriptingMemory.spec.js +202 -192
  37. package/test/scripting/matching/matchingmode.spec.js +306 -258
  38. package/test/scripting/scriptingProvider.spec.js +720 -630
  39. package/test/scripting/scriptingmemory/fillScriptingMemoryFromFile.spec.js +299 -281
  40. package/test/scripting/scriptingmemory/useScriptingMemoryForAssertion.spec.js +94 -80
  41. package/test/scripting/userinputs/defaultUserInputs.spec.js +233 -127
  42. package/test/scripting/userinputs/mediaInputConvos.spec.js +409 -403
  43. package/test/scripting/utteranceexpansion/associateByIndex.spec.js +259 -0
  44. package/test/scripting/utteranceexpansion/convos/associate_utterances_by_index.json +33 -0
  45. package/test/scripting/utteranceexpansion/convos/media.convo.txt +19 -0
  46. package/test/scripting/utteranceexpansion/files/step0voice0.wav +0 -0
  47. package/test/scripting/utteranceexpansion/files/step0voice1.wav +0 -0
  48. package/test/scripting/utteranceexpansion/files/step0voice2.wav +0 -0
  49. package/test/scripting/utteranceexpansion/files/step1voice0.wav +0 -0
  50. package/test/scripting/utteranceexpansion/files/step2voice0.wav +0 -0
  51. package/test/scripting/utteranceexpansion/files/step2voice1.wav +0 -0
  52. package/test/scripting/utteranceexpansion/files/step2voice2.wav +0 -0
  53. package/test/scripting/utteranceexpansion/files/step2voice4.wav +0 -0
  54. package/test/scripting/utteranceexpansion/files/step2voice5.wav +0 -0
  55. package/test/security/allowUnsafe.spec.js +274 -268
  56. package/test/utils.spec.js +40 -38
@@ -1,48 +1,50 @@
1
1
  const assert = require('chai').assert
2
2
  const { escapeJSONString, formatTimeout } = require('../src/helpers/Utils')
3
3
 
4
- describe('utils.escapeJSON', function () {
5
- it('should not modify JSON string which is not containing double quotes', () => {
6
- assert.equal(
7
- escapeJSONString('test 123'),
8
- 'test 123',
9
- 'JSON string should not be modified'
10
- )
11
- })
4
+ describe('utils', function () {
5
+ describe('escapeJSON', function () {
6
+ it('should not modify JSON string which is not containing double quotes', function () {
7
+ assert.equal(
8
+ escapeJSONString('test 123'),
9
+ 'test 123',
10
+ 'JSON string should not be modified'
11
+ )
12
+ })
12
13
 
13
- it('should escape nested double quotes within JSON string', () => {
14
- assert.equal(
15
- escapeJSONString('{"test 123"}'),
16
- '{\\"test 123\\"}',
17
- 'nested double quotes should be escaped within JSON string'
18
- )
19
- })
14
+ it('should escape nested double quotes within JSON string', function () {
15
+ assert.equal(
16
+ escapeJSONString('{"test 123"}'),
17
+ '{\\"test 123\\"}',
18
+ 'nested double quotes should be escaped within JSON string'
19
+ )
20
+ })
20
21
 
21
- it('should not escape nested single quotes within JSON string', () => {
22
- assert.equal(
23
- escapeJSONString("{'test 123'}"),
24
- "{'test 123'}",
25
- 'nested single quotes should not be escaped within JSON string'
26
- )
27
- })
22
+ it('should not escape nested single quotes within JSON string', function () {
23
+ assert.equal(
24
+ escapeJSONString('{\'test 123\'}'),
25
+ '{\'test 123\'}',
26
+ 'nested single quotes should not be escaped within JSON string'
27
+ )
28
+ })
28
29
 
29
- it('should escape nested newline within JSON string', () => {
30
- assert.equal(
31
- escapeJSONString('test \n123'),
32
- 'test \\n123',
33
- 'nested newlines should be escaped within JSON string'
34
- )
30
+ it('should escape nested newline within JSON string', function () {
31
+ assert.equal(
32
+ escapeJSONString('test \n123'),
33
+ 'test \\n123',
34
+ 'nested newlines should be escaped within JSON string'
35
+ )
36
+ })
35
37
  })
36
- })
37
38
 
38
- describe('utils.formatTimeout', function () {
39
- it('should format seconds', () => {
40
- assert.equal(formatTimeout(2000), '2s')
41
- })
42
- it('should format milliseconds', () => {
43
- assert.equal(formatTimeout(800), '800ms')
44
- })
45
- it('should format seconds and milliseconds', () => {
46
- assert.equal(formatTimeout(2400), '2s 400ms')
39
+ describe('formatTimeout', function () {
40
+ it('should format seconds', function () {
41
+ assert.equal(formatTimeout(2000), '2s')
42
+ })
43
+ it('should format milliseconds', function () {
44
+ assert.equal(formatTimeout(800), '800ms')
45
+ })
46
+ it('should format seconds and milliseconds', function () {
47
+ assert.equal(formatTimeout(2400), '2s 400ms')
48
+ })
47
49
  })
48
50
  })