Skip to content

Commit

Permalink
Merge pull request #7 from basavaraj1985/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
basavaraj1985 authored Jan 29, 2018
2 parents dc6d9b1 + 5259473 commit ce1030b
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 644 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: java
jdk:
- oraclejdk8
install:
- mvn --settings .travis/settings.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
- mvn --settings .travis/settings.xml clean install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
Expand Down
57 changes: 21 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Build Status](https://travis-ci.org/basavaraj1985/DolphinNG.svg?branch=master)](https://travis-ci.org/basavaraj1985/DolphinNG)[![GitHub release](https://img.shields.io/badge/DolphinNG-Releases-blue.svg)](https://github.com/basavaraj1985/DolphinNG/releases)[![Maven Central](https://img.shields.io/badge/Maven%20Central-Releases-green.svg)](https://mvnrepository.com/artifact/com.github.basavaraj1985/DolphinNG)

# DolphinNG
##### TestNG add on for smarter, simpler reports and analytics!
The TestNG listeners, reporters with smart reporting, progress reporter, jira integration. This can be thought as TestNG++,
library with advanced features as failure based reporting, red delta.
- Red delta : new failures, compared to previous run. These failures are separated and shown as Red delta in the smart report. These fails indicate regression failure.
Expand Down Expand Up @@ -33,7 +34,7 @@ These results indicate a regression pass (usually because a fix made).
```
Please note that if you are using JIRA auto bug create on test failure feature, the order of listeners in testng.xml matters. Put the SmartReporter at the end.

- If you want to tweak the report format, you could do so. Take [this template](https://github.com/DolphinNG/blob/master/resources/report.vm "Template") and modify as per your needs
- If you want to tweak the report format, you could do so. Take [this template](https://github.com/basavaraj1985/DolphinNG/blob/master/resources/report.vm "Template") and modify as per your needs
and then provide the path to the template as
```
-Dsmart.report.template=path/to/your/templatefile/template.vm
Expand All @@ -43,10 +44,14 @@ These results indicate a regression pass (usually because a fix made).
-Dbuglink=true
-Dbuglink.config=jiraclient.properties
```
Providing buglink.config is optional, default properties will be taken if not provided. If you want to change the jira connection related settings,
[use this file](https://github.com/DolphinNG/blob/master/resources/jiraclient.properties).
Providing buglink.config is optional, default properties will be taken if not provided. Configuration file to be provided with values,
[use this file](https://github.com/basavaraj1985/DolphinNG/blob/master/resources/jiraclient.properties).

- If you want to create bugs automatically for test failures, use ```bug.auto.create=true``` either in jiraclient.properties or runtime property setting.
- If you want to create bugs automatically for test failures, use
```
bug.auto.create=true
```
either in jiraclient.properties or runtime property setting.
Your JIRA project might have different mandatory fields, custom fields. It is important to make sure that the bug creation request has proper body.
If default does not work, then please take [this file](https://github.com/DolphinNG/blob/master/resources/jiracreateTemplate.vm) and edit
according to your needs. And then provide this filepath as system property:
Expand All @@ -71,6 +76,7 @@ These results indicate a regression pass (usually because a fix made).
environment=Production
```
- Complete configuration file with keys, [config file](https://github.com/basavaraj1985/DolphinNG/blob/master/resources/jiraclient.properties).
- To link log file to the failures
```
-DlogLink=path/to/logfile
Expand All @@ -91,8 +97,6 @@ These results indicate a regression pass (usually because a fix made).
#Features:
- Default data provider available with parametrizable filenames; i.e. could be driven from configuration.
- **Smart Reporting** : Smart reporting enabled - lot lesser time in automation report analysis. Delta and failure based reports are provided.
- **Smart Reporting history** : Smart reporting with history trend is provided. You can see red delta trend over number of runs.
Expand All @@ -109,44 +113,25 @@ These results indicate a regression pass (usually because a fix made).
<parameter name="locatorFile" value="resources/configuration/elementLocators.xml" />
<!-- supported browsers: chrome, ff, remote,, safari(no UA), -->
<parameter name="browser" value="phantom"/>
<groups>
<run>
<include name="smoke" />
<include name="functional" />
<exclude name="todo" />
<exclude name="notForDesktop" />
</run>
</groups>
<classes>
<class name="sampleTests.GoogleSearchTest"></class>
</classes>
</test>

<test verbose="5" name="GoogleSRPMobile" annotations="JDK" parallel="classes" thread-count="6" >
<parameter name="baseUrl" value="http://google.com"/>
<parameter name="locatorFile" value="resources/configuration/mobileElementLocators.xml" />
<parameter name="userAgent" value="Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"/>
<parameter name="browserWidth" value="390"/>
<parameter name="browserHeight" value="780" />
<parameter name="browser" value="ff"/>
<groups>
<run>
<include name="smoke" />
<include name="functional" />
<exclude name="todo" />
<exclude name="notForMobile" />
</run>
</groups>
<classes>
<class name="sampleTests.GoogleSearchTest"></class>
</classes>
</test>

<listeners>
<!-- This is Smart report generator. It also generates JIRA tickets if enabled. And it generates the execution history too. -->
<listener class-name="com.javasbar.framework.testng.reporters.SmartReporter" />
<listener class-name="com.javasbar.framework.testng.reporters.EmailableReporter" />

<!-- This enables you see the test progress immediately. You could start analysing the report as soon as your tests start executing! -->
<listener class-name="com.javasbar.framework.testng.reporters.ProgressReporter" />
</listeners>

<!-- Using the below listener, you could make tests retry if dependent system is down. Set these properties in test context, or at runtime:
baseUrl, retryWaitSeconds, maxRetryCount -->
<listener class-name="com.javasbar.framework.testng.reporters.EnvAwareRetryAnalyzer" />

<!-- Using the below listener you can convert known failues into skips by providing whitelist -DskipFor=known fails~anotherFailure-->
<listener class-name="com.javasbar.framework.testng.reporters.RuleBasedStatusModifier" />s
</listeners>
</suite>
```
And much more.. Mail me on [email protected], if you need any help using this framework.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</licenses>
<groupId>com.github.basavaraj1985</groupId>
<artifactId>DolphinNG</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>

<scm>
<developerConnection>
Expand Down
2 changes: 1 addition & 1 deletion resources/jiracreateTemplate.vm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"name": "Bug"
},
"components": [{"name": "COMPONENT_IN_JIRA" }],
"components": [{"name": "$bug.component" }],
"customfield_10302": { "id": "$bug.severity" } ,
"customfield_10207": [{ "value": "$bug.environment" }],
"customfield_10502": { "value": "$bug.impact" },
Expand Down
26 changes: 26 additions & 0 deletions src/com/javasbar/framework/lib/common/JIRAClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ public static Properties loadFileIntoProperties(String file)
return props;
}

/**
*
* @param stream
* @return
*/
public static Properties loadInputStreamIntoProperties(InputStream stream)
{
Properties props = new Properties();
Expand All @@ -166,6 +171,10 @@ public static Properties loadInputStreamIntoProperties(InputStream stream)
return props;
}

/**
*
* @param props
*/
private void initializeClient(Properties props)
{
if (null == props || props.size() == 0)
Expand Down Expand Up @@ -195,6 +204,12 @@ private void initializeClient(Properties props)
velocityEngine.setProperty("output.encoding", "UTF-8");
}

/**
* Remove stopwords from given string
* @param summary
* @param stopWordsList
* @return
*/
private String removeStopWordsFrom(String summary, String stopWordsList)
{
if (null == stopWordsList || stopWordsList.length() < 1)
Expand All @@ -212,6 +227,12 @@ private String removeStopWordsFrom(String summary, String stopWordsList)
return summary;
}

/**
* truncate given string after occurrence of any/all of the given truncate stop words
* @param summary
* @param truncateStopWords
* @return
*/
private String truncateAfterStopWords(String summary, String truncateStopWords)
{
if (null == truncateStopWords || truncateStopWords.trim().length() < 1)
Expand All @@ -232,6 +253,11 @@ private String truncateAfterStopWords(String summary, String truncateStopWords)
return summary;
}

/**
* Attach configured files to given jiraId
* @param jiraId
* @return
*/
private String attachFilesToIssue(String jiraId)
{
String attachments = System.getProperty(BUG_ATTACHMENTS, configuration.getProperty(BUG_ATTACHMENTS));
Expand Down
Loading

0 comments on commit ce1030b

Please sign in to comment.