Library/Technical Support/Janova Tutorials: Getting Started

05 - Creating a Scenario

Tami Judge
posted this on March 01, 2011 13:53

Creating a Scenario

A Scenario exists to test a specific requirement within a larger Feature. While there are many ways in which to break tests down along lines of Features and Scenarios, the simplest and most straightforward way is to name Scenarios after the requirements they are intended to test. In this case, we will test the requirement that “The home page of the Janova site should have a How Janova Works link.”

 

9.png                 

Looking at the Janova home page, to fulfill this requirement we will need to 1) go to the home page, and 2) see if the link exists.  If you are continuing this tutorial from the previous one, you will be on the Features page at the moment.  If you are not there, navigate to it by clicking on Features on the top menu.  If continuing from the previous tutorial, you should automatically be on the How Janova Works Feature, and already prompted to create a Scenario. If not, you can proceed by clicking on Add a Scenario at the bottom of the screen.

 

 8.png

1. Enter “The home page of the Janova site should have a How Janova Works link.” in the Scenario Name box.

2. Click Save and Continue.

3. You should automatically be prompted to create the first Step

 

 10.png

 

4. Select “go to a page” from the syntax menu.

 

Note: Full explanations of each action in this syntax menu can be found here.  Also, if you make a mistake during your test creation, individual Steps can be deleted by hovering over the Step and clicking the red X.  Alternatively, if you have clicked Save and Close, but find yourself needing to add more Steps, hover over the Step and click the green, downward arrow to create a new line.

 

11.png 

 

5. Enter “Home” in the page text field.

6. Click Save and Continue.

 

 12.png

 

7. Select “verify element on page” from the syntax menu.

 

 13.png

 

8. Set the Given, When, Then drop-down to Then.

9. Enter “How Janova Works Link” into the element text field.

10. Click Save and Close.

 

Note: You probably noticed the Given, When, Then options while entering this information.  While it is not mandatory, we find it most helpful align these modifiers to actions that guide you around the page.  A Given statement is one that takes you to a page, and a When statement is an action that takes place on that page.  A Then would come into play after both of these sets of Steps, and would ensure functionality once there. If you prefer, you can ignore these altogether, but we find them helpful to organize a test into a narrative flow.

 

At its most basic, a Given, When, Then functions as follows:

Given I go to a page

When I interact with it in some way

Then I will see what I intend to see

 

Continue on to part six, Pages.