Skip to content

Naming convention

vefimofff edited this page Nov 15, 2017 · 4 revisions

Class

Page class name should end with 'Page' word e.g. HomePage, LoginPage, SettingsPage.

Block class name should end with 'Block' word e.g. LoginFormBlock, AuthorListBlock, ChangePasswordWindowBlock.

Action methods

For better reusability and understandability of a code, it is recommended to stick to a limited number of keywords to start method names with.

  • All click methods should start with a word 'click' and clearly define an object being clicked e.g. clickLoginButton, clickUserLink, clickHeader.

  • All input text methods should start with a word 'input' and clearly define an object being input e.g. inputFirstName, inputPassword, inputAnyNumber.

  • All select methods should start with a word 'select' and clearly define an object being selected e.g. selectFirstOption, selectCountry, selectRandomYear.

Check methods

  • All check methods should start with a word 'check' and clearly define what is being checked e.g. checkFirstName, checkImageIsLoaded, checkHeaderText.

All checks that verify that some element is visible on the screen should be named using the following pattern: check{specify_element}IsDisplayed e.g. checkLoginButtonIsDisplayed, checkUserLinkIsDisplayed.

Block methods

  • All block methods should start with a word 'get' and end with a word 'Block' and clearly define what block is being returned e.g. getLoginBlock, getHeaderBlock.
Clone this wiki locally