|
Configuration Options Output Empty Test Suite Results Login Page If they try to access the homepage without being logged in they will be redirected to the login page. Successful account creation will redirect you to the homepage. After successful login, you will be redirected to the homepage. Receive a warning if their login attempt is unsuccessful. Be aware if they try to register using an existing username. Be aware if they submit an empty form. Return to the login page when exiting. In this article you will Write tests for only some of these scenarios to keep the content to a manageable length. Specifically you will cover the following scenarios in this article.login page if they try to access the home page without being logged in. Successful account creation will redirect you to the homepage.
After successful login, you will be red photo editing servies irected to the homepage. Receive a warning if their login attempt is unsuccessful. Be aware if they submit an empty form. Note that these scenarios will cover all the major concepts we hope to convey in this article. We encourage you to try writing tests for other scenarios yourself too. Now that you have set specific goals, you will now start writing tests. Test Examples provides a vast library of helpers and tools that allow you to test your applications very intuitively. Take a look at the example test below for a hypothetical application that allows you to post messages to a forum. The above test verifies that when you post a message it automatically displays on the web page. To achieve this the test must follow the process that the user takes to achieve the desired result. More specifically the test must be logged in using a test account Submit the post Verify that the post is showing up on the web page You.

May have noticed that many steps such as logging in may end up being repeated many times. Especially in test suites that contain dozens or more tests that require logged in users. To avoid duplicating a set of instructions in each test you will utilize two concepts to group these instructions into reusable chunks. These are pages and fixtures. Pages First you will set up a page for your login page. This is essentially just a helper class that groups the various sets of interactions with the web page into individual member functions of the class. These functions will ultimately be used by the fixtures and the tests themselves. Create a new folder in that folder .
|
|