Skip to content

Commit

Permalink
Fixes according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
grey-rain committed Aug 30, 2024
1 parent 7e235c4 commit ae9a2b4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.invictum.reportportal;

import com.github.invictum.reportportal.injector.IntegrationInjector;
import com.github.invictum.reportportal.model.TestType;
import com.github.invictum.reportportal.recorder.TestRecorder;
import com.google.inject.Inject;
import net.thucydides.core.webdriver.ThucydidesWebDriverSupport;
Expand Down Expand Up @@ -130,8 +129,7 @@ public void stepFinished(List<ScreenshotAndHtmlSource> list, ZonedDateTime zoned

@Override
public void testFailed(TestOutcome testOutcome, Throwable throwable) {
TestType testType = TestType.byTestSource(testOutcome.getTestSource());
if (testType == TestType.BDD) {
if (testOutcome.getTestSource().toLowerCase().contains("cucumber")) {
testFinished(testOutcome);
}
}
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/com/github/invictum/reportportal/model/TestType.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.epam.ta.reportportal.ws.model.StartTestItemRQ;
import com.github.invictum.reportportal.*;
import com.github.invictum.reportportal.injector.IntegrationInjector;
import com.github.invictum.reportportal.model.TestType;
import com.google.inject.Injector;
import io.reactivex.Maybe;
import net.thucydides.model.domain.TestOutcome;
Expand Down Expand Up @@ -37,8 +36,7 @@ public TestRecorder(SuiteStorage suiteStorage, Launch launch, LogUnitsHolder hol
*/
public static TestRecorder forTest(TestOutcome testOutcome) {
Injector injector = IntegrationInjector.getInjector();
boolean isBdd = TestType.byTestSource(testOutcome.getTestSource()) == TestType.BDD;
if (testOutcome.isDataDriven() && isBdd) {
if (testOutcome.isDataDriven() && testOutcome.getTestSource().toLowerCase().matches("(cucumber|jbehave)")) {
return injector.getInstance(BddDataDriven.class);
}
return injector.getInstance(Regular.class);
Expand Down

0 comments on commit ae9a2b4

Please sign in to comment.