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
Params

  • 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
Params

  • [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
Params

  • path string
 

tester.respondedWithBlock(blockName) ⇒ this

Checks, that a plugin used a block as a responde

Kind: instance method of Tester
Params

  • 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
Params

  • [state] object = {}
 

tester.text(text) ⇒ Promise

Makes text request

Kind: instance method of Tester
Params

  • text string
 

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

Makes recognised AI intent request

Kind: instance method of Tester
Params

  • 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
Params

  • 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
Params

  • action string
  • [data] object = {}
  • [userRef] string = null - specific ref string
 

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

Send quick reply

Kind: instance method of Tester
Params

  • action string
  • [data] object = {}
 

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

Send quick reply if text exactly matches, otherwise returns false

Kind: instance method of Tester
Params

  • text string
 

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

Sends postback, optionally with referrer action

Kind: instance method of Tester
Params

  • 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.

Params

  • 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
Params

  • search string
 

responseAssert.quickReplyAction(action) ⇒ this

Checks quick response action

Kind: instance method of ResponseAssert
Params

  • action string
 

responseAssert.templateType(type) ⇒ this

Checks template type

Kind: instance method of ResponseAssert
Params

  • type string
 

responseAssert.passThread([appId]) ⇒ this

Checks pass thread control

Kind: instance method of ResponseAssert
Params

  • [appId] string = null
 

responseAssert.attachmentType(type) ⇒ this

Checks attachment type

Kind: instance method of ResponseAssert
Params

  • type string
 

ResponseAssert.AnyResponseAssert#contains(search) ⇒ this

Checks, that response contains text

Kind: static method of ResponseAssert
Params

  • search string
 

ResponseAssert.AnyResponseAssert#quickReplyAction(action) ⇒ this

Checks quick response action

Kind: static method of ResponseAssert
Params

  • action string
 

ResponseAssert.AnyResponseAssert#quickReplyTextContains(search) ⇒ this

Checks quick response text

Kind: static method of ResponseAssert
Params

  • search string
 

ResponseAssert.AnyResponseAssert#templateType(type) ⇒ this

Checks template type

Kind: static method of ResponseAssert
Params

  • type string
 

ResponseAssert.AnyResponseAssert#genericTemplate(itemCount)

Checks for generic template

Kind: static method of ResponseAssert
Params

  • itemCount number = - specified item count
 

ResponseAssert.AnyResponseAssert#buttonTemplate(search, buttonCount)

Checks for button template

Kind: static method of ResponseAssert
Params

  • search string
  • buttonCount number = - specified button count
 

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

Checks pass thread control

Kind: static method of ResponseAssert
Params

  • [appId] string = null
 

ResponseAssert.AnyResponseAssert#attachmentType(type) ⇒ this

Checks attachment type

Kind: static method of ResponseAssert
Params

  • 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])

Params

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

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

Runs the conversation test

Kind: instance method of ConversationTester
Params

  • validationRequestBody object =
  • step number =
 

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

Kind: instance method of ConversationTester
Params

 

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

Kind: instance method of ConversationTester
Params

 

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

Kind: instance method of ConversationTester
Params

  • testCases *
 

conversationTester._getTestsGroups(testsGroups, step)

Kind: instance method of ConversationTester
Params

 

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

Kind: instance method of ConversationTester
Params

 

conversationTester._runTextCaseTests(testsGroup, botconfig)

Kind: instance method of ConversationTester
Params

 

conversationTester._runStepCaseTests(testsGroup, botconfig)

Kind: instance method of ConversationTester
Params

 

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

Kind: instance method of ConversationTester
Params

 

conversationTester.executeStep(t, step)

Kind: instance method of ConversationTester
Params

 

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
Params

  • 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 ""