False Positive from Hobbes Test
Was looking at the sample Hobbes tests that come with the example project from new AEM6 eClipse tooling.
A couple of the tests navigate to a location, assert that location was reached, and finally that a component is visible on that page. That test PASSED E.g. :-
.addTestCase(new hobs.TestCase("Navigate to french page") .navigateTo("/content/aem6test29/fr.html") .asserts.location("/content/aem6test29/fr.html", true) .asserts.visible(".servicecomponent", true) );What I then did was delete the fr.html page and re-ran the test. Sure enough it failed BUT, only because the assert relating to the servicecomponent failed and NOT the assert.location.
Curious, I removed the servicecomponent assertion so I just have this :-
.addTestCase(new hobs.TestCase("Navigate to french page") .navigateTo("/content/aem6test29/fr.html") .asserts.location("/content/aem6test29/fr.html", true) )This test PASSED even though in the preview pane it clearly shows a 404 ??
Is the expected model for writing Hobbes tests that use assert.location always to include another assertion to verify that it has in fact been found, or is there another way of detecting the fact that assert.location itself was the problem.
Like a lot of you guys I'm sure, I write a lot of unit tests, and dealing with false positives (and negatives) is a really important aspect.
Appreciate your help
Kind Regards
Fraser.