Enhance Your Robot Framework Tests with robotframework-apprise

Emily Techscribe Avatar

·

Enhance Your Robot Framework Tests with robotframework-apprise

transmit

Are you looking for a way to send push or email messages in your Robot Framework tests? Look no further! The robotframework-apprise library is here to assist you. In this article, we will explore how you can enhance your Robot Framework tests by incorporating push and email messaging capabilities.

Introduction to robotframework-apprise

The robotframework-apprise library is a keyword collection designed specifically for the Apprise push message library. It allows Robot Framework users to send push and email messages to various messaging services supported by Apprise. With this library, you can seamlessly integrate push and email messaging into your existing Robot Framework tests.

Installation

To get started with robotframework-apprise, you need to install the library. The easiest installation method is via pip. Open your terminal and run the following command:

pip install robotframework-apprise

Once the installation is complete, you are ready to use the robotframework-apprise library.

Using robotframework-apprise in Robot Framework Tests

To use the robotframework-apprise library in your Robot Framework tests, you need to import the library and configure the messaging options. The library provides various keywords to set clients, attachments, notification types, and body formats.

Here’s an example of using the Send Apprise Message keyword to send a push message with one client and multiple attachments:

“`robot
*** Settings ***
Library AppriseLibrary

*** Test Cases ***
Send Push Message
[Setup] Initialize Apprise
Send Apprise Message title=Robot Framework Apprise Demo body=Connect to Apprise with your Robot Framework Tests! clients= attachments=http://www.mysite.com/image1.jpg,http://www.mysite.com/image2.jpg
[Teardown] Clean Up Apprise
“`

In the above example, we first initialize the Apprise library using the [Setup] section. Then, we use the Send Apprise Message keyword to send a push message with the specified title, body, client, and attachments. Finally, we clean up the Apprise library using the [Teardown] section.

Supported Keywords and Configurations

The robotframework-apprise library provides a set of keywords to configure and send push/email messages. Here are some of the supported keywords:

  • Send Apprise Message: Sends a push or email message through Apprise.
  • Set Clients and Set Attachments: Sets a new list of clients or attachments.
  • Add Client and Add Attachment: Adds a client or attachment to the existing list.
  • Remove Client and Remove Attachment: Removes a client or attachment from the list.
  • Clear All Clients and Clear All Attachments: Removes all clients or attachments from the list.
  • Set Attachment Delimiter: Sets a custom delimiter for attachments.
  • Set Notify Type: Sets the notification type (info, success, warning, or failure).
  • Set Body Format: Sets the body format (html, text, or markdown).
  • Set Config File: Sets a YAML or text file as the configuration file.

These keywords provide flexibility and control over your messaging options, allowing you to customize your push and email messages according to your requirements.

Known Issues and Future Developments

While the current version of robotframework-apprise offers a range of features, some capabilities of the original Apprise API are not yet supported, such as tagging. Additionally, only one YAML config file is currently supported. The library’s development team is actively working on addressing these limitations and is planning to provide further enhancements and updates in future releases.

Conclusion

The robotframework-apprise library is a valuable addition to your Robot Framework tests, enabling you to incorporate push and email messaging capabilities seamlessly. With its intuitive keywords and configurations, you can easily send push/email messages to various messaging services supported by Apprise. Enhance your test automation by adding this powerful keyword collection to your Robot Framework toolkit today!

Source: robotframework-apprise on GitHub

Leave a Reply

Your email address will not be published. Required fields are marked *