diff --git a/CHANGELOG.md b/CHANGELOG.md index b958f88..9244d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Changed +- Client version updated on [5.2.0](https://github.com/reportportal/client-java/releases/tag/5.2.0), by @HardNorth ## [5.1.4] ### Changed diff --git a/README.md b/README.md index 9d8eb69..90a1cb3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Cucumber Agent for ReportPortal -> **DISCLAIMER**: We use Google Analytics for sending anonymous usage information such as agent's and client's names, and their versions -> after a successful launch start. This information might help us to improve both ReportPortal backend and client sides. It is used by the -> ReportPortal team only and is not supposed for sharing with 3rd parties. +> **DISCLAIMER**: We use Google Analytics for sending anonymous usage information such as agent's and client's names, +> and their versions after a successful launch start. This information might help us to improve both ReportPortal +> backend and client sides. It is used by the ReportPortal team only and is not supposed for sharing with 3rd parties. -[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-cucumber.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber%22) +[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-cucumber.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.epam.reportportal/agent-java-cucumber) [![CI Build](https://github.com/reportportal/agent-java-cucumber/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/agent-java-cucumber/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/reportportal/agent-java-cucumber/branch/develop/graph/badge.svg?token=Gngiq9WifC)](https://codecov.io/gh/reportportal/agent-java-cucumber) [![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/) @@ -12,63 +12,70 @@ [![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat) --- + - [Compatibility matrix](https://github.com/reportportal/agent-java-cucumber#compatibility-matrix-for-cucumber-agents) - [Dependencies](https://github.com/reportportal/agent-java-cucumber#installation) - [Install Reporter](https://github.com/reportportal/agent-java-cucumber#install-reporter) - - [Scenario Reporter](https://github.com/reportportal/agent-java-cucumber#scenario-reporter) - - [Step reporter](https://github.com/reportportal/agent-java-cucumber#step-reporter) - - [reportportal.properties](https://github.com/reportportal/agent-java-cucumber#reportportal.properties) - - [Parameters](https://github.com/reportportal/agent-java-cucumber#parameters) - - [Proxy Configuration](https://github.com/reportportal/agent-java-cucumber#proxy-configuration) - - [How to provide parameters](https://github.com/reportportal/agent-java-cucumber#how-to-privde-parameters) - - [Parameters loading order](https://github.com/reportportal/agent-java-cucumber#prameters-oading-rder) + - [Scenario Reporter](https://github.com/reportportal/agent-java-cucumber#scenario-reporter) + - [Step reporter](https://github.com/reportportal/agent-java-cucumber#step-reporter) + - [reportportal.properties](https://github.com/reportportal/agent-java-cucumber#reportportal.properties) + - [Parameters](https://github.com/reportportal/agent-java-cucumber#parameters) + - [Proxy Configuration](https://github.com/reportportal/agent-java-cucumber#proxy-configuration) + - [How to provide parameters](https://github.com/reportportal/agent-java-cucumber#how-to-privde-parameters) + - [Parameters loading order](https://github.com/reportportal/agent-java-cucumber#prameters-oading-rder) - [Configuration](https://github.com/reportportal/agent-java-cucumber#configuration) - [Events](https://github.com/reportportal/agent-java-cucumber#events) + --- ## Compatibility matrix for cucumber agents -| Version(s) of cucumber java and cucumber junit | Gherkin's version(s) | Link to agent's repo | Link to agent's github | -| - | - | - | - | -| 1.2.5 | 2.12.2 | [binaries/cucumber1](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber%22) | [sources/cucumber1](https://github.com/reportportal/agent-java-cucumber) | -| 2.0.0 - 2.4.0 | 3.2.0 - 5.1.0 | [binaries/cucumber2](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber2%22) | [sources/cucumber2](https://github.com/reportportal/agent-java-cucumber2) | -| 3.0.0 - 3.0.2 | _ | [binaries/cucumber3](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber3%22) | [sources/cucumber3](https://github.com/reportportal/agent-java-cucumber3) | -| 4.4.0 - 4.8.1 | 3.2.0 - 5.1.0 | [binaries/cucumber4](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber4%22) | [sources/cucumber4](https://github.com/reportportal/agent-java-cucumber4) | -| 5.0.0 - 5.7.0 | _ | [binaries/cucumber5](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber5%22) | [sources/cucumber5](https://github.com/reportportal/agent-java-cucumber5) | -| 6.0.0 - 7.0.0 | 6.0.0 - 7.0.0 | [binaries/cucumber6](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber6%22) | [sources/cucumber6](https://github.com/reportportal/agent-java-cucumber6) | +| Version(s) of cucumber java and cucumber junit | Gherkin's version(s) | Link to agent's repo | Link to agent's github | +|------------------------------------------------|----------------------|----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| +| 1.2.5 | 2.12.2 | [binaries/cucumber1](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber%22) | [sources/cucumber1](https://github.com/reportportal/agent-java-cucumber) | +| 2.0.0 - 2.4.0 | 3.2.0 - 5.1.0 | [binaries/cucumber2](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber2%22) | [sources/cucumber2](https://github.com/reportportal/agent-java-cucumber2) | +| 3.0.0 - 3.0.2 | _ | [binaries/cucumber3](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber3%22) | [sources/cucumber3](https://github.com/reportportal/agent-java-cucumber3) | +| 4.4.0 - 4.8.1 | 3.2.0 - 5.1.0 | [binaries/cucumber4](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber4%22) | [sources/cucumber4](https://github.com/reportportal/agent-java-cucumber4) | +| 5.0.0 - 5.7.0 | _ | [binaries/cucumber5](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber5%22) | [sources/cucumber5](https://github.com/reportportal/agent-java-cucumber5) | +| 6.0.0 - 7.0.0 | 6.0.0 - 7.0.0 | [binaries/cucumber6](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber6%22) | [sources/cucumber6](https://github.com/reportportal/agent-java-cucumber6) | ## Installation Add to POM.xml **dependency** + ```xml + - com.epam.reportportal - agent-java-cucumber - 5.1.4 + com.epam.reportportal + agent-java-cucumber + 5.1.4 ``` ## Install Reporter -As Cucumber runs your features, it calls out to any number of listener objects to let them know -how it’s progressing. These listeners are notified at various points throughout the run of features. -This principle is used to notify ReportPortal about your tests progress in real-time. -ReportPortal supports two kinds of Reporters. -Both of them allow you to report your execution progress to ReportPortal, -but there are some differences in report structure. +As Cucumber runs your features, it calls out to any number of listener objects to let them know +how it’s progressing. These listeners are notified at various points throughout the run of features. +This principle is used to notify ReportPortal about your tests progress in real-time. +ReportPortal supports two kinds of Reporters. +Both of them allow you to report your execution progress to ReportPortal, +but there are some differences in report structure. ## Scenario Reporter ## Step Reporter -Step Reporter propagates the most traditional for ReportPortal test structure -keeping your scenarios and steps inside as separate entities. In opposite, Scenario Reporter + +Step Reporter propagates the most traditional for ReportPortal test structure +keeping your scenarios and steps inside as separate entities. In opposite, Scenario Reporter use scenario as the base point and does not separate step from each other which is sometimes more -convenient for BDD users. +convenient for BDD users. Enabling **StepReporter**: + ```java + @RunWith(Cucumber.class) @CucumberOptions(plugin = {"pretty", "com.epam.reportportal.cucumber.StepReporter"}) public class RunCukesTest { @@ -76,17 +83,18 @@ public class RunCukesTest { ``` Enabling **ScenarioReporter**: + ```java + @RunWith(Cucumber.class) @CucumberOptions(plugin = {"pretty", "com.epam.reportportal.cucumber.ScenarioReporter"}) public class RunCukesTest { } ``` - ## Configuration -Copy you configuration from UI of Report Portal at [User Profile](<#user-profile>) section +Copy you configuration from UI of ReportPortal at `User Profile` section or @@ -96,40 +104,37 @@ In order to start using of agent, user should configure property file ### reportportal.properties ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -rp.endpoint = https://web.demo.reportportal.io +rp.endpoint = https://demo.reportportal.io rp.username = default -rp.uuid = 5145b879-83d9-4692-8b07-928cc4b2af7a +rp.api.key = 5145b879-83d9-4692-8b07-928cc4b2af7a rp.launch = default_TEST_EXAMPLE rp.project = default_project ## OPTIONAL PARAMETERS -rp.tags = TAG1;TAG2 +rp.attributes = TAG1;TAG2;key:value rp.keystore.resource = reportportal-client-v2.jks rp.keystore.password = reportportal - -rp.batch.size.logs = 5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ### Parameters -User should provide next parameters to agent. These are only examples, for the aclual list of parameters please look into [client-java](https://github.com/reportportal/client-java) repository. - -| **Parameter** | **Description** | **Required**| -|-----------------------------------------------|----------------------|-------------| -|rp.endpoint |URL of web service, where requests should be send |Yes | -|rp.uuid |UUID of user. |Yes | -|rp.launch |The unique name of Launch (Run). Based on that name a history of runs will be created for particular name |Yes | -|rp.project |Project name to identify scope |Yes | -|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 absent in properties file then automation project results will be posted on RP. |No | -|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 | -|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 | -|rp.mode |ReportPortal provides possibility to specify visibility of executing launch. Currently two modes are supported: DEFAULT - all users from project can see this launch; DEBUG - all users except of Customer role can see this launch (in debug sub tab). Note: for all java based clients (TestNG, Junit) mode will be set automatically to "DEFAULT" if it is not specified. |No | -|rp.skipped.issue |ReportPortal provides 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 marked as 'To Investigate' on Report Portal. *FALSE* - skipped tests will not be marked as 'To Investigate' on application. |No | -|rp.batch.size.logs |In order to rise up performance and reduce number of requests to server. Default = 10 |No | -|rp.keystore.resource |Put your JKS file into resources and specify path to it | No| -|rp.keystore.password |Access password for JKS (certificate storage) package, mentioned above |No | - +User should provide next parameters to agent. These are only examples, for the actual list of parameters please look +into [client-java](https://github.com/reportportal/client-java) repository. + +| **Parameter** | **Description** | **Required** | +|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------| +| rp.endpoint | URL of web service, where requests should be send | Yes | +| rp.api.key | API key of the user. | Yes | +| rp.launch | The unique name of Launch (Run). Based on that name a history of runs will be created for particular name | Yes | +| rp.project | Project name to identify scope | Yes | +| rp.enable | Enable/Disable logging to ReportPortal: rp.enable=true - enable log to RP server. Any other value means 'false': rp.enable=false - disable log to RP server. If parameter is absent in properties file then automation project results will be posted on RP. | No | +| 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 | +| 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 | +| rp.mode | ReportPortal provides possibility to specify visibility of executing launch. Currently two modes are supported: DEFAULT - all users from project can see this launch; DEBUG - all users except of Customer role can see this launch (in debug sub tab). Note: for all java based clients (TestNG, Junit) mode will be set automatically to "DEFAULT" if it is not specified. | No | +| rp.skipped.issue | ReportPortal provides 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 marked as 'To Investigate' on ReportPortal. *FALSE* - skipped tests will not be marked as 'To Investigate' on application. | No | +| rp.batch.size.logs | In order to rise up performance and reduce number of requests to server. Default = 10 | No | +| rp.keystore.resource | Put your JKS file into resources and specify path to it | No | +| rp.keystore.password | Access password for JKS (certificate storage) package, mentioned above | No | Launch name can be edited once, and should be edited once, before first execution. As usual, parts of launches are fixed for a long time. Keeping the @@ -138,12 +143,13 @@ launch, will help to have a history trend, and on UI instances of the same launch will be saved with postfix "\#number", like "Test Launch \#1", "Test Launch \#2" etc. -> If mandatory properties are missed client throw exception -> IllegalArgumentException. +> If mandatory properties are missed client throw exception +> IllegalArgumentException. ### Proxy configuration -The client uses standard java proxy mechanism. If you are new try [Java networking and proxies]() page. +The client uses standard java proxy mechanism. If you are new +try [Java networking and proxies]() page. Ways to set up properties: @@ -159,9 +165,7 @@ There are two way to load parameters. Properties file should have name: “reportportal.properties”. Properties file can be situated on the class path (in the project directory). -If listener can’t find properties file it throws FileNotFoundException. By -default “reportportal.properties” exists in the reportportall-client.jar, but -user can create his own “reportportal.properties” file and put in class path. +If listener can’t find properties file it throws FileNotFoundException. - Use system variables @@ -169,16 +173,16 @@ user can create his own “reportportal.properties” file and put in class path Client loads properties in the next order. Every next level overrides previous: -a. Properties file. Client loads all known to him properties (specified in the - "Input Parameters" section) from "reportportal.properties" file. +a. Properties file. Client loads all known to him properties (specified in the +"Input Parameters" section) from "reportportal.properties" file. -b. Environment variables. If environment variables with names specified in the - "Input Parameters" section exist client reload existing properties from - environment variables. +b. Environment variables. If environment variables with names specified in the +"Input Parameters" section exist client reload existing properties from +environment variables. -c. JVM variables. If JVM variables with names specified in the - "Input Parameters" section exist, client overrides existing ones from - JVM variables. +c. JVM variables. If JVM variables with names specified in the +"Input Parameters" section exist, client overrides existing ones from +JVM variables. ### Events @@ -190,13 +194,13 @@ c. JVM variables. If JVM variables with names specified in the * step - collects step to be sent to ReportPortal afterwards * Examples - generates data being sent to ReportPortal to report examples table * background - notifies ReportPortal that before-* hooks have been finished -* Match - notify ReportPortal that next step of current scenario is started +* Match - notify ReportPortal that next step of current scenario is started * Result - notify ReportPortal that step has finished and after-* hooks should be started (if any) -* After - notify ReportPortal that after-* hook has finished +* After - notify ReportPortal that after-* hook has finished * Embedding/Write - sends log to ReportPortal -* endOfScenarioLifeCycle - notifies ReportPortal that after-* hooks of scenario has been finished +* endOfScenarioLifeCycle - notifies ReportPortal that after-* hooks of scenario has been finished * eof - notifies ReportPortal that test feature execution is finished * done - IS NOT processed by ReportPortal agent * close - notifies ReportPortal that test execution is finished -* SyntaxError - IS NOT processed by ReportPortal agent +* SyntaxError - IS NOT processed by ReportPortal agent * ScenarioOutline - IS NOT processed by ReportPortal agent diff --git a/README_TEMPLATE.md b/README_TEMPLATE.md index cff24d9..7fdedd6 100644 --- a/README_TEMPLATE.md +++ b/README_TEMPLATE.md @@ -1,10 +1,10 @@ # Cucumber Agent for ReportPortal -> **DISCLAIMER**: We use Google Analytics for sending anonymous usage information such as agent's and client's names, and their versions -> after a successful launch start. This information might help us to improve both ReportPortal backend and client sides. It is used by the -> ReportPortal team only and is not supposed for sharing with 3rd parties. +> **DISCLAIMER**: We use Google Analytics for sending anonymous usage information such as agent's and client's names, +> and their versions after a successful launch start. This information might help us to improve both ReportPortal +> backend and client sides. It is used by the ReportPortal team only and is not supposed for sharing with 3rd parties. -[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-cucumber.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber%22) +[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-cucumber.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.epam.reportportal/agent-java-cucumber) [![CI Build](https://github.com/reportportal/agent-java-cucumber/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/agent-java-cucumber/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/reportportal/agent-java-cucumber/branch/develop/graph/badge.svg?token=Gngiq9WifC)](https://codecov.io/gh/reportportal/agent-java-cucumber) [![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/) @@ -12,36 +12,39 @@ [![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat) --- + - [Compatibility matrix](https://github.com/reportportal/agent-java-cucumber#compatibility-matrix-for-cucumber-agents) - [Dependencies](https://github.com/reportportal/agent-java-cucumber#installation) - [Install Reporter](https://github.com/reportportal/agent-java-cucumber#install-reporter) - - [Scenario Reporter](https://github.com/reportportal/agent-java-cucumber#scenario-reporter) - - [Step reporter](https://github.com/reportportal/agent-java-cucumber#step-reporter) - - [reportportal.properties](https://github.com/reportportal/agent-java-cucumber#reportportal.properties) - - [Parameters](https://github.com/reportportal/agent-java-cucumber#parameters) - - [Proxy Configuration](https://github.com/reportportal/agent-java-cucumber#proxy-configuration) - - [How to provide parameters](https://github.com/reportportal/agent-java-cucumber#how-to-privde-parameters) - - [Parameters loading order](https://github.com/reportportal/agent-java-cucumber#prameters-oading-rder) + - [Scenario Reporter](https://github.com/reportportal/agent-java-cucumber#scenario-reporter) + - [Step reporter](https://github.com/reportportal/agent-java-cucumber#step-reporter) + - [reportportal.properties](https://github.com/reportportal/agent-java-cucumber#reportportal.properties) + - [Parameters](https://github.com/reportportal/agent-java-cucumber#parameters) + - [Proxy Configuration](https://github.com/reportportal/agent-java-cucumber#proxy-configuration) + - [How to provide parameters](https://github.com/reportportal/agent-java-cucumber#how-to-privde-parameters) + - [Parameters loading order](https://github.com/reportportal/agent-java-cucumber#prameters-oading-rder) - [Configuration](https://github.com/reportportal/agent-java-cucumber#configuration) - [Events](https://github.com/reportportal/agent-java-cucumber#events) + --- ## Compatibility matrix for cucumber agents -| Version(s) of cucumber java and cucumber junit | Gherkin's version(s) | Link to agent's repo | Link to agent's github | -| - | - | - | - | -| 1.2.5 | 2.12.2 | [binaries/cucumber1](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber%22) | [sources/cucumber1](https://github.com/reportportal/agent-java-cucumber) | -| 2.0.0 - 2.4.0 | 3.2.0 - 5.1.0 | [binaries/cucumber2](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber2%22) | [sources/cucumber2](https://github.com/reportportal/agent-java-cucumber2) | -| 3.0.0 - 3.0.2 | _ | [binaries/cucumber3](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber3%22) | [sources/cucumber3](https://github.com/reportportal/agent-java-cucumber3) | -| 4.4.0 - 4.8.1 | 3.2.0 - 5.1.0 | [binaries/cucumber4](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber4%22) | [sources/cucumber4](https://github.com/reportportal/agent-java-cucumber4) | -| 5.0.0 - 5.7.0 | _ | [binaries/cucumber5](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber5%22) | [sources/cucumber5](https://github.com/reportportal/agent-java-cucumber5) | -| 6.0.0 - 7.0.0 | 6.0.0 - 7.0.0 | [binaries/cucumber6](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber6%22) | [sources/cucumber6](https://github.com/reportportal/agent-java-cucumber6) | +| Version(s) of cucumber java and cucumber junit | Gherkin's version(s) | Link to agent's repo | Link to agent's github | +|------------------------------------------------|----------------------|----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| +| 1.2.5 | 2.12.2 | [binaries/cucumber1](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber%22) | [sources/cucumber1](https://github.com/reportportal/agent-java-cucumber) | +| 2.0.0 - 2.4.0 | 3.2.0 - 5.1.0 | [binaries/cucumber2](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber2%22) | [sources/cucumber2](https://github.com/reportportal/agent-java-cucumber2) | +| 3.0.0 - 3.0.2 | _ | [binaries/cucumber3](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber3%22) | [sources/cucumber3](https://github.com/reportportal/agent-java-cucumber3) | +| 4.4.0 - 4.8.1 | 3.2.0 - 5.1.0 | [binaries/cucumber4](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber4%22) | [sources/cucumber4](https://github.com/reportportal/agent-java-cucumber4) | +| 5.0.0 - 5.7.0 | _ | [binaries/cucumber5](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber5%22) | [sources/cucumber5](https://github.com/reportportal/agent-java-cucumber5) | +| 6.0.0 - 7.0.0 | 6.0.0 - 7.0.0 | [binaries/cucumber6](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-cucumber6%22) | [sources/cucumber6](https://github.com/reportportal/agent-java-cucumber6) | ## Installation Add to POM.xml **dependency** + ```xml com.epam.reportportal @@ -52,22 +55,24 @@ Add to POM.xml ## Install Reporter -As Cucumber runs your features, it calls out to any number of listener objects to let them know -how it’s progressing. These listeners are notified at various points throughout the run of features. -This principle is used to notify ReportPortal about your tests progress in real-time. -ReportPortal supports two kinds of Reporters. -Both of them allow you to report your execution progress to ReportPortal, -but there are some differences in report structure. +As Cucumber runs your features, it calls out to any number of listener objects to let them know +how it’s progressing. These listeners are notified at various points throughout the run of features. +This principle is used to notify ReportPortal about your tests progress in real-time. +ReportPortal supports two kinds of Reporters. +Both of them allow you to report your execution progress to ReportPortal, +but there are some differences in report structure. ## Scenario Reporter ## Step Reporter -Step Reporter propagates the most traditional for ReportPortal test structure -keeping your scenarios and steps inside as separate entities. In opposite, Scenario Reporter + +Step Reporter propagates the most traditional for ReportPortal test structure +keeping your scenarios and steps inside as separate entities. In opposite, Scenario Reporter use scenario as the base point and does not separate step from each other which is sometimes more -convenient for BDD users. +convenient for BDD users. Enabling **StepReporter**: + ```java @RunWith(Cucumber.class) @CucumberOptions(plugin = {"pretty", "com.epam.reportportal.cucumber.StepReporter"}) @@ -76,6 +81,7 @@ public class RunCukesTest { ``` Enabling **ScenarioReporter**: + ```java @RunWith(Cucumber.class) @CucumberOptions(plugin = {"pretty", "com.epam.reportportal.cucumber.ScenarioReporter"}) @@ -83,10 +89,9 @@ public class RunCukesTest { } ``` - ## Configuration -Copy you configuration from UI of Report Portal at [User Profile](<#user-profile>) section +Copy you configuration from UI of ReportPortal at `User Profile` section or @@ -96,40 +101,37 @@ In order to start using of agent, user should configure property file ### reportportal.properties ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -rp.endpoint = https://web.demo.reportportal.io +rp.endpoint = https://demo.reportportal.io rp.username = default -rp.uuid = 5145b879-83d9-4692-8b07-928cc4b2af7a +rp.api.key = 5145b879-83d9-4692-8b07-928cc4b2af7a rp.launch = default_TEST_EXAMPLE rp.project = default_project ## OPTIONAL PARAMETERS -rp.tags = TAG1;TAG2 +rp.attributes = TAG1;TAG2;key:value rp.keystore.resource = reportportal-client-v2.jks rp.keystore.password = reportportal - -rp.batch.size.logs = 5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ### Parameters -User should provide next parameters to agent. These are only examples, for the aclual list of parameters please look into [client-java](https://github.com/reportportal/client-java) repository. - -| **Parameter** | **Description** | **Required**| -|-----------------------------------------------|----------------------|-------------| -|rp.endpoint |URL of web service, where requests should be send |Yes | -|rp.uuid |UUID of user. |Yes | -|rp.launch |The unique name of Launch (Run). Based on that name a history of runs will be created for particular name |Yes | -|rp.project |Project name to identify scope |Yes | -|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 absent in properties file then automation project results will be posted on RP. |No | -|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 | -|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 | -|rp.mode |ReportPortal provides possibility to specify visibility of executing launch. Currently two modes are supported: DEFAULT - all users from project can see this launch; DEBUG - all users except of Customer role can see this launch (in debug sub tab). Note: for all java based clients (TestNG, Junit) mode will be set automatically to "DEFAULT" if it is not specified. |No | -|rp.skipped.issue |ReportPortal provides 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 marked as 'To Investigate' on Report Portal. *FALSE* - skipped tests will not be marked as 'To Investigate' on application. |No | -|rp.batch.size.logs |In order to rise up performance and reduce number of requests to server. Default = 10 |No | -|rp.keystore.resource |Put your JKS file into resources and specify path to it | No| -|rp.keystore.password |Access password for JKS (certificate storage) package, mentioned above |No | - +User should provide next parameters to agent. These are only examples, for the actual list of parameters please look +into [client-java](https://github.com/reportportal/client-java) repository. + +| **Parameter** | **Description** | **Required** | +|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------| +| rp.endpoint | URL of web service, where requests should be send | Yes | +| rp.api.key | API key of the user. | Yes | +| rp.launch | The unique name of Launch (Run). Based on that name a history of runs will be created for particular name | Yes | +| rp.project | Project name to identify scope | Yes | +| rp.enable | Enable/Disable logging to ReportPortal: rp.enable=true - enable log to RP server. Any other value means 'false': rp.enable=false - disable log to RP server. If parameter is absent in properties file then automation project results will be posted on RP. | No | +| 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 | +| 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 | +| rp.mode | ReportPortal provides possibility to specify visibility of executing launch. Currently two modes are supported: DEFAULT - all users from project can see this launch; DEBUG - all users except of Customer role can see this launch (in debug sub tab). Note: for all java based clients (TestNG, Junit) mode will be set automatically to "DEFAULT" if it is not specified. | No | +| rp.skipped.issue | ReportPortal provides 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 marked as 'To Investigate' on ReportPortal. *FALSE* - skipped tests will not be marked as 'To Investigate' on application. | No | +| rp.batch.size.logs | In order to rise up performance and reduce number of requests to server. Default = 10 | No | +| rp.keystore.resource | Put your JKS file into resources and specify path to it | No | +| rp.keystore.password | Access password for JKS (certificate storage) package, mentioned above | No | Launch name can be edited once, and should be edited once, before first execution. As usual, parts of launches are fixed for a long time. Keeping the @@ -138,12 +140,13 @@ launch, will help to have a history trend, and on UI instances of the same launch will be saved with postfix "\#number", like "Test Launch \#1", "Test Launch \#2" etc. -> If mandatory properties are missed client throw exception -> IllegalArgumentException. +> If mandatory properties are missed client throw exception +> IllegalArgumentException. ### Proxy configuration -The client uses standard java proxy mechanism. If you are new try [Java networking and proxies]() page. +The client uses standard java proxy mechanism. If you are new +try [Java networking and proxies]() page. Ways to set up properties: @@ -159,9 +162,7 @@ There are two way to load parameters. Properties file should have name: “reportportal.properties”. Properties file can be situated on the class path (in the project directory). -If listener can’t find properties file it throws FileNotFoundException. By -default “reportportal.properties” exists in the reportportall-client.jar, but -user can create his own “reportportal.properties” file and put in class path. +If listener can’t find properties file it throws FileNotFoundException. - Use system variables @@ -169,16 +170,16 @@ user can create his own “reportportal.properties” file and put in class path Client loads properties in the next order. Every next level overrides previous: -a. Properties file. Client loads all known to him properties (specified in the - "Input Parameters" section) from "reportportal.properties" file. +a. Properties file. Client loads all known to him properties (specified in the +"Input Parameters" section) from "reportportal.properties" file. -b. Environment variables. If environment variables with names specified in the - "Input Parameters" section exist client reload existing properties from - environment variables. +b. Environment variables. If environment variables with names specified in the +"Input Parameters" section exist client reload existing properties from +environment variables. -c. JVM variables. If JVM variables with names specified in the - "Input Parameters" section exist, client overrides existing ones from - JVM variables. +c. JVM variables. If JVM variables with names specified in the +"Input Parameters" section exist, client overrides existing ones from +JVM variables. ### Events @@ -190,13 +191,13 @@ c. JVM variables. If JVM variables with names specified in the * step - collects step to be sent to ReportPortal afterwards * Examples - generates data being sent to ReportPortal to report examples table * background - notifies ReportPortal that before-* hooks have been finished -* Match - notify ReportPortal that next step of current scenario is started +* Match - notify ReportPortal that next step of current scenario is started * Result - notify ReportPortal that step has finished and after-* hooks should be started (if any) -* After - notify ReportPortal that after-* hook has finished +* After - notify ReportPortal that after-* hook has finished * Embedding/Write - sends log to ReportPortal -* endOfScenarioLifeCycle - notifies ReportPortal that after-* hooks of scenario has been finished +* endOfScenarioLifeCycle - notifies ReportPortal that after-* hooks of scenario has been finished * eof - notifies ReportPortal that test feature execution is finished * done - IS NOT processed by ReportPortal agent * close - notifies ReportPortal that test execution is finished -* SyntaxError - IS NOT processed by ReportPortal agent +* SyntaxError - IS NOT processed by ReportPortal agent * ScenarioOutline - IS NOT processed by ReportPortal agent diff --git a/build.gradle b/build.gradle index 739f547..3e4a6cd 100644 --- a/build.gradle +++ b/build.gradle @@ -37,11 +37,12 @@ repositories { } dependencies { - api 'com.epam.reportportal:client-java:5.1.22' + api 'com.epam.reportportal:client-java:5.2.1' api 'com.epam.reportportal:commons-model:5.0.0' api 'com.google.code.findbugs:jsr305:3.0.2' api 'info.cukes:gherkin:2.12.2' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'org.slf4j:slf4j-api:2.0.7' implementation 'org.apache.commons:commons-text:1.10.0' @@ -53,8 +54,8 @@ dependencies { testImplementation 'org.hamcrest:hamcrest-core:2.2' testImplementation 'org.mockito:mockito-core:3.3.3' testImplementation 'org.mockito:mockito-junit-jupiter:3.3.3' - testImplementation 'ch.qos.logback:logback-classic:1.3.8' - testImplementation 'com.epam.reportportal:logger-java-logback:5.1.5' + testImplementation 'ch.qos.logback:logback-classic:1.3.12' + testImplementation 'com.epam.reportportal:logger-java-logback:5.2.0' testImplementation ("org.junit.platform:junit-platform-runner:${project.junit_runner_version}") { exclude module: 'junit' diff --git a/gradle.properties b/gradle.properties index da11f7e..9809c7b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=5.1.5-SNAPSHOT +version=5.2.0-SNAPSHOT description=EPAM Report portal. Cucumber JVM version [1.0.0; 2.0.0) adapter cucumber_version=1.2.6 junit_version=5.6.3 diff --git a/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java b/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java index 90a802f..d59eab8 100644 --- a/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java +++ b/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java @@ -25,6 +25,7 @@ import com.epam.reportportal.service.item.TestCaseIdEntry; import com.epam.reportportal.service.tree.TestItemTree; import com.epam.reportportal.utils.*; +import com.epam.reportportal.utils.files.ByteSource; import com.epam.reportportal.utils.properties.SystemAttributesExtractor; import com.epam.ta.reportportal.ws.model.FinishExecutionRQ; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; @@ -32,7 +33,6 @@ import com.epam.ta.reportportal.ws.model.StartTestItemRQ; import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ; import com.epam.ta.reportportal.ws.model.launch.StartLaunchRQ; -import com.google.common.io.ByteSource; import gherkin.formatter.Argument; import gherkin.formatter.Formatter; import gherkin.formatter.Reporter; @@ -128,6 +128,7 @@ public Launch get() { } }); + @Nonnull public static ReportPortal getReportPortal() { return REPORT_PORTAL; } @@ -169,7 +170,8 @@ private void addToTree(RunningContext.FeatureContext context) { * @param scenario Cucumber's Scenario object * @return scenario name */ - protected String buildScenarioName(Scenario scenario) { + @Nonnull + protected String buildScenarioName(@Nonnull Scenario scenario) { return Utils.buildName(scenario.getKeyword(), COLON_INFIX, scenario.getName()); } @@ -246,6 +248,7 @@ protected void beforeScenario(Scenario scenario, String outlineIteration) { // because it will be executed even if all Scenarios in the Feature are excluded. RunningContext.FeatureContext featureContext = currentFeatureContext.get(); Launch myLaunch = launch.get(); + //noinspection ReactiveStreamsUnusedPublisher if (null == featureContext.getId()) { featureContext.setId(startFeature(featureContext.getItemRq())); addToTree(featureContext); @@ -293,6 +296,7 @@ protected void finishTestItem(@Nullable Maybe itemId, @Nullable ItemStat LOGGER.error("BUG: Trying to finish unspecified test item."); return; } + //noinspection ReactiveStreamsUnusedPublisher launch.get().finishTestItem(itemId, buildFinishTestItemRequest(itemId, status)); } @@ -302,7 +306,7 @@ protected void finishTestItem(@Nullable Maybe itemId, @Nullable ItemStat protected void afterScenario() { RunningContext.ScenarioContext context = getCurrentScenarioContext(); finishTestItem(context.getId(), context.getStatus()); - currentScenarioContext.set(null); + currentScenarioContext.remove(); removeFromTree(currentFeatureContext.get(), context); } @@ -342,6 +346,7 @@ protected void beforeFeature(Feature feature) { */ protected void afterFeature() { RunningContext.FeatureContext currentFeature = currentFeatureContext.get(); + //noinspection ReactiveStreamsUnusedPublisher if (null != currentFeature && null != currentFeature.getId()) { finishTestItem(currentFeature.getId()); } @@ -923,7 +928,7 @@ protected Set getAttributes(Match match) { protected String buildMultilineArgument(Step step) { StringBuilder marg = new StringBuilder(); ofNullable(step.getRows()).map(rows -> rows.stream().map(Row::getCells).collect(Collectors.toList())) - .filter(t -> t.size() > 0) + .filter(t -> !t.isEmpty()) .ifPresent(t -> marg.append(formatDataTable(t))); ofNullable(step.getDocString()).map(DocString::getValue) .filter(ds -> !ds.isEmpty()) diff --git a/src/main/java/com/epam/reportportal/cucumber/StepReporter.java b/src/main/java/com/epam/reportportal/cucumber/StepReporter.java index fdc3528..9322898 100644 --- a/src/main/java/com/epam/reportportal/cucumber/StepReporter.java +++ b/src/main/java/com/epam/reportportal/cucumber/StepReporter.java @@ -36,8 +36,9 @@ * created in hooks will be attached to these, and not to the actual failing * steps!) * - * @author Sergey_Gvozdyukevich + * @deprecated Use {@link ScenarioReporter}, since the semantic of this class is completely broken and will be removed */ +@Deprecated public class StepReporter extends AbstractReporter { private static final String RP_STORY_TYPE = "STORY"; private static final String RP_TEST_TYPE = "SCENARIO"; diff --git a/src/main/java/com/epam/reportportal/cucumber/Utils.java b/src/main/java/com/epam/reportportal/cucumber/Utils.java index 9eeaf73..ed68d77 100644 --- a/src/main/java/com/epam/reportportal/cucumber/Utils.java +++ b/src/main/java/com/epam/reportportal/cucumber/Utils.java @@ -16,7 +16,6 @@ package com.epam.reportportal.cucumber; import com.epam.reportportal.listeners.ItemStatus; -import com.google.common.collect.ImmutableMap; import gherkin.formatter.Argument; import gherkin.formatter.model.Match; @@ -24,9 +23,7 @@ import javax.annotation.Nullable; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -42,21 +39,21 @@ public class Utils { public static final String TABLE_COLUMN_SEPARATOR = "|"; public static final String TABLE_ROW_SEPARATOR = "-"; - //@formatter:off - public static final Map STATUS_MAPPING = ImmutableMap.builder() - .put("passed", ItemStatus.PASSED) - .put("failed", ItemStatus.FAILED) - .put("skipped", ItemStatus.SKIPPED) - .put("pending", ItemStatus.SKIPPED) - .put("undefined", ItemStatus.SKIPPED).build(); + public static final Map STATUS_MAPPING = Collections.unmodifiableMap(new HashMap() {{ + put("passed", ItemStatus.PASSED); + put("failed", ItemStatus.FAILED); + put("skipped", ItemStatus.SKIPPED); + put("pending", ItemStatus.SKIPPED); + put("undefined", ItemStatus.SKIPPED); + }}); - public static final Map LOG_LEVEL_MAPPING = ImmutableMap.builder() - .put("passed", "INFO") - .put("failed", "ERROR") - .put("skipped", "WARN") - .put("pending", "WARN") - .put("undefined", "WARN").build(); - //@formatter:on + public static final Map LOG_LEVEL_MAPPING = Collections.unmodifiableMap(new HashMap() {{ + put("passed", "INFO"); + put("failed", "ERROR"); + put("skipped", "WARN"); + put("pending", "WARN"); + put("undefined", "WARN"); + }}); private Utils() { }