Open baligit opened 4 years ago
How are you using the Stepdefcalulator class?
I am unsing Stepdefcalulator on my following Testrunner:
@RunWith(CucumberWithSerenity.class) @CucumberOptions(features = "src/test/resources/feature")
public class MyTestRunner { @Managed(driver = "appium") public WebDriver driver;
@Steps
Stepdefcalulator testerTow;
@Test
public void second_test(){
testerTow.i_am_on_the_calculator_app();
testerTow.i_click_one();
testerTow.i_click_equals();
testerTow.i_click_one();
testerTow.the_result_should_be(2);
}
@Steps is for step library classes, not for page objects - you don't need an annotation for page objects. It looks like you are mixing step definition methods, glue code and page object logic in one class. Have a look at the docs (https://serenity-bdd.github.io/theserenitybook/latest/index.html) to see how Serenity code is intended to be layered.
Hallo all,
i am trying to build my Test on Serernity with Appium using cucumbar. I am trying to do a simple test Calculator. Unfortunately my program failed with the follwing error: Failed to instantiate class implementSenario.Stepdefcalulator - this class doesn't have an empty or a page enabled constructor"
This is my Stepdefcalulator class: package implementSenario;
public class Stepdefcalulator extends MobilePageObject {
}
And this is my MobilePageObject class:
public class MobilePageObject extends PageObject {
}
and this is my gradle file:
defaultTasks 'clean','test','aggregate'
repositories { mavenLocal() jcenter() }
buildscript { repositories { mavenLocal() jcenter() } dependencies { classpath("net.serenity-bdd:serenity-gradle-plugin:2.0.91") } }
apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'net.serenity-bdd.aggregator'
sourceCompatibility = 1.8 targetCompatibility = 1.8 ext { slf4jVersion = '1.7.7' serenityCoreVersion = '2.0.17' junitVersion = '4.12' assertJVersion = '3.8.0' logbackVersion = '1.2.3' CucumbarVersion = '1.9.20' }
dependencies { compile "ch.qos.logback:logback-classic:${logbackVersion}" testCompile "net.serenity-bdd:serenity-core:${serenityCoreVersion}", "net.serenity-bdd:serenity-junit:${serenityCoreVersion}", "junit:junit:${junitVersion}", "org.assertj:assertj-core:${assertJVersion}", "net.serenity-bdd:serenity-cucumber:${CucumbarVersion}" compile group: 'io.appium', name: 'java-client', version: '4.1.2' }
test { testLogging.showStandardStreams = true systemProperties System.getProperties() }
gradle.startParameter.continueOnFailure = true
test.finalizedBy(aggregate)