Fail_on definition
Add capabilty to stop test execution if some elements are present on "fail_on" definition
from spintest import spintest
urls = ["https://test.com"]
tasks = [
{
"method": "GET",
"route": "test",
"expected": {
"body": {"result": "Success"},
"expected_match": "partial",
},
"fail_on": [
{
"code": 409,
},
{
"body": {"result": "Failed"},
"match": "partial",
},
{
"body": {"result": "Error"},
"match": "partial",
},
],
"retry": 15,
}
]
result = spintest(urls, tasks, generate_report="report_name")
assert True is result