I'm converting some manual tests to Python and using Selenium to test them. Currently the manual steps are written like to:
Requirement 1 - Can add new person, if none exists
Step 1 - Search for the person using valid demographics
Step 2 - If none exist, click add new person
Step 3 - confirm previously entered demographics populated form
Step 4 - Create person
Step 5 - Confirm person now exists
I'm currently using unittest
and HtmlTestRunner
which does work to a degree. What I'd like to see or be able to obtain is the breakdown of each test. Where I can see the test being ran. The number of steps ran and their pass/fail status.
Requirement 1 - Pass
Step 1 - Pass
Step 2 - Pass
Step 3 - Pass
Step 4 - Fail
Step 5 - Fail
1 test ran, 5 assertions, 3 passed, 2 failed (or something like this)
I'm not sure if perhaps it's possible to use dependent tests with unittest
. Where perhaps each step should be it's own test, but I'd need the driver and the current browser status available to continue the tests forward and not have to redo each step.
So if there is a commonly accepted way to achieve something like this that would be great!