Hi,
Is there a mechanism in JBehave to differentiate between a scenario failure and
a scenario error? Basically, when a scenario fails I’d like to know whether
it’s a problem with my test, or a problem with the application under test.
I’m using JBehave for security tests, so a scenario failure indicates a
security vulnerability; but I have error checking logic in the test itself
which just ensures that the test is behaving properly, so if there’s an error
in the test then I don’t want the test to “fail” but rather to throw some kind
of distinguishable error condition, like in the following contrived example:
@Then(“bob must not see alice’s private data”)
public void checkAccessControl() {
loginAsBob();
driver.get(bobsPage);
if (notOnBobsPage()) throw UnexpectedContentException(“Can’t access
bob’s page even though bob is logged in”); //Test error
driver.get(alicesPage);
assertThat(“bob can see alices data”, canViewAlicesData(), is(true));
//Application error and security vulnerability
}
In the case above, I’d like the scenario outcome to be different if assertion
fails vs if the UnexpectedContentException is thrown. If there’s no native
way to do this in JBehave, do you have any ideas on the easiest way to achieve
this?
regards,
Stephen
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email