pro拖拉机——如何运行测试用例,并将它们作为已传递的项目呈现?

时间:2021-03-21 01:20:48

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.

是否有一个选项以已知的问题/限制标记通过的测试用例?实际上,我希望测试用例能够运行bug,但在生成的报告中将他作为“已通过”显示,直到我修复他,或者将其永久保留已知的问题。

1 个解决方案

#1


3  

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

在这种情况下,我们所做的是将这些测试标记为在测试描述中引用Jira问题号:

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).

这样的测试不会是失败的(它们实际上不会被执行),也不会更改退出代码,但是会在控制台中单独报告(我们正在使用jasmin -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.

这可能不太理想,因为它涉及“人的接触”来跟踪未完成的规格(试图静态地解决它,但失败了),但事实证明这对我们很有用。

#1


3  

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

在这种情况下,我们所做的是将这些测试标记为在测试描述中引用Jira问题号:

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).

这样的测试不会是失败的(它们实际上不会被执行),也不会更改退出代码,但是会在控制台中单独报告(我们正在使用jasmin -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.

这可能不太理想,因为它涉及“人的接触”来跟踪未完成的规格(试图静态地解决它,但失败了),但事实证明这对我们很有用。