Writing a scenario for the about page
A scenario is basically a possible situation where features can act upon. This means that each feature can have many scenarios. Consider the about page that we created in Chapter 2, The Request and Response Life Cycle. When you visit /about
, you see a general about page. When you visit /about/{name}
, there are two possible scenarios: if {name}
exists, you see their about page and if it doesn't, you see an error page. So we have three possible scenarios for the /about
page. Let's add them to our feature and see how it looks:
Feature: about page In order to see about page contents As a user I am able to visit about page Scenario: Visiting about page Given I am on "/about" Then I should see "mava is a web app" Scenario: Visiting about page for an existing user Given I am on "/about/john" Then I should see "He is a cool guy" Scenario: Visiting about page for non existing user Given...