Decoding the step class

Let try to understand the step class code we just wrote. If you look closely, you will observe the following:

  • You will find one step method each for every step that we wrote in our test scenario.

  • Every step method is annotated with a english like statement. That should match your step statement. This is how cucumber understands which method to execute while runnign a test scenario.

  • Also the annotations would have some regular expressions. These are used to pass parameters in the step statement.

  • Steps in the scenario are passing data to the step method in the step statements and the step methods accepts them using regex expressions.

Screen

results matching ""

    No results matching ""