0
votes

What I am trying to achieve: If I have to validate multiple elements in the same page then I want to write multiple assertions under same test instead of writing multiple tests for opening browser and navigating to the page again and again for each assertions. Is it feasible and how we can achieve this?

Solution I am using but not working I am using allure report. When I use assert False or pytest.fail in both cases my allure report captures the failure but test case stops and further assertions or line of codes are not executed in that test. When I use pytest_check then it fails the test but failures are not captured in the allure report. it simply shows the step in green and test in red.

enter image description here

1

1 Answers

0
votes

If you do something from inside allure.step block failure will be marked with red or yellow (depends on the failure reason) > sign

with allure.step(description):
    do_something()