2

Is there an option to mark a test case with known issue/limitation as passed? Actually, I want the test case will run with the bugs but to present him as "passed" in the generated report until I'll fix him or to leave it with the known issue for good.

yankee
  • 38,872
  • 15
  • 103
  • 162
Idan E
  • 1,299
  • 4
  • 17
  • 42
  • 2
    Why would you want to do that? Defeats the purpose of testing, especially if you're doing TDD... – Gunderson Jun 29 '16 at 16:54
  • Because we using a job that send alert if the run failures and I don't want to skip on these test cases by comment them.. probably there's a way to mark them as "ok" even they receives errors.. @Gunderson – Idan E Jun 29 '16 at 17:01
  • 1
    If you know the test is going to fail, why not remove it from the run temporarily? – JeffC Jun 29 '16 at 18:06

1 Answers1

3

What we do in such cases is marking these tests as pending referencing the Jira issue number in the test description:

pending("should do something (ISSUE-442)", function () {
    // ...
});

Tests like these would not be failures (and they would not actually be executed) and would not change the exit code, but would be separately reported on the console (we are using jasmine-spec-reporter).

When an issue is resolved, we would check if we have a pending test with the issue number, and, if yes, we'll make the test executable again by renaming pending back to it. If the test passes, this usually serves, at least partially and assuming the test actually checks the functionality, as a prove that the fix was made and the issue can be resolved.

This is probably not ideal since it involves "human touch" in keeping track of pending specs (tried to solve it statically, but failed), but that proved to work for us.

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • @IdanE thanks. Just to warn you. I think there is a problem in jasmine+protractor. If a test is marked as pending, all the subsequent non-pending tests would not be executed. I remember being forced to move all the pending specs to the end of the describe. Just keep that in mind. – alecxe Jun 29 '16 at 18:59