Feature structure
Last updated
Was this helpful?
Last updated
Was this helpful?
Feature folders in Automation Testing (AT) project correspond to features within the application. Each feature deals with a specific set of responsibilities.
We will use the Users feature as an example to showcase the process of setting up a feature folder in AT project.
Inspecting the of the application, we can conclude it consists of three page objects:
Create New User modal window
User Management Page
User Page (or User Edit page)
We can create the Users feature folder inside the AT project, and add the following basic elements which every feature must contain:
Components folder will contain page objects for pages within this feature. It can contain Controls subfolder containing custom controls used by the page objects.
Constants
contains all the selectors for page objects in this feature.
Tests folder contains all tests related to this feature.
Tests are separated into two subfolders: Parallelizable and NonParallelizable depending on how we structured tests to execute.
Pages
is a partial static class in which we define the pages related to that feature. We define this partial class in every feature folder so that feature pages are separated. In this example we can define the User Management page with:
and then load it when writing tests: Pages.UserManagementPage()
In this example, UsersSetupFixture
is used to create a test user before any tests are run, and to cleanup and delete that user when all tests in this feature finish executing.
Many features will have a class defined, which is used to setup test data for that feature.