java.lang.NullPointerException: No BaseStepListener has been registered
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:900)
at net.thucydides.core.steps.StepEventBus.getBaseStepListener(StepEventBus.java:138)
at net.serenitybdd.screenplay.EventBusInterface.aStepHasFailedInTheCurrentExample(EventBusInterface.java:61)
at net.serenitybdd.screenplay.Actor.anOutOfStepErrorOccurred(Actor.java:306)
at net.serenitybdd.screenplay.Actor.perform(Actor.java:216)
at net.serenitybdd.screenplay.Actor.attemptsTo(Actor.java:171)
at com.serenitycucumbertests.steps.SearchForUserSteps.has_opened_authorization_UI(SearchForUserSteps.java:33)
at ?.'authadmin' has opened authorization UI.(src/main/resources/features/portalui/search_for_a_user.feature:5)
I am trying to invoke serenityWithCucumber programmatically from java main method.
plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
repositories {
mavenLocal()
jcenter()
}
group = 'com.cerner.integration.test'
version = '1.0'
sourceCompatibility = '1.8'
/**
This is needed to make sure there are no Cucumber 2 dependencies in the classpath.
*/
configurations.all {
resolutionStrategy {
force "io.cucumber:cucumber-core:4.2.0"
}
}
I am getting below error
java.lang.NullPointerException: No BaseStepListener has been registered at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:900) at net.thucydides.core.steps.StepEventBus.getBaseStepListener(StepEventBus.java:138) at net.serenitybdd.screenplay.EventBusInterface.aStepHasFailedInTheCurrentExample(EventBusInterface.java:61) at net.serenitybdd.screenplay.Actor.anOutOfStepErrorOccurred(Actor.java:306) at net.serenitybdd.screenplay.Actor.perform(Actor.java:216) at net.serenitybdd.screenplay.Actor.attemptsTo(Actor.java:171) at com.serenitycucumbertests.steps.SearchForUserSteps.has_opened_authorization_UI(SearchForUserSteps.java:33) at ?.'authadmin' has opened authorization UI.(src/main/resources/features/portalui/search_for_a_user.feature:5)
I am trying to invoke serenityWithCucumber programmatically from java main method.
This is the logic in my main method
String[] defaultOptions = { "--glue", "com.serenitycucumbertests", "--plugin", "pretty", "--plugin", "junit:target/cucumber-reports/Cucumber.xml", "--plugin", "html:target/cucumber-reports/html/", "--plugin", "pretty:target/cucumber-pretty.txt", "src/main/resources/features/" }; try { System.setProperty("webdriver.driver","chrome"); System.setProperty("webdriver.chrome.driver","src/main/resources/chromedriver.exe"); System.setProperty("use.driver.service.pool","false");
This is my gradle file
plugins { id 'org.springframework.boot' version '2.1.3.RELEASE' id 'io.spring.dependency-management' version '1.0.9.RELEASE' id 'java' }
repositories { mavenLocal() jcenter() }
group = 'com.cerner.integration.test' version = '1.0' sourceCompatibility = '1.8'
/**
dependencies { implementation 'org.springframework.boot:spring-boot-starter' implementation 'org.springframework:spring-web:5.1.5.RELEASE'
}
Could anyone help, how to execute tests from an executable jar and resolve this error.