What is the purpose of expected results for individual test case steps?
I don't mean for this to be a subjective discussion and I'm trying to not come across with a value judgment. I'm genuinely interested in understanding what I see in some testing tools. With Testrail and Microsoft Test Manager, I have seen test cases that have expected results for each step. However, I'm quite accustomed to expected results being scoped to the entire test case, not the individual steps too. So the hopefully answerable question I have is: As a QA, how I can I leverage the concept of expected results per step?
A functionality requires validation of system behavior in two (or more) different states. For instance. Let's say in your SUT a user is authorized to use a certain feature only if the user has permission X. To make sure this really depends only on having this permission, you should verify at least two cases, that is your test case have have multiple steps and checks Create a user without permission X Login as the user Try to access the feature. Expect the user receives an error message "Permission denied". Grant the user with permission X Try to access the feature again. Expect the user can use it. It does not always make sense to split those checks to separate test cases. For instance, in this scenario you may want to verify what happens if permission is granted or revoked when the user is already logged in. A test with entry conditions to validation. For instance, in the above scenario you may want to check in the first step, that information about user permissions are defined correctly in DB after creation. Sure, it may blur the purpose of a the test a bit, but on the other side, it makes no sense to execute next step, if this information is missing in DB. An elements with multiple aspects to validate. It might be easier to read your test case, if multiple aspects of one thing are checked in separate steps. For instance, imagine you're verifying a report generated by your app. Each step then could be about verifying a value for a different column/row/cell of the report.