Open bl101 opened 6 years ago
What do your tests look like?
Tests have the following structure: -features -shopping -stepDefinitions ShoppingTestRunner.kt orderproduct.feature
Test runner look like this:
package features.shopping
import cucumber.api.CucumberOptions
import net.serenitybdd.cucumber.CucumberWithSerenity
import net.thucydides.core.annotations.Managed
import org.junit.runner.RunWith
import org.openqa.selenium.WebDriver
@RunWith(CucumberWithSerenity::class)
@CucumberOptions(
features = ["src/test/kotlin/features/shopping"],
glue = ["features"])
class ShoppingTestRunner {
@Managed
lateinit var driver: WebDriver
}
Then standard BDDTests:
Scenario: A user selects a product and adds it to their basket Given I am on a product page And there are a range of products within the store When I click the 'Add to cart' button Then I see the item within my basket
and example within StepDefinitions:
import cucumber.api.java.en.Given
import cucumber.api.java.en.Then
import cucumber.api.java.en.When
import features.shopping.steps.ShoppingSteps
import features.sharedSteps.NavigationSteps
import mocking.MockingClient
import mocking.defaults.MockDefaults
import net.serenitybdd.core.Serenity
import net.thucydides.core.annotations.Steps
import org.apache.http.HttpStatus.*
import org.junit.Assert.*
import javax.servlet.http.Cookie
class ShoppingStepDefinitions {
@Steps
lateinit var navigation: NavigationSteps
@Steps
lateinit var shopping: ShoppingSteps
val mockingClient = MockingClient.instance
val customer = MockDefaults.customer
@Given("^There are a range of products within the store$")
fun thereAreARangeOfProductsWithinTheStore() {
shopping.generateStubsForShop()
}
Do any of the features or scenarios have identical names?
No. They are all unique.
Could you provide a sample project?
I'll need to confirm tomorrow. Is there anything I could look at that would cause this issue? They had been working for a time. Just seems strange it outputs such a minimal number of tests to report. The number of tests has gradually been getting bigger, could it be to do with the number of tests?
No, it is more likely the process crashing because a feature is not being processed correctly for some reason. Serenity test suites routinely have thousands of tests.
Currently I have a project running with serenity-cucumber. The following is the setup for gradle:
`buildscript { ext.kotlin_version = '1.2.40' ext.serenity_version = '1.9.6'
After running the tests I would have a gradle report showing 200+ tests but within the serenity report it would output a very small number of tests e.g 5 tests > 4 tests. I would also noticed each test would have a large number of steps but this isn't the case in the actual test. Here is an example image of the report:
Is this a known issue or an issue within my setup?