Metadata-Version: 2.1
Name: robotframework-assertion-engine
Version: 0.3.1
Summary: Generic way to create meaningful and easy to use assertions for the Robot Framework libraries.
Home-page: https://github.com/MarketSquare/AssertionEngine
License: Apache-2.0
Author: Tatu Aalto
Author-email: aalto.tatu@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Robot Framework
Classifier: Framework :: Robot Framework :: Tool
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Testing
Requires-Dist: robotframework (>=4.0.3,<5.0.0)
Requires-Dist: robotframework-pythonlibcore (>=3.0.0,<4.0.0)
Project-URL: Documentation, https://github.com/MarketSquare/AssertionEngine/blob/master/README.rst
Description-Content-Type: text/x-rst

Assertion Engine
================

Generic way to create meaningful and easy to use assertions for the `Robot Framework`_
libraries. This tools is spin off from `Browser library`_ project, where the Assertion
Engine was developed as part of the of library.

.. image:: https://github.com/MarketSquare/AssertionEngine/actions/workflows/on-push.yml/badge.svg
   :target: https://github.com/MarketSquare/AssertionEngine
.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
   :target: https://opensource.org/licenses/Apache-2.0
.. image:: https://github.com/MarketSquare/AssertionEngine/actions/workflows/on-push.yml/badge.svg
   :target: https://github.com/MarketSquare/AssertionEngine/actions/workflows/on-push.yml

Supported Assertions
--------------------

Currently supported assertion operators are:

+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| Operator | Alternative Operators     | Description                                                                        | Validate Equivalent              |
+==========+===========================+====================================================================================+==================================+
| ==       | equal, should be          | Checks if returned value is equal to expected value.                               | value == expected                |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| !=       | inequal, should not be    | Checks if returned value is not equal to expected value.                           | value != expected                |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| >        | greater than              | Checks if returned value is greater than expected value.                           | value > expected                 |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| >=       |                           | Checks if returned value is greater than or equal to expected value.               | value >= expected                |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| <        | less than                 | Checks if returned value is less than expected value.                              | value < expected                 |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| <=       |                           | Checks if returned value is less than or equal to expected value.                  | value <= expected                |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| \*=      | contains                  | Checks if returned value contains expected value as substring.                     | expected in value                |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
|          | not contains              | Checks if returned value does not contain expected value as substring.             | expected not in value            |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| ^=       | should start with, starts | Checks if returned value starts with expected value.                               | re.search(f"^{expected}", value) |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| $=       | should end with, ends     | Checks if returned value ends with expected value.                                 | re.search(f"{expected}$", value) |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| matches  |                           | Checks if given RegEx matches minimum once in returned value.                      | re.search(expected, value)       |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| validate |                           | Checks if given Python expression evaluates to True.                               |                                  |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+
| evaluate |  then                     | When using this operator, the keyword does return the evaluated Python expression. |                                  |
+----------+---------------------------+------------------------------------------------------------------------------------+----------------------------------+

Supported formatters:

+-------------------+------------------------------------------------------------+
| Formatter         | Description                                                |
+===================+============================================================+
| normalize spaces  | Substitutes multiple spaces to single space from the value |
+-------------------+------------------------------------------------------------+
| strip             | Removes spaces from the beginning and end of the value     |
+-------------------+------------------------------------------------------------+
| apply to expected | Applies rules also for the expected value                  |
+-------------------+------------------------------------------------------------+

Usage
-----
When keywords needs to do an assertion


.. _Robot Framework: http://robotframework.org
.. _Browser library: https://robotframework-browser.org/

