Add annotation to tag tests by test case ID#336
Add annotation to tag tests by test case ID#336Angelthree95 wants to merge 2 commits intokiwitcms:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #336 +/- ##
=============================================
- Coverage 58.86% 10.65% -48.22%
+ Complexity 126 34 -92
=============================================
Files 16 16
Lines 564 582 +18
Branches 33 37 +4
=============================================
- Hits 332 62 -270
- Misses 207 519 +312
+ Partials 25 1 -24 ☔ View full report in Codecov by Sentry. |
| <artifactId>kiwitcms-junit-plugin</artifactId> | ||
| <packaging>jar</packaging> | ||
| <version>12.5</version> | ||
| <version>12.6</version> |
There was a problem hiding this comment.
Revert this change:
| <version>12.6</version> | |
| <version>12.5</version> |
| @ExtendWith(KiwiTcmsExtension.class) | ||
| public class KiwiJsonRpcClientTest { | ||
| @Test | ||
| @TcmsTestCaseId(11) |
There was a problem hiding this comment.
Add comment to clarify example:
| @TcmsTestCaseId(11) | |
| @TcmsTestCaseId(11) // optional |
| public @interface TcmsTestCaseId | ||
| { | ||
| int value(); | ||
| } |
There was a problem hiding this comment.
What is the purpose of this class? Is this where the new annotation is defined? If yes, I think model/ isn't the appropriate place for it. Maybe create a new directory like annotations/ ? WDYT ?
There was a problem hiding this comment.
Or maybe add this class into TestMethod.java ? Not sure what makes sense here.
| } | ||
| } | ||
|
|
||
| public TestCase getTestCaseById(int testCaseId) { |
There was a problem hiding this comment.
This will need some test coverage.
|
I will review this one first, before reviewing the extended version. |
@TcmsTestCaseId()annotation to the@Testmethod.If you have a nicely maintained Kiwi instance, where the test cases are manually added and your code doesn't reflect the names, then the TCMS junit plugin won't be able to find them properly (just by searching by name). By adding the
@TcmsTestCaseId()annotation, you can override which test case is returned to the test plan. In case of invalid ID being provided the plugin will do the standard test case search.