Alternate behavior for failing assertions -----------------------------------------
Key: JBEHAVE-509 URL: http://jira.codehaus.org/browse/JBEHAVE-509 Project: JBehave Issue Type: Improvement Components: Core Environment: All Reporter: Chris Kozak I've been thinking about how JBehave handles assertion failures. As it works today, JBehave behaves something like this when it encounters a failing assertion: {color:green}Given I have searched for a round-trip flight{color} {color:green}When I view my trip summary{color} {color:green}Then I should see the origin and destination of each flight segment{color} {color:red} And I should see the fare cost (FAILED){color} {color:gray} And I should see the taxes and fees (NOT RUN){color} {color:gray} And I should see the on-time rating of each flight segment (NOT RUN){color} Test Failed! I'd like to have the results look like this: {color:green}Given I have searched for a round-trip flight{color} {color:green}When I view my trip summary{color} {color:green}Then I should see the origin and destination of each flight segment{color} {color:red} And I should see the fare cost (FAILED){color} {color:green} And I should see the taxes and fees{color} {color:red} And I should see the on-time rating of each flight segment (FAILED){color} Test Failed! I'm finding that most assertions in a functional test need not halt test execution and it would be nice to have the test run "until it can't." If the fare cost doesn't get fixed for weeks, that won't hide the broken on-time ratings. For JBehave, I believe that the change would entail recording and swallowing assertion exceptions while failing on other sorts of exceptions. If selenium can't find the continue button, it will throw a NoSuchElementException and halt the test. If this does get implemented, I think that it would be useful to have some sort of before/after step hooks, so that we can take screenshots for each failing assertion. It would be nice to have something like: @AfterStep(FAILING) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email