Skip to content

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

1. Text Button With Url

  1. User sends “text button with url”
  2. Bot returns a button with text in it
  3. User clicks the button
  4. 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.

2. Text Button With Msg in Chat Window

  1. User sends “text button with msg in chat window”
  2. Bot returns a button with text in it
  3. User clicks the button
  4. Some text goes to that chatroom as being from the user ("hello in the chat window")
  5. 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
        }
      ]
    }
  ]
}

3. Image Button With Url

  1. User sends “image button with url”
  2. Bot returns a button with an image in it
  3. User clicks the button
  4. 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
        }
      ]
    }
  ]
}

4. Image Button With Msg in Chat Window

  1. User sends “image button with msg in chat window”
  2. Bot returns a button with an image in it
  3. User clicks the button
  4. Some text goes to that chatroom as being from the user ("I clicked the airplane")
  5. 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
        }
      ]
    }
  ]
}

5. Multiple Text Buttons

  1. User sends "multiple text buttons"
  2. 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
        }
      ]
    }
  ]
}

6. Horizontal Text Buttons

  1. User sends "horizontal text buttons"
  2. 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
        }
      ]
    }
  ]
}

7. [DEFERRED] Temporary Text Buttons

  1. User sends "temporary text buttons"
  2. Bot returns multiple text buttons
  3. User selects one of the buttons
  4. 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
        }
      ]
    }
  ]
}

8. [DEFERRED] Button With Msg Not Displayed in Window

  1. User sends “button with msg not in chat window”
  2. Bot returns a button
  3. User clicks the button ("sent msg not in chat window" sent to bot)
  4. 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
        }
      ]
    }
  ]
}

9. Url Button With Full Webview (default)

  1. User sends “button with full webview”
  2. Bot returns a button
  3. User clicks the button
  4. 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
        }
      ]
    }
  ]
}

10. Url Button With Tall Webview

  1. User sends “button with tall webview”
  2. Bot returns a button
  3. User clicks the button
  4. 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"
        }
      ]
    }
  ]
}

11. Url Button With Compact Webview

  1. User sends “button with compact webview”
  2. Bot returns a button
  3. User clicks the button
  4. 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"
        }
      ]
    }
  ]
}

12. Attachment with title, image, link and buttons

  1. User sends “attachment with buttons”
  2. Bot returns an attachment with title, image, link and two vertically displayed buttons
  3. 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
        }
      ]
    }
  ]
}
Clone this wiki locally