Classes

Tester
ResponseAssert
AnyResponseAssert
 

Tester

Kind: global class

 

new Tester()

Utility for testing requests

 

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
  • [text] string
  • [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 =
 

tester.passThread([data], [appId]) ⇒ Promise

Makes pass thread control request

Kind: instance method of Tester
Params

  • [data] string | Object = null - action
  • [appId] string = "random-app" - specific app id
 

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

results matching ""

    No results matching ""