Skip to content

Commit

Permalink
Merge pull request #41 from Invictum/38_turn_narrative_into_function
Browse files Browse the repository at this point in the history
#38: Fixed README.md
  • Loading branch information
Invictum authored Jul 25, 2018
2 parents 545a9b4 + 99e1cff commit a723035
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Table of Contents
3. [Native Serenity reporting](#native-serenity-reporting)
2. [Integration configuration](#integration-configuration)
1. [Profiles](#profiles)
2. [Executors](#executors)
2. [Extractors](#extractors)
3. [Handler type (experimental feature)](#handler-type-experimental-feature)
4. [Narrative formatter](#narrative-formatter)
3. [Data mapping](#data-mapping)
Expand Down Expand Up @@ -105,7 +105,7 @@ All integration configurations should be provided before Serenity facility init

#### Profiles

Each Serenity `TestStep` object is passed through chain of configured `StepDataExtractors`. This approach allows to flexible configure reporting behaviour on a step level. By default integration provides following configuration profiles:
Each Serenity `TestStep` object is passed through chain of configured `StepDataExtractors`. This approach allows to flexible configure reporting behaviour on a step level. By default integration provides a few preconfigured extractors profiles:

- DEFAULT
- FULL
Expand All @@ -125,10 +125,10 @@ profile.registerProcessors(new StartStep(), new FinishStep());
ReportIntegrationConfig.get().useProfile(profile);
```

#### Executors
#### Extractors

All step executors are available out of the box may be observed in `com.github.invictum.reportportal.extractor` package.
For now following processors are available:
All step extractors are available out of the box may be observed in `com.github.invictum.reportportal.extractor` package.
For now following extractors are available:
- `StartStep` retrieves step's data relevant to its start.
- `FinishStep` extracts step's data related to its finish. Log level depends on step result.
- `StepError` extracts step's error if present. Includes regular errors as well as assertion fails. By default full stack trace will be reported. But it is possible to pass a function to the constructor in order to implement any logic for message formatting.
Expand All @@ -151,7 +151,7 @@ profile.registerProcessors(logs);
```

It is possible to use integrated extractors as well as implemented by your own. To make own extractor implement `StepDataExtractor` interface. In custom implementation access to Serenity's `TestStep` object is provided.
For example let's implement extractor that generates a log message before each step start (yeap it is pretty useful)
For example, let's implement extractor that generates greetings message for each started step
```
public class GreetingExtractor implements StepDataExtractor {
Expand All @@ -162,7 +162,7 @@ public class GreetingExtractor implements StepDataExtractor {
EnhancedMessage message = new EnhancedMessage("Hello from started step " + step.getDescription());
// Do not forget to set propper log level and timestamp
message.withDate(startDate).withLevel(Utils.logLevel(step.getResult());
// Extractor may produce several logs for emit, but this example supplyies only one
// Extractor may produce several logs for future push to RP, but this example supplyies only one
return Collections.singleton(message);
}
}
Expand Down

0 comments on commit a723035

Please sign in to comment.