Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Then: Then specifies the expected outcome of the test 


  • Parameters can be passed in each step definition within double quotes(“”)
  • Tags can be provided for different scenarios, features or backgrounds. The tags would help in determining the specific scripts that would be executed.
  • Once the feature file is written, we need to create a test class which would run the feature file definitions. It would look similar as below:

@RunWith(Cucumber.class)

@Cucumber.Options(features="/Users/nalipanah/Documents/Repository/Git/cucumber-selenium/src/test/resources/Features/google.feature")

public class RunCucumberLoginFeature {

 

}


  • We need to add the path of the feature file in the cucmber options and then execute the test file
  • Since we have not yet prepared test script for each definition. On execution, methods would be created using the step definition phrase and would appear in the console, suggesting that we need to implement these methods in order for the test scripts to be executed successfully. Note that the test methods would be having an underscore format.