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" ...
Get Mastering Symfony now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.