Skip to content

Commit bb787fd

Browse files
authored
Merge pull request reportportal#1 from reportportal/master
Sync the repo
2 parents f8db413 + 18d10d8 commit bb787fd

18 files changed

+1804
-4
lines changed

.gitignore

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
# Compiled class file
22
*.class
33

4+
# Mobile Tools for Java (J2ME)
5+
.mtj.tmp/
6+
47
# Log file
58
*.log
69

710
# BlueJ files
811
*.ctxt
912

10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
12-
1313
# Package Files #
1414
*.jar
1515
*.war
1616
*.ear
1717
*.zip
1818
*.tar.gz
1919
*.rar
20+
!gradle/wrapper/**
2021

2122
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2223
hs_err_pid*
24+
25+
.DS_Store
26+
27+
.gradle/
28+
build/
29+
30+
# IntelliJ Idea files
31+
.idea/
32+
*.iml

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: java
2+
3+
script: ./gradlew build
4+
5+
jdk:
6+
- oraclejdk8
7+
8+
notifications:
9+
slack: reportportal:fl6xWHVQp1jvsMmCJxYW9YKP

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 4.0.0
4+
##### First release of Report Portal Java agent for Cucumber 2 for server version 4.0.x
5+
* Initial release to Public Maven Repositories

README.md

Lines changed: 194 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,194 @@
1-
# agent-java-cucumber2
1+
# Cucumber2 Agent for ReportPortal
2+
[ ![Download](https://api.bintray.com/packages/epam/reportportal/agent-java-cucumber2/images/download.svg) ](https://github.com/reportportal/agent-java-cucumber2/_latestVersion)
3+
4+
[![Join Slack chat!](https://reportportal-slack-auto.herokuapp.com/badge.svg)](https://reportportal-slack-auto.herokuapp.com)
5+
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
6+
[![UserVoice](https://img.shields.io/badge/uservoice-vote%20ideas-orange.svg?style=flat)](https://rpp.uservoice.com/forums/247117-report-portal)
7+
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)
8+
9+
10+
### Installation
11+
12+
Add to POM.xml
13+
14+
**dependency**
15+
16+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17+
<repositories>
18+
<repository>
19+
<snapshots>
20+
<enabled>false</enabled>
21+
</snapshots>
22+
<id>bintray-epam-reportportal</id>
23+
<name>bintray</name>
24+
<url>http://dl.bintray.com/epam/reportportal</url>
25+
</repository>
26+
</repositories>
27+
28+
29+
30+
<dependency>
31+
<groupId>com.epam.reportportal</groupId>
32+
<artifactId>agent-java-cucumber2</artifactId>
33+
<version>4.0.0</version>
34+
</dependency>
35+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36+
37+
### Install Reporter
38+
39+
As Cucumber runs your features, it calls out to any number of listener objects to let them know
40+
how it’s progressing. These listeners are notified at various points throughout the run of features.
41+
This principle is used to notify ReportPortal about your tests progress in real-time.
42+
ReportPortal supports two kinds of Reporters.
43+
Both of them allow you to report your execution progress to ReportPortal,
44+
but there are some differences in report structure.
45+
46+
* **Scenario Reporter**
47+
* **Step Reporter**
48+
Step Reporter propagates the most traditional for ReportPortal test structure
49+
keeping your scenarios and steps inside as separate entities. In opposite, Scenario Reporter
50+
use scenario as the base point and does not separate step from each other which is sometimes more
51+
convenient for BDD users.
52+
53+
Enabling **StepReporter**:
54+
```java
55+
@RunWith(Cucumber.class)
56+
@CucumberOptions(plugin = {"pretty", "com.epam.reportportal.cucumber.StepReporter"})
57+
public class RunCukesTest {
58+
}
59+
```
60+
61+
Enabling **ScenarioReporter**:
62+
```java
63+
@RunWith(Cucumber.class)
64+
@CucumberOptions(plugin = {"pretty", "com.epam.reportportal.cucumber.ScenarioReporter"})
65+
public class RunCukesTest {
66+
}
67+
```
68+
69+
70+
### Configuration
71+
72+
Copy you configuration from UI of Report Portal at [User Profile](<#user-profile>) section
73+
74+
or
75+
76+
In order to start using of agent, user should configure property file
77+
"reportportal.properties" in such format:
78+
79+
**reportportal.properties**
80+
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82+
rp.endpoint = https://rp.epam.com/
83+
rp.username = default
84+
rp.uuid = 8967de3b-fec7-47bb-9dbc-2aa4ceab8b1e
85+
rp.launch = default_TEST_EXAMPLE
86+
rp.project = default_project
87+
88+
## OPTIONAL PARAMETERS
89+
rp.tags = TAG1;TAG2
90+
rp.keystore.resource = reportportal-client-v2.jks
91+
rp.keystore.password = reportportal
92+
93+
rp.batch.size.logs = 5
94+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95+
96+
97+
**Parameters**
98+
99+
User should provide next parameters to agent.
100+
101+
| **Parameter** | **Description** | **Required**|
102+
|-----------------------------------------------|----------------------|-------------|
103+
|rp.enable |Enable/Disable logging to report portal: rp.enable=true - enable log to RP server. Any other value means 'false': rp.enable=false - disable log to RP server. If parameter is skipped in properties file then automation project results will be posted on RP. |No |
104+
|rp.username |User name |Yes |
105+
|rp.password |User password. **We strongly recommend to use UUID** or separate ReportPortal internal users password here to avoid domain password publishing. |Yes |
106+
|rp.uuid |UUID of user. |Yes |
107+
|rp.endpoint |URL of web service, where requests should be sent |Yes |
108+
|rp.launch |The unique name of Launch (Run), based on that name a history of runs will be created for the particular name |Yes |
109+
|rp.project |Project name, to identify scope |Yes |
110+
|rp.tags |Set of tags for specifying additional meta information for current launch. Format: tag1;tag2;build:12345-6. Tags should be separated by “;”. There are one special tag- build – it should be used for specification number of build for launch. |No |
111+
|rp.batch.size.logs |In order to rise up performance and reduce number of requests to server |Yes |
112+
|rp.keystore.resource |Put your JKS file into resources and specify path to it | |
113+
|rp.keystore.password |Access password for JKS (certificate storage) package, mentioned above | |
114+
|rp.convertimage |Colored log images can be converted to grayscale for reducing image size. Values: ‘true’ – will be converted. Any other value means false. |No |
115+
|rp.mode |Report portal provide possibility to specify visibility of executing launch. Currently supported two modes: DEFAULT - all users from project can see this launch; DEBUG - only owner can see this launch(in debug sub tab). Note: for all java based clients(TestNg, Junit) mode will be set automaticaly to "DEFAULT" if it is not specified. |No |
116+
|rp.skipped.issue |Report Portal provide feature to mark skipped tests as not 'To Investigate' items on WS side. Parameter could be equal boolean values: *TRUE* - skipped tests considered as issues and will be mark as 'To Investigate' on portal. *FALSE* - skipped tests will not be mark as 'To Investigate' on portal. |No |
117+
118+
119+
Launch name can be edited once, and should be edited once, before first
120+
execution. As usual, parts of launches are fixed for a long time. Keeping the
121+
same name for launch, here we will understand a fixed list of suites under
122+
launch, will help to have a history trend, and on UI instances of the same
123+
launch will be saved with postfix "\#number", like "Test Launch \#1", "Test
124+
Launch \#2" etc.
125+
126+
> If mandatory properties are missed client throw exception
127+
> IllegalArgumentException.
128+
129+
**Proxy configuration**
130+
131+
The client uses standard java proxy mechanism. If you are new try [Java networking and proxies](<http://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html>) page.
132+
133+
Ways to set up properties:
134+
135+
a. reportportal.properties file
136+
b. command line properties (-Dhttps.proxyHost=localhost)
137+
138+
**How to provide parameters**
139+
140+
There are two way to load parameters.
141+
142+
- Load from properties file
143+
144+
Properties file should have name: “reportportal.properties”. Properties file can
145+
be situated on the class path (in the project directory).
146+
147+
If listener can’t find properties file it throws FileNotFoundException. By
148+
default “reportportal.properties” exists in the reportportall-client.jar, but
149+
user can create his own “reportportal.properties” file and put in class path.
150+
151+
- Use system variables
152+
153+
**Parameters loading order**
154+
155+
Client loads properties in the next order. Every next level overrides previous:
156+
157+
a. Properties file. Client loads all known to him properties (specified in the
158+
"Input Parameters" section) from "reportportal.properties" file.
159+
160+
b. Environment variables. If environment variables with names specified in the
161+
"Input Parameters" section exist client reload existing properties from
162+
environment variables.
163+
164+
c. JVM variables. If JVM variables with names specified in the
165+
"Input Parameters" section exist, client overrides existing ones from
166+
JVM variables.
167+
168+
#### Events
169+
170+
* TestRunStarted - the first event sent.
171+
* TestSourceRead - sent for each feature file read, contains the feature file source.
172+
* TestCaseStarted - sent before starting the execution of a Test Case(/Pickle/Scenario), contains the Test Case
173+
* TestStepStarted - sent before starting the execution of a Test Step, contains the Test Step
174+
* TestStepFinished - sent after the execution of a Test Step, contains the Test Step and its Result.
175+
* TestCaseFinished - sent after the execution of a Test Case(/Pickle/Scenario), contains the Test Case and its Result.
176+
* TestRunFinished - the last event sent.
177+
* EmbedEvent - calling scenario.embed in a hook triggers this event.
178+
* WriteEvent - calling scenario.write in a hook triggers this event.
179+
180+
#### Main methods
181+
182+
* setEventPublisher(EventPublisher publisher) - the only method that should be overidden to implement Formatter functionality
183+
* beforeLaunch - manipulations before/after the launch is started
184+
* afterLaunch - manipulations before/after the launch is finished
185+
* beforeFeature - manipulations before/after new feature is started
186+
* afterFeature - manipulations before/after current feature is finished
187+
* beforeScenario - manipulations before/after new scenario is started
188+
* afterScenario - manipulations before/after current scenario is finished
189+
* startFeature - starting new feature
190+
* startLaunch - starting new launch
191+
* beforeStep - manipulations before/after new step is started
192+
* afterStep - manipulations before/after current step is finished
193+
* beforeHooks - manipulations before/after new hook is started
194+
* afterHooks - manipulations before/after current hook is finished

build.gradle

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
plugins {
2+
id 'net.researchgate.release' version '2.4.1'
3+
id "com.jfrog.bintray" version "1.7"
4+
}
5+
6+
apply plugin: 'java'
7+
apply from: 'release-lib.gradle'
8+
apply from: 'quality.gradle'
9+
10+
sourceCompatibility = 1.6
11+
targetCompatibility = 1.6
12+
13+
repositories {
14+
jcenter()
15+
maven { url "http://dl.bintray.com/epam/reportportal" }
16+
maven { url "https://jitpack.io" }
17+
18+
}
19+
20+
dependencies {
21+
compile('com.epam.reportportal:client-java:4.0.0-BETA-1') {
22+
ext.compileScope = true
23+
}
24+
compile('com.epam.reportportal:commons-model:4.0.0') {
25+
ext.compileScope = true
26+
}
27+
28+
29+
compile group: 'io.cucumber', name: 'cucumber-java', version: '2.3.1'
30+
}
31+
32+
task wrapper(type: Wrapper) {
33+
gradleVersion = '3.5'
34+
}
35+
36+
publishing.publications.all {
37+
pom.withXml {
38+
asNode().dependencies.'*'.findAll() {
39+
it.scope.text() == 'runtime' && (project.configurations.compile.allDependencies.find { dep ->
40+
dep.name == it.artifactId.text() && dep.hasProperty('compileScope') && dep.compileScope
41+
})
42+
}.each {
43+
it.scope*.value = 'compile'
44+
}
45+
}
46+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version=4.0.0-SNAPSHOT

gradle/wrapper/gradle-wrapper.jar

53.5 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Fri Jun 09 15:28:27 MSK 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip

0 commit comments

Comments
 (0)