Skip to content

Commit

Permalink
fix for skipped event
Browse files Browse the repository at this point in the history
  • Loading branch information
anshooarora committed Nov 22, 2018
1 parent 05c231f commit c1aa9f5
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.GherkinKeyword;
import com.aventstack.extentreports.MediaEntityBuilder;
import com.aventstack.extentreports.Status;
import com.aventstack.extentreports.markuputils.MarkupHelper;
import com.aventstack.extentreports.service.ExtentService;

Expand Down Expand Up @@ -389,17 +390,20 @@ private synchronized void updateResult(Result result) {
break;
case "skipped":
case "pending":
Boolean currentEndingEventSkipped = stepTestThreadLocal.get().getModel().getLogContext() != null
&& !stepTestThreadLocal.get().getModel().getLogContext().isEmpty()
? stepTestThreadLocal.get().getModel().getLogContext().getLast().getStatus() == Status.SKIP
: false;
if (result.getError() != null) {
stepTestThreadLocal.get().skip(result.getError());
}
else {
} else if (!currentEndingEventSkipped) {
String details = result.getErrorMessage() == null ? "Step skipped" : result.getErrorMessage();
stepTestThreadLocal.get().skip(details);
}
break;
case "passed":
if (stepTestThreadLocal.get()!= null && stepTestThreadLocal.get().getModel().getLogContext().isEmpty())
stepTestThreadLocal.get().pass("Step passed");
stepTestThreadLocal.get().pass("");
break;
default:
break;
Expand Down

0 comments on commit c1aa9f5

Please sign in to comment.