Skip to main content

Train and use expectation detector in Robot Framework tests.

Project description

NOTE: This is currently an alpha version! Use with CURIOSITY and caution :D

Library to train computers to validate expected results based on examples. Validate something big and volatile with ease. Make your testing smarter with applying machine learning.

This library exposes only one robot framework keyword: Should be as expected ${VALUE}. It checks expectations of what a ${VALUE} should be against generated expectations json file. Expectation file is in human readable format and can be edited manually. System will generate expectations automatically.

How to use this:

  1. Install from PyPI pip install robotframework-expects

  2. Add library to RF test suite in training mode Library Expects TRAINING

  3. Catch a value ${VALUE}= .. from your SUT in your test

  4. Add expect block to the test Should be as expected ${VALUE}

  5. Run your test robot yoursuite.robot -> generates a file yoursuite_expects.json

  6. Change library to normal mode Library Expects (remove TRAINING)

  7. Run your tests

Improving expectations

There are three ways to improve expectations:

  1. Run a test multiple times in TRAINING mode to gain better validation model from multiple example runs.

  2. Run a test in INTERACTIVE mode to stop execution on failing Should be as expected. Then explore and make a better validation model.

  3. Modifying _expects.json by hand.

When expectations change

If your system changes in a way that old expectations should not be used, just remove _expects.json file and switch library to TRAINING mode. Then run your test to record new expectations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework-expects-0.4.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

robotframework_expects-0.4.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file robotframework-expects-0.4.0.tar.gz.

File metadata

  • Download URL: robotframework-expects-0.4.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.3

File hashes

Hashes for robotframework-expects-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ea92b8aedb0df7eb4a7dca6e0fdaebffd70b66878c136ec4304f7c27ca61bae6
MD5 c7205863b56058d415c39f2fc4258769
BLAKE2b-256 2f57d27f9768ff9d35cc20a1ca85288e5b42fecf4559077cc152baa8973b8a59

See more details on using hashes here.

File details

Details for the file robotframework_expects-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: robotframework_expects-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.3

File hashes

Hashes for robotframework_expects-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70c95bf067ea2133ed72bcd059c8f25ff8c653626840b93663618a85569b1dfa
MD5 c85b93c82540f485827a3d4ff5da77d2
BLAKE2b-256 ab32ed4354074719f10b654f0fbcb818d5f0c8463b95c850ff3643f86454535a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page