Skip to content

Commit

Permalink
Merge pull request #30 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Feb 23, 2022
2 parents 7f5d952 + 5f32786 commit 3bf1145
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ jobs:

steps:

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Get variables
run: |
echo "ARTIFACT=`echo ${{ github.repository }} | cut -d/ -f2- | awk '{print tolower($0)}'`" >> $GITHUB_ENV
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased]
### Changed
- Cucumber version updated on 7.2.3

## [5.1.0]
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies {
testImplementation 'org.mockito:mockito-core:3.3.3'
testImplementation 'org.mockito:mockito-junit-jupiter:3.3.3'
testImplementation 'ch.qos.logback:logback-classic:1.2.10'
testImplementation 'com.epam.reportportal:logger-java-logback:5.1.0'
testImplementation 'com.epam.reportportal:logger-java-logback:5.1.1'
testImplementation ("org.junit.platform:junit-platform-runner:${project.junit_runner_version}") {
exclude module: 'junit'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version=5.1.1-SNAPSHOT
description=EPAM Report portal. Cucumber JVM version [6.0.0; ) adapter
cucumber_version=7.2.0
cucumber_version=7.2.3
junit_version=5.6.3
junit_runner_version=1.6.3
scripts_url=https://raw.githubusercontent.com/reportportal/gradle-scripts
Expand Down
20 changes: 11 additions & 9 deletions src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ protected StartTestItemRQ buildStartScenarioRequest(@Nonnull TestCase testCase,
*/
@Nonnull
protected Maybe<String> startScenario(@Nonnull Maybe<String> featureId, @Nonnull StartTestItemRQ startScenarioRq) {
return launch.get().startTestItem(featureId, startScenarioRq);
return getLaunch().startTestItem(featureId, startScenarioRq);
}

@FunctionalInterface
Expand Down Expand Up @@ -394,7 +394,7 @@ protected StartTestItemRQ buildStartStepRequest(@Nonnull TestStep testStep, @Nul
*/
@Nonnull
protected Maybe<String> startStep(@Nonnull Maybe<String> scenarioId, @Nonnull StartTestItemRQ startStepRq) {
return launch.get().startTestItem(scenarioId, startStepRq);
return getLaunch().startTestItem(scenarioId, startStepRq);
}

private void addToTree(@Nonnull TestCase scenario, @Nullable String text, @Nullable Maybe<String> stepId) {
Expand All @@ -417,7 +417,7 @@ protected void beforeStep(@Nonnull TestCase testCase, @Nonnull TestStep testStep
Maybe<String> stepId = startStep(s.getId(), rq);
s.setStepId(stepId);
String stepText = step.getStep().getText();
if (launch.get().getParameters().isCallbackReportingEnabled()) {
if (getLaunch().getParameters().isCallbackReportingEnabled()) {
addToTree(testCase, stepText, stepId);
}
}
Expand Down Expand Up @@ -498,7 +498,7 @@ protected StartTestItemRQ buildStartHookRequest(@Nonnull TestCase testCase, @Non
*/
@Nonnull
protected Maybe<String> startHook(@Nonnull Maybe<String> parentId, @Nonnull StartTestItemRQ rq) {
return launch.get().startTestItem(parentId, rq);
return getLaunch().startTestItem(parentId, rq);
}

/**
Expand Down Expand Up @@ -660,7 +660,7 @@ protected StartTestItemRQ buildStartRuleRequest(@Nonnull Node.Rule rule, @Nullab
*/
@Nonnull
protected Maybe<String> startRule(@Nonnull Maybe<String> featureId, @Nonnull StartTestItemRQ ruleRq) {
return launch.get().startTestItem(featureId, ruleRq);
return getLaunch().startTestItem(featureId, ruleRq);
}

/**
Expand Down Expand Up @@ -693,7 +693,7 @@ protected void beforeScenario(@Nonnull Feature feature, @Nonnull TestCase scenar
// If it's a ScenarioOutline use Example's line number as code reference to detach one Test Item from another
int codeLine = s.getExample().map(e -> e.getLocation().getLine()).orElse(s.getLine());
s.setId(startScenario(rootId, buildStartScenarioRequest(scenario, scenarioName, s.getUri(), codeLine)));
if (launch.get().getParameters().isCallbackReportingEnabled()) {
if (getLaunch().getParameters().isCallbackReportingEnabled()) {
addToTree(feature, scenario, s.getId());
}
});
Expand Down Expand Up @@ -729,7 +729,7 @@ protected StartTestItemRQ buildStartFeatureRequest(@Nonnull Feature feature, @No
@Nonnull
protected Maybe<String> startFeature(@Nonnull StartTestItemRQ startFeatureRq) {
Optional<Maybe<String>> root = getRootItemId();
return root.map(r -> launch.get().startTestItem(r, startFeatureRq)).orElseGet(() -> launch.get().startTestItem(startFeatureRq));
return root.map(r -> getLaunch().startTestItem(r, startFeatureRq)).orElseGet(() -> getLaunch().startTestItem(startFeatureRq));
}

private void addToTree(Feature feature, Maybe<String> featureId) {
Expand All @@ -745,11 +745,12 @@ protected void handleStartOfTestCase(@Nonnull TestCaseStarted event) {
TestCase testCase = event.getTestCase();
URI uri = testCase.getUri();
execute(uri, f -> {
//noinspection ReactiveStreamsUnusedPublisher
if (f.getId().equals(Maybe.empty())) {
getRootItemId(); // trigger root item creation
StartTestItemRQ featureRq = buildStartFeatureRequest(f.getFeature(), uri);
f.setId(startFeature(featureRq));
if (launch.get().getParameters().isCallbackReportingEnabled()) {
if (getLaunch().getParameters().isCallbackReportingEnabled()) {
addToTree(f.getFeature(), f.getId());
}
}
Expand Down Expand Up @@ -905,7 +906,8 @@ protected Date finishTestItem(@Nullable Maybe<String> itemId, @Nullable ItemStat
return null;
}
FinishTestItemRQ rq = buildFinishTestItemRequest(itemId, dateTime, status);
launch.get().finishTestItem(itemId, rq);
//noinspection ReactiveStreamsUnusedPublisher
getLaunch().finishTestItem(itemId, rq);
return rq.getEndTime();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
/**
* @author <a href="mailto:[email protected]">Ihar Kahadouski</a>
*/
@SuppressWarnings("ReactiveStreamsUnusedPublisher")
public class ParameterScenarioReporterTest {

@CucumberOptions(features = "src/test/resources/features/OneSimpleAndOneScenarioOutline.feature", glue = {
Expand Down

0 comments on commit 3bf1145

Please sign in to comment.