Carla Test Helper v0.1.14 CarlaTestHelper.V2.Connector View Source

Carla test helper

Link to this section Summary

Functions

Similar to quick_reply/4 but instead of quick replies, this scans text and gallery card item buttons for a button with the label label

Similar to quick_reply/4 but instead of quick replies, this scans text and gallery card item buttons for a button with the label label

Similar to quick_reply/4 but instead of quick replies, this scans text and gallery card item buttons for a button with the label label

Prints the last response from a request

Retrieves a gallery card from the response and searches for a button with the label label sends its payload as the given user for conversation_id. Then asserts that the resulting response is expected_action

Retrieves a gallery card from the response and searches for a button with the label label. Asserts the button linkout url contains value

Retrieves a gallery card from the response and searches for a button with the label label. Asserts the button linkout url contains value

Sends message for the given conversation_id and asserts the response is the expected_action

Scans the buttons portion of the given response for the first quick reply button with the label label and sends its payload as the given user for conversation_id. Then asserts that the resulting response is expected_action

Link to this section Functions

Link to this function button_action(response, conversation_id, label, expected_action) View Source
button_action(map(), String.t(), String.t(), String.t()) :: map()

Similar to quick_reply/4 but instead of quick replies, this scans text and gallery card item buttons for a button with the label label.

Parameters:

  • response - Response to look for a button with label
  • conversation_id - The user conversation_id to send the message as
  • label - The label of the button you want to “click”
  • expected_action - The resulting response’s action

Returns the response after clicking the button.

Link to this function button_linkout(response, conversation_id, label, value) View Source
button_linkout(map(), String.t(), String.t(), String.t()) :: map()

Similar to quick_reply/4 but instead of quick replies, this scans text and gallery card item buttons for a button with the label label.

Parameters:

  • response - Response to look for a button with label
  • conversation_id - The user conversation_id to send the message as
  • label - The label of the button you want to “click”
  • value - The linkout button payload value

Returns the response after clicking the button.

Link to this function button_linkout(response, conversation_id, label, value, params) View Source
button_linkout(map(), String.t(), String.t(), String.t(), [String.t()]) :: map()

Similar to quick_reply/4 but instead of quick replies, this scans text and gallery card item buttons for a button with the label label.

Parameters:

  • response - Response to look for a button with label
  • conversation_id - The user conversation_id to send the message as
  • label - The label of the button you want to “click”
  • value - The linkout button payload value
  • params - The params expected in the value

Returns the response after clicking the button.

Link to this function button_user_response(response, conversation_id, label, expected_action) View Source
button_user_response(map(), String.t(), String.t(), String.t()) :: map()

Similar to button_action/4 for BOT V2

Parameters:

  • response - Response to look for a button with label
  • conversation_id - The user conversation_id to send the message as
  • label - The label of the button you want to “click”
  • expected_action - The resulting response’s action

Returns the response after clicking the button.

Link to this function debug_last_response(response, conversation_id) View Source
debug_last_response(map(), String.t()) :: map()

Prints the last response from a request.

Parameters:

  • response - Response to print
  • conversation_id - Unused, The user conversation_id passed down
Link to this function message(response, conversation_id, message, expected_action) View Source
message(map(), String.t(), String.t(), String.t()) :: map()

Sends message for the given conversation_id and asserts the response is the expected_action.

Parameters:

  • _response - Unused, just made it 4 args to be in line w/ quick_reply and button
  • conversation_id - The user to send the message as
  • message - The message to send
  • expected_action - The action to assert when it comes back

Returns a Response object.

Link to this function quick_reply(response, conversation_id, label, expected_action) View Source
quick_reply(map(), String.t(), String.t(), String.t()) :: map()

Scans the buttons portion of the given response for the first quick reply button with the label label and sends its payload as the given user for conversation_id. Then asserts that the resulting response is expected_action.

Parameters:

  • response - Response to look for a button with label
  • conversation_id - The conversation to send the message to
  • label - The label of the button you want to “click”
  • expected_action - the resulting response’s action

Returns the response after clicking the quick_reply.