简体   繁体   中英

Protractor - How to run test cases with failures and to present them as passed items?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM