Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/cleaning #430

Merged
merged 9 commits into from
Jul 12, 2024
42 changes: 42 additions & 0 deletions mrchecker-playwright-framework/NAMING_CONVENTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Locators naming conventions
1. Every locator should start with prefix: locator
2. Every locator/selector should have suffix which indicate what kind of element it is:
- Button
- Input
- Link
- Label
- Dropdown
- Checkbox
- Image
- Icon
- Tab
- Table
- etc...


Example:
` locatorSearchButton, locatorWarningIcon



## Methods naming conventions:
Methods start with prefix
- clickOn - for clicking on elements, submiting
- fill - for filling input elements
- check - for asserting, ex. checkVisible, checkEnabled, checkSelected
- select - for selecting dropdown elements
- get - for getting the value of element
- is - for getting the boolean information about element, ex. isVisible, isEnabled, isSelected

Methods should have suffix which indicates the type of element - the same as locators, example: clickOnSubmitButton, fillNameInput


## Page object conventions:
1. locators should be initialized in initLocators method
2. page should be initializes with PlaywrightFactory.getPage()


## Test conventions:
1. Test should inherit from BaseTest class
2. Test data should be put as a class variable in TestCases class
3. Test should use page object methods to interact with the page
Loading