Classes

Tester
ResponseAssert
AnyResponseAssert
ConversationTester

Automated Conversation tests runner

Typedefs

TestSource : object
TestCase : object
TextCase : object
TextTest : object
TestCaseStep : object
TestsGroup : object
List : object
TestsDefinition : object
testerFactoryTester

Callback for getting a tester

TestsOutput : object
 

Tester

Kind: global class

 

new Tester()

Utility for testing requests

 

tester.testData

Kind: instance property of Tester
Properties

Name Type Description
predefined object test data to use
 

tester.allowEmptyResponse

Kind: instance property of Tester
Properties

Name Type Description
allow boolean tester to process empty responses
 

tester.senderLogger

Kind: instance property of Tester
Properties

Name Type Description
use console own loggger
 

tester.setExpandRandomTexts()

Enable tester to expand random texts It joins them into a single sting

Kind: instance method of Tester

 

tester.cleanup()

Clear acquired responses and data

Kind: instance method of Tester

 

tester.processMessage(message, senderId, pageId) ⇒ Promise.<any>

Use tester as a connector :)

Kind: instance method of Tester

Param Type Description
message object wingbot chat event
senderId string chat event sender identifier
pageId string channel/page identifier
 

tester.res([index]) ⇒ ResponseAssert

Returns single response asserter

Kind: instance method of Tester

Param Type Default Description
[index] number 0 response index
 

tester.any() ⇒ AnyResponseAssert

Returns any response asserter

Kind: instance method of Tester

 

tester.lastRes() ⇒ ResponseAssert

Returns last response asserter

Kind: instance method of Tester

 

tester.passedAction(path) ⇒ this

Checks, that app past the action

Kind: instance method of Tester

Param Type
path string
 

tester.respondedWithBlock(blockName) ⇒ this

Checks, that a plugin used a block as a responde

Kind: instance method of Tester

Param Type
blockName string
 

tester.getState() ⇒ object

Returns state

Kind: instance method of Tester

 

tester.setState([state])

Sets state with Object.assign()

Kind: instance method of Tester

Param Type Default
[state] object {}
 

tester.text(text) ⇒ Promise

Makes text request

Kind: instance method of Tester

Param Type
text string
 

tester.intent(intent, [text], [score]) ⇒ Promise

Makes recognised AI intent request

Kind: instance method of Tester

Param Type Default
intent string \ Array.<string>
[text] string null
[score] number
 

tester.intentWithEntity(intent, entity, [value], [text], [score]) ⇒ Promise

Makes recognised AI intent request with entity

Kind: instance method of Tester

Param Type Default
intent string
entity string
[value] string
[text] string
[score] number 1
 

tester.optin(action, [data], [userRef]) ⇒ Promise

Make optin call

Kind: instance method of Tester

Param Type Default Description
action string
[data] object {}
[userRef] string null specific ref string
 

tester.quickReply(action, [data]) ⇒ Promise

Send quick reply

Kind: instance method of Tester

Param Type Default
action string
[data] object {}
 

tester.quickReplyText(text) ⇒ Promise.<boolean>

Send quick reply if text exactly matches, otherwise returns false

Kind: instance method of Tester

Param Type
text string
 

tester.postBack(action, [data], [refAction], [refData]) ⇒ Promise

Sends postback, optionally with referrer action

Kind: instance method of Tester

Param Type Default Description
action string
[data] object {}
[refAction] string null referred action
[refData] object {} referred action data
 

Tester.Tester

Kind: static class of Tester

 

new Tester(reducer, [senderId], [pageId], [processorOptions], [storage])

Creates an instance of Tester.

Param Type Default Description
reducer Router \ ReducerWrapper \ function
[senderId] string null
[pageId] string null
[processorOptions] object {} options for Processor
[storage] MemoryStateStorage place to override the storage
 

ResponseAssert

Kind: global class

 

new ResponseAssert()

Utility for asserting single response

 

responseAssert.contains(search) ⇒ this

Checks, that response contains text

Kind: instance method of ResponseAssert

Param Type
search string
 

responseAssert.quickReplyAction(action) ⇒ this

Checks quick response action

Kind: instance method of ResponseAssert

Param Type
action string
 

responseAssert.templateType(type) ⇒ this

Checks template type

Kind: instance method of ResponseAssert

Param Type
type string
 

responseAssert.passThread([appId]) ⇒ this

Checks pass thread control

Kind: instance method of ResponseAssert

Param Type Default
[appId] string null
 

responseAssert.attachmentType(type) ⇒ this

Checks attachment type

Kind: instance method of ResponseAssert

Param Type
type string
 

ResponseAssert.AnyResponseAssert#contains(search) ⇒ this

Checks, that response contains a text

Kind: static method of ResponseAssert

Param Type
search string
 

ResponseAssert.AnyResponseAssert#notContains(search) ⇒ this

Checks, that response does NOT contain a text

Kind: static method of ResponseAssert

Param Type
search string
 

ResponseAssert.AnyResponseAssert#quickReplyAction(action) ⇒ this

Checks quick response action

Kind: static method of ResponseAssert

Param Type
action string
 

ResponseAssert.AnyResponseAssert#quickReplyTextContains(search) ⇒ this

Checks quick response text

Kind: static method of ResponseAssert

Param Type
search string
 

ResponseAssert.AnyResponseAssert#templateType(type) ⇒ this

Checks template type

Kind: static method of ResponseAssert

Param Type
type string
 

ResponseAssert.AnyResponseAssert#genericTemplate(itemCount)

Checks for generic template

Kind: static method of ResponseAssert

Param Type Default Description
itemCount number specified item count
 

ResponseAssert.AnyResponseAssert#buttonTemplate(search, buttonCount)

Checks for button template

Kind: static method of ResponseAssert

Param Type Default Description
search string
buttonCount number specified button count
 

ResponseAssert.AnyResponseAssert#passThread([appId]) ⇒ this

Checks pass thread control

Kind: static method of ResponseAssert

Param Type Default
[appId] string null
 

ResponseAssert.AnyResponseAssert#attachmentType(type) ⇒ this

Checks attachment type

Kind: static method of ResponseAssert

Param Type
type string
 

AnyResponseAssert

Kind: global class

 

new AnyResponseAssert()

Utility for searching among responses

 

ConversationTester

Automated Conversation tests runner

Kind: global class

 

new ConversationTester(testsSource, botFactory, [options])

Param Type
testsSource TestSource
botFactory function
[options] object
[options.disableAssertActions] boolean
[options.disableAssertTexts] boolean
[options.disableAssertQuickReplies] boolean
[options.useConversationForTextTestCases] boolean
[options.textThreshold] boolean
[options.stepCasesPerStep] number
[options.textCasesPerStep] number
[options.textCaseParallel] number
[options.testerFactory] testerFactory
 

conversationTester.test(validationRequestBody, step) ⇒ Promise.<TestsOutput>

Runs the conversation test

Kind: instance method of ConversationTester

Param Type Default
validationRequestBody object
step number
 

conversationTester._getLists(testCases) ⇒ Array.<List>

Kind: instance method of ConversationTester

Param Type
testCases Array.<TestCase> \ Array.<TextCase>
 

conversationTester._getListCases(testCases) ⇒ Map.<string, (Array.<TestCase>|Array.<TextCase>)>

Kind: instance method of ConversationTester

Param Type
testCases Array.<TestCase> \ Array.<TextCase>
 

conversationTester._getGroups(testCases) ⇒ Array.<TestsGroup>

Kind: instance method of ConversationTester

Param Type
testCases *
 

conversationTester._getTestsGroups(testsGroups, step)

Kind: instance method of ConversationTester

Param Type
testsGroups Array.<TestsGroup>
step number
 

conversationTester._createTester(testsGroup, [botconfig]) ⇒ Tester

Kind: instance method of ConversationTester

Param Type Default
testsGroup TestsGroup
[botconfig] object
 

conversationTester._runTextCaseTests(testsGroup, botconfig)

Kind: instance method of ConversationTester

Param Type Default
testsGroup TestsGroup
botconfig object
 

conversationTester._runStepCaseTests(testsGroup, botconfig)

Kind: instance method of ConversationTester

Param Type Default
testsGroup TestsGroup
botconfig object
 

conversationTester.executeTextCase(testsGroup, t, textCase, botconfig, longestText)

Kind: instance method of ConversationTester

Param Type
testsGroup TestsGroup
t Tester
textCase TextTest
botconfig *
longestText number
 

conversationTester.executeStep(t, step)

Kind: instance method of ConversationTester

Param Type
t Tester
step TestCaseStep
 

TestSource : object

Kind: global typedef
Properties

Name Type
getTestCases function
 

TestCase : object

Kind: global typedef
Properties

Name Type
list string
name string
steps Array.<TestCaseStep>
 

TextCase : object

Kind: global typedef
Properties

Name Type
list string
name string
texts Array.<TextTest>
 

TextTest : object

Kind: global typedef
Properties

Name Type
appId string
text string
action string
intent string
 

TestCaseStep : object

Kind: global typedef
Properties

Name Type
step number
rowNum number
action string
passedAction string
textContains string
quickRepliesContains string
stepDescription string
 

TestsGroup : object

Kind: global typedef
Properties

Name Type
listId number
list string
type string
testCases Array.<TestCase> \ Array.<TextTest>
 

List : object

Kind: global typedef
Properties

Name Type
id number
name string
type string
testCases Array.<TestCase> \ Array.<TextTest>
 

TestsDefinition : object

Kind: global typedef
Properties

Name Type
lists Array.<List>
 

testerFactory ⇒ Tester

Callback for getting a tester

Kind: global typedef

Param Type Description
bot Router \ ReducerWrapper the chatbot itself
test TestsGroup the chatbot itself
 

TestsOutput : object

Kind: global typedef
Properties

Name Type
total number
passed number
failed number
skipped number
output string
summaryOutput string
step number
stepCount number

results matching ""

    No results matching ""