Skip to content

Commit 5f75c69

Browse files
committed
#187: Add support for Scenario outlines custom name strategies
- added readme
1 parent ac8cd55 commit 5f75c69

File tree

1 file changed

+49
-27
lines changed

1 file changed

+49
-27
lines changed

README.md

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Table of Contents
3232
2. [Log units](#log-units)
3333
3. [Merge launches](#merge-launches)
3434
4. [Test retries](#test-retries)
35-
5. [Other settings](#other-settings)
35+
5. [BDD Scenario test name customization](#bdd-scenario-test-name-customization)
36+
6. [Other settings](#other-settings)
3637
3. [Data mapping](#data-mapping)
3738
4. [Versioning](#versioning)
3839
5. [Important release notes](#important-release-notes)
@@ -160,14 +161,14 @@ configuration.usePreset(LogsPreset.FULL);
160161

161162
> **Notice**
162163
>
163-
> All integration configurations should be done before the start of Serenity facility. Otherwise default values will be
164-
> used.
164+
> All integration configurations should be completed before starting the Serenity engine; otherwise, default values will
165+
> be used.
165166
166167
#### Presets
167168

168169
Each Serenity `TestStep` object is passed through chain of configured log units. Each particular log unit analyses step
169-
and creates a collection of records that will be send to RP. This approach allows to flexible configure reporting
170-
behaviour on a step level. By default integration provides a few log presets:
170+
and creates a collection of records that will be sent to RP. This approach allows to flexible configure reporting
171+
behaviour on a step level. By default, integration provides a few log presets:
171172

172173
- DEFAULT
173174
- FULL
@@ -272,7 +273,7 @@ timestamp.
272273

273274
#### Merge launches
274275

275-
By default separate launch will be created in RP for each module in case of multi-module project. This behavior can be
276+
By default, separate launch will be created in RP for each module in case of multi-module project. This behavior can be
276277
changed with merge launches feature.
277278

278279
To understand a concept, let's assume following multi-module structure
@@ -331,14 +332,35 @@ and add `failsafe.rerunFailingTestsCount` or `surefire.rerunFailingTestsCount` p
331332
> more
332333
> details.
333334
335+
#### BDD Scenario test name customization
336+
337+
n some cases, you may need to customize the test name for BDD Scenario Outlines (for example, to insert parameters into
338+
the test name in ReportPortal). To achieve this, you need to implement the desired customization logic in a class that
339+
implements the `TestNameTransformer` interface. This class should then be specified in the `ReportIntegrationConfig`.
340+
341+
```
342+
ReportIntegrationConfig.get().useTestNameTransformer(new MyTransformer());
343+
```
344+
345+
```
346+
public class MyTransformer implements TestNameTransformer {
347+
348+
@Override
349+
public String transformName(TestOutcome testOutcome, int scenarioIndex) {
350+
<...
351+
//transformation logic
352+
...>
353+
}
354+
```
355+
334356
#### Other settings
335357

336358
Section includes minor settings that available to configure and describes their usage.
337359

338-
Setting | Usage | Description
339-
--------------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
340-
Selenium logs harvesting | `ReportIntegrationConfig.get().harvestSeleniumLogs(true)` | Special option that works in conjunction with `Selenium.filteredLogs(...)` unit and must be enabled as well in order it to works. By default it is disabled.
341-
Truncate names | `ReportIntegrationConfig.get().truncateNames(true)` | Allows to hide RP server errors that related to entities with long names (more that 1024 symbols) creation. It is not recommended to use it. By default it is disabled.
360+
| Setting | Usage | Description |
361+
|--------------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
362+
| Selenium logs harvesting | `ReportIntegrationConfig.get().harvestSeleniumLogs(true)` | Special option that works in conjunction with `Selenium.filteredLogs(...)` unit and must be enabled as well in order it to works. By default it is disabled. |
363+
| Truncate names | `ReportIntegrationConfig.get().truncateNames(true)` | Allows to hide RP server errors that related to entities with long names (more that 1024 symbols) creation. It is not recommended to use it. By default it is disabled. |
342364

343365
## Data mapping
344366

@@ -347,12 +369,12 @@ relates to each other.
347369

348370
**Name** relation is straightforward.
349371

350-
Serenity | Report portal
351-
-------------|---------------
352-
Test Class | Suite
353-
Test Method | Test
354-
Scenario | Test
355-
Step | Log entry
372+
| Serenity | Report portal |
373+
|-------------|---------------|
374+
| Test Class | Suite |
375+
| Test Method | Test |
376+
| Scenario | Test |
377+
| Step | Log entry |
356378

357379
**Description** Each non-log entity in Report Portal may has a description. This field is populated from Serenity
358380
narrative section for both jUnit and BDD test sources.
@@ -446,24 +468,24 @@ Important release notes are described below.
446468
Use [releases](https://github.com/Invictum/serenity-reportportal-integration/releases) section for details regarding
447469
regular release notes.
448470

449-
Version | Note
450-
---------------|-----------------------------------------------------------------------------------------------------------------
451-
1.0.0 - 1.0.6 | Supports RP v3 and below
452-
1.1.0 - 1.1.3 | Minor version update due RP v4 release. Versions older than 1.1.0 are not compatible with RP v4+ and vise versa
453-
1.2.0 - 1.2.1 | Minor version updated due internal mechanisms approach major refactoring
454-
1.3.0 | Minor version updated due to log units approach rework
455-
1.4.0 - 1.4.3 | Minor version update: removed tree handler, refactored to support DDT for BDD
456-
1.5.0+ | Minor version update due RP v5 release
457-
1.6.0+ | Minor version update due Serenity 4 release. Report Portal is updated to 5.8 as well
471+
| Version | Note |
472+
|---------------|-------------------------------------------------------------------------------------------------------------------------|
473+
| 1.0.0 - 1.0.6 | Supports RP v3 and below |
474+
| 1.1.0 - 1.1.3 | Minor version update due RP v4 release. Versions older than 1.1.0 are not compatible with RP v4+ and vise versa |
475+
| 1.2.0 - 1.2.1 | Minor version updated due internal mechanisms approach major refactoring |
476+
| 1.3.0 | Minor version updated due to log units approach rework |
477+
| 1.4.0 - 1.4.3 | Minor version update: removed tree handler, refactored to support DDT for BDD |
478+
| 1.5.0+ | Minor version update due RP v5 release |
479+
| 1.6.0+ | Minor version update due Serenity 4 release. Report Portal is updated to 5.8 as well. Bugfixes and some of new features |
458480

459481
## Limitations
460482

461483
Integration has limited concurrency support.
462484
For versions < 4 concurrency for parametrized Serenity tests execution is not supported.
463485
For version >=4 concurrency is supported on feature level.
464486

465-
The following line should be provided into `junit-platform.properties` file of your project for versions 1.6.0+ in order for integration to
466-
work correctly:
487+
The following line should be provided into `junit-platform.properties` file of your project for versions 1.6.0+ in order
488+
for integration to work correctly:
467489

468490
**JUnit**
469491

0 commit comments

Comments
 (0)