Example: feature/LUSTEF-Zad12
Remove // Commented lines
and empty lines
By default, file formatting should be already uploaded to Eclipse.
-
Eclipse -> Preferences -> Java -> Code Style -> Formatter -> Import eclipse_format_code_standards.xml
-
How to use: Ctrl + Shift + F
The prefix of a unique package name is always written in all-lowercase ASCII letters.
Example com.example.selenium.cmu.cs.bovik.cheese
Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
Example:
-
class Raster;
-
class ImageSprite;
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
Example:
-
run();
-
runFast();
-
getBackground();
List of rules during code review for file structure - Test class files
Validate all business test case steps
Test Class file can only execute methods/actions from Page class.
As the result of this, Test class can use only asserts against this Page methods
List of rules during code review for file structure - Page class files
As Page class file mimics actions on web page, therefore no "test" operation can be done here.
For any test action, Test class with test methods can be used.
Method convention described in details, link: Naming convention
Some actions such as click might need to:
-
wait to load page
getDriver().waitForPageLoaded();
-
return new Page object.
It is not allowed to use Thread.sleep steps.
Instead of this pleas use waitUntil
List available waitUntils:
-
getDriver().waitForPageLoaded();
-
getDriver().waitForElement(selector);
-
getDriver().waitForElementVisible(selector);
-
getDriver().waitUntilElementIsClickable(selector);
Type of selector: every type ( By.cssSelector
, By.className
, ... ) except By.xpath
private static final By selectorResultBanner = By.cssSelector("#hdtb-msb-vis");
Link to css selector tutorial
Type of variable: private static final
private static final By selectorResultBanner = By.cssSelector("#hdtb-msb-vis");
Naming: selector[ElementName]
private static final By selectorResultBanner = By.cssSelector("#hdtb-msb-vis");