Posts

Showing posts with the label Serenity

Serenity Maven Cucumber - Only run specific scenarios

Image
Problem: While using the serenity cucumber framework with maven run only specific scenarios or feature files Solution:  To run only individual feature, run a specific tag say @wip Work In Progress tag @wip mvn verify -Dcucumber.options="--tags @wip" mvn  verify  -Dcucumber.options="--tags @wip @debug2" More -DCucumber.options here:  http://cucumber.github.io/api/cucumber/jvm/javadoc/cucumber/api/CucumberOptions.html#tags-- You can also do this by creating test runner class for each .feature file: @RunWith (CucumberWithSerenity. class ) @CucumberOptions ( features = "src/test/resources/features/search/search_by_keyword.feature" ) public class SearchByKeyword { } Triggering this as any other test class, would execute only the  SearchByKeyword .feature.

parent = 'null' cardNumber = 'null' while running serenity using Maven

Image
Technology Stack: Serenity + Cucumber + Jnit Problem: If you have been using Serenity and have seen that your reports don't show up the capabilities/epics that have been run. If you dig further you would notice that in your logs there is a statement where the epics/capability isn't able to find its parent, cardNumber Solution:  What would not work: Updating pom file Using latest jars  What works: Path to the requirements directory like this: serenity.requirements.dir = src/test/resources/features

Complete list of Serenity properties

Image
The Serenity Reference Manual: http://thucydides.info/docs/serenity-staging/ Serenity properties Absolute path of the property file where Serenity system property defaults are defined. Defaults to ~/serenity.properties webdriver.driver What browser do you want your tests to run in, for example firefox, chrome, phantomjs or iexplorer. You can also use the  driver  property as a shortcut. webdriver.provided_type If using a provided driver, what type is it. The implementation class needs to be defined in the webdriver.provided.{type} system property. webdriver.base.url The default starting URL for the application, and base URL for relative paths. webdriver.remote.url The URL to be used for remote drivers (including a selenium grid hub or SauceLabs URL) phantomjs.webdriver.port What port to run PhantomJS on (used in conjunction with webdriver.remote.url to register with a Selenium hub, e.g. -Dphantomjs.webdriver=5555 -Dwebdriver.remote.url=http://loca...