botium-core 1.13.12 → 1.13.15
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 +109 -57
- package/dist/botium-cjs.js.map +1 -1
- package/dist/botium-es.js +95 -44
- package/dist/botium-es.js.map +1 -1
- package/index.js +15 -9
- package/package.json +1 -1
- package/report.js +6 -5
- package/src/Capabilities.js +4 -0
- package/src/containers/plugins/SimpleRestContainer.js +50 -22
- package/src/helpers/TranscriptUtils.js +12 -0
- package/test/compiler/compilermarkdown.spec.js +11 -11
- package/test/compiler/compilertxt.spec.js +11 -11
- package/test/compiler/compilerxlsx.spec.js +10 -10
- package/test/connectors/simplerest.spec.js +53 -4
- package/test/helpers/convos/hello.convo.txt +6 -0
- package/test/helpers/transcriptutils.spec.js +71 -0
- /package/test/compiler/convos/md/{convos_with!.md → convos_with_exclamation.md} +0 -0
- /package/test/compiler/convos/md/{convos_with!_secline.md → convos_with_exclamation_secline.md} +0 -0
- /package/test/compiler/convos/md/{convos_with!!!!.md → convos_with_four_exclamation.md} +0 -0
- /package/test/compiler/convos/md/{convos_with????.md → convos_with_four_question.md} +0 -0
- /package/test/compiler/convos/md/{convos_with?.md → convos_with_question.md} +0 -0
- /package/test/compiler/convos/md/{convos_with?!.md → convos_with_question_exclamation.md} +0 -0
- /package/test/compiler/convos/md/{convos_with?_invalid.md → convos_with_question_invalid.md} +0 -0
- /package/test/compiler/convos/md/{convos_with?_secline.md → convos_with_question_secline.md} +0 -0
- /package/test/compiler/convos/md/{convos_with!!.md → convos_with_two_exclamation.md} +0 -0
- /package/test/compiler/convos/md/{convos_with??.md → convos_with_two_question.md} +0 -0
- /package/test/compiler/convos/md/{convos_with??!.md → convos_with_two_question_exclamation.md} +0 -0
- /package/test/compiler/convos/txt/{convos_with!.convo.txt → convos_with_exclamation.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with!_secline.convo.txt → convos_with_exclamation_secline.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with!!!!.convo.txt → convos_with_four_exclamation.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with????.convo.txt → convos_with_four_question.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with_#.convo.txt → convos_with_hashmark.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with?.convo.txt → convos_with_question.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with?!.convo.txt → convos_with_question_exclamation.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with?_secline.convo.txt → convos_with_question_secline.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with!!.convo.txt → convos_with_two_exclamation.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with??.convo.txt → convos_with_two_question.convo.txt} +0 -0
- /package/test/compiler/convos/txt/{convos_with??!.convo.txt → convos_with_two_question_exclamation.convo.txt} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with!.xlsx → convos_with_exclamation.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with!_secline.xlsx → convos_with_exclamation_secline.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with!!!!.xlsx → convos_with_four_exclamation.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with????.xlsx → convos_with_four_question.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with?.xlsx → convos_with_question.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with?!.xlsx → convos_with_question_exclamation.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with?_secline.xlsx → convos_with_question_secline.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with!!.xlsx → convos_with_two_exclamation.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with??.xlsx → convos_with_two_question.xlsx} +0 -0
- /package/test/compiler/convos/xlsx/{convos_with??!.xlsx → convos_with_two_question_exclamation.xlsx} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const assert = require('chai').assert
|
|
3
|
+
const BotDriver = require('../../').BotDriver
|
|
4
|
+
const Capabilities = require('../../').Capabilities
|
|
5
|
+
const TranscriptUtils = require('../../').TranscriptUtils
|
|
6
|
+
const debug = require('debug')('botium-test-transcriptutils')
|
|
7
|
+
const util = require('util')
|
|
8
|
+
|
|
9
|
+
const createEchoConnector = () => ({ queueBotSays, caps }) => {
|
|
10
|
+
return {
|
|
11
|
+
UserSays (msg) {
|
|
12
|
+
const prefix = `Testcase "${caps[Capabilities.PROJECTNAME]}"`
|
|
13
|
+
debug(`${prefix} Connector got message ${util.inspect(msg)}`)
|
|
14
|
+
const botMsg = {
|
|
15
|
+
sender: 'bot',
|
|
16
|
+
sourceData: msg.sourceData,
|
|
17
|
+
messageText: msg.messageText
|
|
18
|
+
}
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
debug(`${prefix} Connector send message ${util.inspect(botMsg)}`)
|
|
21
|
+
return queueBotSays(botMsg)
|
|
22
|
+
}, caps.WAITECHO)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('helpers.transcriptutils', function () {
|
|
28
|
+
describe('hasTimeout', function () {
|
|
29
|
+
it('should return true ontimeout', async function () {
|
|
30
|
+
const myCaps = {
|
|
31
|
+
[Capabilities.PROJECTNAME]: 'helpers.transcriptutils.hasTimeout should should return true ontimeout',
|
|
32
|
+
[Capabilities.CONTAINERMODE]: createEchoConnector(),
|
|
33
|
+
[Capabilities.WAITFORBOTTIMEOUT]: 0,
|
|
34
|
+
WAITECHO: 20
|
|
35
|
+
}
|
|
36
|
+
const driver = new BotDriver(myCaps)
|
|
37
|
+
const compiler = driver.BuildCompiler()
|
|
38
|
+
const container = await driver.Build()
|
|
39
|
+
|
|
40
|
+
compiler.ReadScript(path.resolve(__dirname, 'convos'), 'hello.convo.txt')
|
|
41
|
+
assert.equal(compiler.convos.length, 1)
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
await compiler.convos[0].Run(container)
|
|
45
|
+
assert.fail('should have failed with timeout')
|
|
46
|
+
} catch (err) {
|
|
47
|
+
if (!TranscriptUtils.hasWaitForBotTimeout(err)) {
|
|
48
|
+
throw err
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
await container.Clean()
|
|
52
|
+
})
|
|
53
|
+
it('should return false if there is no timeout', async function () {
|
|
54
|
+
const myCaps = {
|
|
55
|
+
[Capabilities.PROJECTNAME]: 'helpers.transcriptutils.hasTimeout should return false if there is no timeout',
|
|
56
|
+
[Capabilities.CONTAINERMODE]: createEchoConnector(),
|
|
57
|
+
[Capabilities.WAITFORBOTTIMEOUT]: 50,
|
|
58
|
+
WAITECHO: 20
|
|
59
|
+
}
|
|
60
|
+
const driver = new BotDriver(myCaps)
|
|
61
|
+
const compiler = driver.BuildCompiler()
|
|
62
|
+
const container = await driver.Build()
|
|
63
|
+
|
|
64
|
+
compiler.ReadScript(path.resolve(__dirname, 'convos'), 'hello.convo.txt')
|
|
65
|
+
assert.equal(compiler.convos.length, 1)
|
|
66
|
+
|
|
67
|
+
await compiler.convos[0].Run(container)
|
|
68
|
+
await container.Clean()
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
})
|
|
File without changes
|
/package/test/compiler/convos/md/{convos_with!_secline.md → convos_with_exclamation_secline.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/md/{convos_with?_invalid.md → convos_with_question_invalid.md}
RENAMED
|
File without changes
|
/package/test/compiler/convos/md/{convos_with?_secline.md → convos_with_question_secline.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/md/{convos_with??!.md → convos_with_two_question_exclamation.md}
RENAMED
|
File without changes
|
/package/test/compiler/convos/txt/{convos_with!.convo.txt → convos_with_exclamation.convo.txt}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/txt/{convos_with????.convo.txt → convos_with_four_question.convo.txt}
RENAMED
|
File without changes
|
/package/test/compiler/convos/txt/{convos_with_#.convo.txt → convos_with_hashmark.convo.txt}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/txt/{convos_with!!.convo.txt → convos_with_two_exclamation.convo.txt}
RENAMED
|
File without changes
|
/package/test/compiler/convos/txt/{convos_with??.convo.txt → convos_with_two_question.convo.txt}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/xlsx/{convos_with!!!!.xlsx → convos_with_four_exclamation.xlsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/xlsx/{convos_with?!.xlsx → convos_with_question_exclamation.xlsx}
RENAMED
|
File without changes
|
/package/test/compiler/convos/xlsx/{convos_with?_secline.xlsx → convos_with_question_secline.xlsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/test/compiler/convos/xlsx/{convos_with??!.xlsx → convos_with_two_question_exclamation.xlsx}
RENAMED
|
File without changes
|