private void updateExampleTableIfNecessary(TestResult result) { if (getCurrentTestOutcome().isDataDriven()) { getCurrentTestOutcome().updateCurrentRowResult(result); } }
private Optional<TestStep> getPreviousStep() { if (getCurrentTestOutcome().getTestSteps().size() > 1) { List<TestStep> currentTestSteps = getCurrentTestOutcome().getTestSteps(); return Optional.of(currentTestSteps.get(currentTestSteps.size() - 2)); } else { return Optional.absent(); } }
private Optional<TestStep> getPreviousStep() { if (getCurrentTestOutcome().getTestSteps().size() > 1) { List<TestStep> currentTestSteps = getCurrentTestOutcome().getTestSteps(); return Optional.of(currentTestSteps.get(currentTestSteps.size() - 2)); } else { return Optional.absent(); } }
private void testAndTopLevelStepsShouldBeIgnored() { getCurrentTestOutcome().setResult(IGNORED); if (getCurrentTestOutcome().isDataDriven()) { getCurrentTestOutcome().updateTopLevelStepResultsTo(IGNORED); } }
private void recordTestDuration() { if (!testOutcomes.isEmpty()) { getCurrentTestOutcome().recordDuration(); } }
private java.util.Optional<ScreenshotAndHtmlSource> previousScreenshot() { List<ScreenshotAndHtmlSource> screenshotsToDate = getCurrentTestOutcome().getScreenshotAndHtmlSources(); if (screenshotsToDate.isEmpty()) { return java.util.Optional.empty(); } else { return java.util.Optional.of(screenshotsToDate.get(screenshotsToDate.size() - 1)); } }
private Optional<ScreenshotAndHtmlSource> previousScreenshot() { List<ScreenshotAndHtmlSource> screenshotsToDate = getCurrentTestOutcome().getScreenshotAndHtmlSources(); if (screenshotsToDate.isEmpty()) { return Optional.absent(); } else { return Optional.of(screenshotsToDate.get(screenshotsToDate.size() - 1)); } }
private Optional<ScreenshotAndHtmlSource> previousScreenshot() { List<ScreenshotAndHtmlSource> screenshotsToDate = getCurrentTestOutcome().getScreenshotAndHtmlSources(); if (screenshotsToDate.isEmpty()) { return Optional.absent(); } else { return Optional.of(screenshotsToDate.get(screenshotsToDate.size() - 1)); } }
/** * The current scenario is a data-driven scenario using test data from the specified table. */ public void useExamplesFrom(DataTable table) { getCurrentTestOutcome().useExamplesFrom(table); currentExample = 0; lastFailingExample = 0; }
public boolean aStepHasFailed() { return ((!getTestOutcomes().isEmpty()) && (getCurrentTestOutcome().getResult() == TestResult.FAILURE || getCurrentTestOutcome().getResult() == TestResult.ERROR || getCurrentTestOutcome().getResult() == TestResult.COMPROMISED)); }
public void exampleFinished() { currentStepDone(null); getCurrentTestOutcome().moveToNextRow(); } }
@Override public void testIsManual() { if (!testOutcomeRecorded()) { return; } getCurrentTestOutcome().asManualTest(); getCurrentTestOutcome().setAnnotatedResult(defaulManualTestReportResult()); }
public void lastStepFailed(StepFailure failure) { takeEndOfStepScreenshotFor(FAILURE); getCurrentTestOutcome().lastStepFailedWith(failure); lastFailingExample = currentExample; }
private void markCurrentStepAs(final TestResult result) { getCurrentTestOutcome().currentStep().ifPresent( step -> { step.setResult(result); updateExampleTableIfNecessary(result); } ); }
public void exampleStarted(Map<String, String> data) { if (getCurrentTestOutcome().isDataDriven() && !getCurrentTestOutcome().dataIsPredefined()) { getCurrentTestOutcome().addRow(data); } currentExample++; getEventBus().stepStarted(ExecutedStepDescription.withTitle(exampleTitle(currentExample, data))); }
private void updateSessionIdIfKnown() { SessionId sessionId = webdriverManager.getSessionId(); if (sessionId != null) { getCurrentTestOutcome().setSessionId(sessionId.toString()); } }
private void updateSessionIdIfKnown() { SessionId sessionId = webdriverManager.getSessionId(); if (sessionId != null) { getCurrentTestOutcome().setSessionId(sessionId.toString()); } }
private void setAnnotatedResult(String testMethod) { if (TestAnnotations.forClass(testSuite).isIgnored(testMethod)) { getCurrentTestOutcome().setAnnotatedResult(IGNORED); } if (TestAnnotations.forClass(testSuite).isPending(testMethod)) { getCurrentTestOutcome().setAnnotatedResult(PENDING); } }
public void testFinished() { screenshotProcessor.waitUntilDone(); TestOutcome outcome = getBaseStepListener().getCurrentTestOutcome(); for (StepListener stepListener : getAllListeners()) { stepListener.testFinished(outcome); } clear(); }
public void stepFailed(StepFailure failure) { takeEndOfStepScreenshotFor(FAILURE); TestFailureCause failureCause = TestFailureCause.from(failure.getException()); getCurrentTestOutcome().appendTestFailure(failureCause); recordFailureDetails(failure); currentStepDone(failureAnalysis.resultFor(failure)); }