Skip to content

Latest commit

 

History

History
78 lines (55 loc) · 2.36 KB

Readme.md

File metadata and controls

78 lines (55 loc) · 2.36 KB

known-issue

Add a @KnownIssue annotation for TestNg tests that already have a related bug on Jira, and they will be skipped until it is resolved.

Installation

  1. Add This module to your project, or add the maven dependency:
 <dependency>
   <groupId>com.orshachar</groupId>
   <artifactId>known-issue</artifactId>
   <version>1.0.0</version>
 </dependency>
 

to your pom.xml

  1. Create a jira.properties file under your /resources folder, add the following properties:

Or use the properties file here as a template

  1. Add JiraListener.class to the test class ( e.g @Listeners(JiraListener.class)), or to the testng.xml listeners (for more info on listeners, see here: TestNg Listeners )

    Note

    only Basic HTTP Auth is currently supported, OAuth support will be added soon.

Usage

For a test that fails and has bug on Jira, you can now add a @KnownIssue annotation before the test, with the Jira ticket id. While the bug is on an Open/ToDo status the test will be skipped. If the bug was resolved and the test passes, it will now fail and indicate that you need to close the ticket and remove the annotation. otherwise, it will still fail.

See the following example for adding the annotation:

@KnownIssue(jiraTicket = "KNOW-1")
@Test
public void testFailedWithOpenIssue() {
    assertThat(1, equalTo(2));

}

This test will fail by defintion, but will be skipped if "KNOW-1" is in status "Resolved"

Documentation

Issue Current Status Final Status
None Failed Failed
None Passed Passed
Open Failed Skipped
Resolved Passed Failed - close ticket and remove anotation
Resolved Failed Failed - reopen ticket
Closed Failed Failed - reopen ticket
Closed Passed Failed - remove annotation

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request!

License

GNU General Public License v3.0