Classes
Tester
Kind: global class
- Tester
- new Tester()
- instance
- .acquireResponseActions()
- .res([index]) ⇒
ResponseAssert - .any() ⇒
AnyResponseAssert - .lastRes() ⇒
ResponseAssert - .passedAction(path) ⇒
this - .getState() ⇒
object - .setState([state])
- .text(text) ⇒
Promise - .intent(intent, text) ⇒
Promise - .passThread([data], [appId]) ⇒
Promise - .optin(action, [data]) ⇒
Promise - .quickReply(action, [data]) ⇒
Promise - .postBack(action, [data], [refAction], [refData]) ⇒
Promise
- static
new Tester()
Utility for testing requests
tester.acquireResponseActions()
Resets action collector and fetches new actions, when there are some
Kind: instance method of Tester
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.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) ⇒ Promise
Makes recognised AI intent request
Kind: instance method of Tester
| Param | Type |
|---|---|
| intent | string |
| text | string |
tester.passThread([data], [appId]) ⇒ Promise
Makes pass thread control request
Kind: instance method of Tester
| Param | Type | Default | Description | |
|---|---|---|---|---|
| [data] | string \ |
Object |
null |
action |
| [appId] | string |
"random-app" |
specific app id |
tester.optin(action, [data]) ⇒ Promise
Make optin call
Kind: instance method of Tester
| Param | Type | Default |
|---|---|---|
| action | string |
|
| [data] | object |
{} |
tester.quickReply(action, [data]) ⇒ Promise
Send quick reply
Kind: instance method of Tester
| Param | Type | Default |
|---|---|---|
| action | string |
|
| [data] | object |
{} |
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], [processorOptions], [storage])
Creates an instance of Tester.
| Param | Type | Default | Description | ||
|---|---|---|---|---|---|
| reducer | Router \ |
ReducerWrapper \ |
function |
||
| [senderId] | string |
null |
|||
| [processorOptions] | object |
{} |
options for Processor | ||
| [storage] | MemoryStateStorage |
place to override the storage |
ResponseAssert
Kind: global class
- ResponseAssert
- new ResponseAssert()
- instance
- .contains(search) ⇒
this - .quickReplyAction(action) ⇒
this - .templateType(type) ⇒
this - .passThread([appId]) ⇒
this - .attachmentType(type) ⇒
this
- .contains(search) ⇒
- static
- .AnyResponseAssert#contains(search) ⇒
this - .AnyResponseAssert#quickReplyAction(action) ⇒
this - .AnyResponseAssert#templateType(type) ⇒
this - .AnyResponseAssert#genericTemplate(itemCount)
- .AnyResponseAssert#buttonTemplate(search, buttonCount)
- .AnyResponseAssert#passThread([appId]) ⇒
this - .AnyResponseAssert#attachmentType(type) ⇒
this
- .AnyResponseAssert#contains(search) ⇒
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 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#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