public class BaseStepListener extends Object implements StepListener, StepPublisher
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BaseStepListener.ScreenshotType |
class |
BaseStepListener.StepMerger |
class |
BaseStepListener.StepMutator |
| Constructor and Description |
|---|
BaseStepListener(Class<? extends org.openqa.selenium.WebDriver> driverClass,
File outputDirectory)
Create a step listener with a given web driver type.
|
BaseStepListener(Class<? extends org.openqa.selenium.WebDriver> driverClass,
File outputDirectory,
Configuration configuration) |
BaseStepListener(File outputDirectory) |
BaseStepListener(File outputDirectory,
com.google.inject.Injector injector) |
public BaseStepListener(File outputDirectory)
public BaseStepListener(File outputDirectory, com.google.inject.Injector injector)
public BaseStepListener(Class<? extends org.openqa.selenium.WebDriver> driverClass, File outputDirectory)
driverClass - a driver of this type will be usedoutputDirectory - reports and screenshots are generated herepublic BaseStepListener(Class<? extends org.openqa.selenium.WebDriver> driverClass, File outputDirectory, Configuration configuration)
public void setEventBus(StepEventBus eventBus)
public StepEventBus getEventBus()
public File getOutputDirectory()
public Optional<TestResult> getAnnotatedResult()
public void setAllStepsTo(TestResult result)
public void overrideResultTo(TestResult result)
public void recordManualTestResult(TestResult result, Optional<String> lastTestedVersion, Boolean isUpToDate, Optional<String> testEvidence)
public void recordManualTestResult(TestResult result)
public boolean currentTestFailed()
public BaseStepListener.StepMerger mergeLast(int maxStepsToMerge)
public int getStepCount()
public int getRunningStepCount()
public void updateOverallResults()
public Photographer getPhotographer()
public void cancelPreviousTest()
public void lastTestPassedAfterRetries(int attemptNum,
List<String> failureMessages,
TestFailureCause testfailureCause)
public void currentStepIsAPrecondition()
public void updateExampleLineNumber(int lineNumber)
public int currentStepDepth()
public boolean previousScenarioWasASingleBrowserScenario()
public boolean currentStoryHasTag(TestTag tag)
public BaseStepListener childListenerFor(StepEventBus eventBus)
public BaseStepListener spawn(String outcomeName)
outcomeName - protected ScreenshotPermission screenshots()
protected WebdriverProxyFactory getProxyFactory()
public TestOutcome getCurrentTestOutcome()
public boolean isAvailable()
public Optional<TestOutcome> latestTestOutcome()
protected SystemClock getClock()
public void testSuiteStarted(Class<?> startedTestSuite)
testSuiteStarted in interface StepListenerstartedTestSuite - the class implementing the test suite (e.g. a JUnit test case)public void testSuiteStarted(Story story)
testSuiteStarted in interface StepListenerpublic boolean testSuiteRunning()
public void testSuiteFinished()
testSuiteFinished in interface StepListenerpublic void testStarted(String testMethod)
testStarted in interface StepListenertestMethod - the name of the test method in the test suite class.public void testStarted(String testMethod, String id)
testStarted in interface StepListenerpublic void testStarted(String testMethod, String id, ZonedDateTime startTime)
testStarted in interface StepListenerpublic BaseStepListener.StepMutator updateCurrentStepTitle(String updatedStepTitle)
public void updateCurrentStepFailureCause(Throwable failure)
public void testFinished(TestOutcome outcome)
testFinished in interface StepListenerpublic void testFinished(TestOutcome result, boolean isInDataDrivenTest)
testFinished in interface StepListenerpublic void testFinished(TestOutcome outcome, boolean isInDataDrivenTest, ZonedDateTime finishTime)
testFinished in interface StepListenerpublic void testRetried()
testRetried in interface StepListenerpublic void stepStarted(ExecutedStepDescription description)
stepStarted in interface StepListenerdescription - the description of the test that is about to be runpublic void skippedStepStarted(ExecutedStepDescription description)
skippedStepStarted in interface StepListenerpublic void stepFinished()
stepFinished in interface StepListenerpublic void stepFinished(List<ScreenshotAndHtmlSource> screenshotList)
stepFinished in interface StepListenerpublic void finishGroup()
public void stepFailed(StepFailure failure)
stepFailed in interface StepListenerpublic void stepFailedWithException(Throwable failure)
public void lastStepFailed(StepFailure failure)
lastStepFailed in interface StepListenerpublic void stepIgnored()
stepIgnored in interface StepListenerpublic void stepPending()
stepPending in interface StepListenerpublic void stepPending(String message)
stepPending in interface StepListenerpublic void assumptionViolated(String message)
assumptionViolated in interface StepListenerpublic void testRunFinished()
testRunFinished in interface StepListenerpublic void takeScreenshots(List<ScreenshotAndHtmlSource> screenshots)
takeScreenshots in interface StepListenerpublic void currentStepDone(TestResult result)
public int getCurrentLevel()
public Optional<TestResult> getForcedResult()
public void clearForcedResult()
public List<TestOutcome> getTestOutcomes()
StepPublishergetTestOutcomes in interface StepPublisherpublic void setDriver(org.openqa.selenium.WebDriver driver)
StepPublishersetDriver in interface StepPublisherpublic org.openqa.selenium.WebDriver getDriver()
StepPublishergetDriver in interface StepPublisherpublic boolean aStepHasFailed()
StepPublisheraStepHasFailed in interface StepPublisherpublic Optional<TestStep> firstFailingStep()
firstFailingStep in interface StepPublisherpublic boolean aStepHasFailedInTheCurrentExample()
public FailureCause getTestFailureCause()
StepPublishergetTestFailureCause in interface StepPublisherpublic void testFailed(TestOutcome testOutcome, Throwable cause)
testFailed in interface StepListenerpublic void testIgnored()
testIgnored in interface StepListenerpublic void testSkipped()
testSkipped in interface StepListenerpublic void testAborted()
testAborted in interface StepListenerpublic void testPending()
testPending in interface StepListenerpublic void testIsManual()
testIsManual in interface StepListenerpublic void notifyScreenChange()
notifyScreenChange in interface StepListenerpublic void notifyUIError()
public void takeScreenshot()
public void useExamplesFrom(DataTable table)
useExamplesFrom in interface StepListenerpublic void addNewExamplesFrom(DataTable table)
addNewExamplesFrom in interface StepListenerpublic void exampleStarted(Map<String,String> data)
exampleStarted in interface StepListenerpublic void exampleStarted(Map<String,String> data, String exampleName)
exampleStarted in interface StepListenerpublic void exampleFinished()
exampleFinished in interface StepListenerpublic void recordRestQuery(RestQuery restQuery)
public void clearTestOutcomes()
Copyright © 2023. All rights reserved.