forked from RocketChat/Rocket.Chat.Android
-
Notifications
You must be signed in to change notification settings - Fork 6
Phase 1 Rich Messaging Acceptance Test
ear-dev edited this page Aug 8, 2018
·
3 revisions
These will be tested by sending messages to RichMessageTestBot at https://dev.veranda.viasat.io/direct/RichMessageTestBot, which should then send the described attachments based on configuration of intents in dialogflow.
RichMessageTestBot is also configured as an app in Slack for testing purposes here: (A general example of an attachment with buttons can be triggered by "slack attachment with buttons" message.)
- User sends “text button with url”
- Bot returns a button with text in it
- User clicks the button
- A chrome custom tab of a url opens
Payload:
{
"attachments": [
{
"title": "text button with url",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "http://www.kayak.com",
"is_webview": false
}
]
}
]
}
Sending "slack text button with url" message to the richmessagetestbot in slack produces the slack equivalent of this button for reference.
- User sends “text button with msg in chat window”
- Bot returns a button with text in it
- User clicks the button
- Some text goes to that chatroom as being from the user ("hello in the chat window")
- Bot sends a response to that text in the window
Payload:
{
"attachments": [
{
"title": "text button with msg in chat window",
"actions": [
{
"type": "button",
"text": "Say hello in chat window?",
"msg": "hello in chat window",
"msg_in_chat_window": true
}
]
}
]
}
- User sends “image button with url”
- Bot returns a button with an image in it
- User clicks the button
- A chrome custom tab of a url opens
Payload:
{
"attachments": [
{
"title": "image button with url",
"actions": [
{
"type": "button",
"url": "http://www.kayak.com",
"image_url": "http://www.emoji.co.uk/files/phantom-open-emojis/travel-places-phantom/12698-airplane.png",
"is_webview": false
}
]
}
]
}
- User sends “image button with msg in chat window”
- Bot returns a button with an image in it
- User clicks the button
- Some text goes to that chatroom as being from the user ("I clicked the airplane")
- Bot sends a response to that text in the window
Payload:
{
"attachments": [
{
"title": "image button with msg in chat window",
"actions": [
{
"type": "button",
"image_url": "http://www.emoji.co.uk/files/phantom-open-emojis/travel-places-phantom/12698-airplane.png",
"msg": "I clicked the airplane",
"msg_in_chat_window": true
}
]
}
]
}
- User sends "multiple text buttons"
- Bot returns multiple text buttons (vertically as that is default)
Payload:
{
"attachments": [
{
"title": "multiple text buttons with url",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "http://www.kayak.com",
"is_webview": false
},
{
"type": "button",
"text": "Cancel travel request",
"url": "https://requests.example.com/cancel/r123456",
"is_webview": false
}
]
}
]
}
- User sends "horizontal text buttons"
- Bot returns horizontal text buttons
Payload:
{
"attachments": [
{
"title": "horizontal text buttons with url",
"button_alignment": "horizontal",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "http://www.kayak.com",
"is_webview": false
},
{
"type": "button",
"text": "Cancel travel request",
"url": "https://requests.example.com/cancel/r123456",
"is_webview": false
}
]
}
]
}
- User sends "temporary text buttons"
- Bot returns multiple text buttons
- User selects one of the buttons
- The msg corresponding to the selected button appears in the chat window and all the buttons disappear
Payload:
{
"attachments": [
{
"title": "temporary text buttons",
"temporary_buttons": true,
"actions": [
{
"type": "button",
"text": "Say hello?",
"msg": "hello",
"msg_in_chat_window": true
},
{
"type": "button",
"text": "Don't say hello",
"msg": "not saying hello",
"msg_in_chat_window": true
}
]
}
]
}
- User sends “button with msg not in chat window”
- Bot returns a button
- User clicks the button ("sent msg not in chat window" sent to bot)
- Bot sends a response back into the chat room confirming that the button click sent to the bot ("msg not in chat window received")
Payload:
{
"attachments": [
{
"title": "button with msg not in chat window",
"actions": [
{
"type": "button",
"text": "send msg not in chat window",
"msg": "sent msg not in chat window",
"msg_in_chat_window": false
}
]
}
]
}
- User sends “button with full webview”
- Bot returns a button
- User clicks the button
- A full height ratio webview of a url opens
Payload:
{
"attachments": [
{
"title": "button with full webview",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "http://www.kayak.com",
"is_webview": true
}
]
}
]
}
- User sends “button with tall webview”
- Bot returns a button
- User clicks the button
- A tall height ratio webview of a url opens
Payload:
{
"attachments": [
{
"title": "button with tall webview",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "http://www.kayak.com",
"is_webview": true,
"webview_height_ratio": "tall"
}
]
}
]
}
- User sends “button with compact webview”
- Bot returns a button
- User clicks the button
- A compact height ratio webview of a url opens
{
"attachments": [
{
"title": "button with compact webview",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "http://www.kayak.com",
"is_webview": true,
"webview_height_ratio": "compact"
}
]
}
]
}
- User sends “attachment with buttons”
- Bot returns an attachment with title, image, link and two vertically displayed buttons
- User clicks the buttons and they work.
"attachments": [
{
"title": "Lauri M(title field)",
"title_link": "https://www.basketball-reference.com/players/m/markkla01.html",
"text": "Should have been rookie of the year (text field)",
"description": "What a great player! (description field)",
"image_url": "http://www.trbimg.com/img-5b04c449/turbine/ct-spt-bulls-lauri-markkanen-all-rookie-team-20180522",
"actions": [
{
"type": "button",
"text": "Book flights",
"url": "https://www.kayak.com",
"is_webview": false
},
{
"type": "button",
"text": "Cancel travel request",
"url": "https://www.kayak.com",
"is_webview": false
}
]
}
]
}