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. 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:
Install from PyPI pip install robotframework-expects
Add library to RF test suite in training mode Library Expects TRAINING
Catch a value ${VALUE}= .. from your SUT in your test
Add expect block to the test Should be as expected ${VALUE}
Run your test robot yoursuite.robot -> generates a file yoursuite_expects.json
Change library to normal mode Library Expects (remove TRAINING)
Run your tests
Improving expectations
There are three ways to improve expectations:
Run a test multiple times in TRAINING mode to gain better validation model from multiple example runs.
Run a test in INTERACTIVE mode to stop execution on failing Should be as expected. Then explore and make a better validation model.
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
Built Distribution
Hashes for robotframework-expects-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d558e95af93f14523405b263a04ab152ef61e133f48379bd25f570d225f4100 |
|
MD5 | 5270aed40b19aed51988ab56fef34e35 |
|
BLAKE2b-256 | 7246388f7f8a184a2f0c5625721b2e280603194115240afdfbfa63324a4ae986 |
Hashes for robotframework_expects-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd75c812c2bb9a3dbea7fca1b91f4a1ca6a41715be6b463f8618b097d8b60bc8 |
|
MD5 | 42dabe2dff192f0ed98a07ea93031726 |
|
BLAKE2b-256 | e5af9a88fd7130c1ac7d8b86159d41a8abafd4d3920ce1e8cbcf305938e23189 |