-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.4.2] - refactoring and re-sctructure of UIValidator classes. Incap…
…sulation internal methods
- Loading branch information
Showing
11 changed files
with
490 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package util.validator; | ||
|
||
public interface ChunkValidator { | ||
|
||
ResponsiveUIChunkValidator alignedAsGrid(int horizontalGridSize); | ||
|
||
ResponsiveUIChunkValidator alignedAsGrid(int horizontalGridSize, int verticalGridSize); | ||
|
||
ResponsiveUIChunkValidator areNotOverlappedWithEachOther(); | ||
|
||
ResponsiveUIChunkValidator withSameSize(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/util/validator/ResponsiveUIChunkValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package util.validator; | ||
|
||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
import java.util.List; | ||
|
||
public class ResponsiveUIChunkValidator extends ResponsiveUIValidator implements ChunkValidator { | ||
|
||
ResponsiveUIChunkValidator(WebDriver driver, List<WebElement> elements) { | ||
super(driver); | ||
rootElements = elements; | ||
pageWidth = driver.manage().window().getSize().getWidth(); | ||
pageHeight = driver.manage().window().getSize().getHeight(); | ||
rootElement = rootElements.get(0); | ||
startTime = System.currentTimeMillis(); | ||
} | ||
|
||
@Override | ||
public ResponsiveUIChunkValidator alignedAsGrid(int horizontalGridSize) { | ||
validateGridAlignment(horizontalGridSize, 0); | ||
return this; | ||
} | ||
|
||
@Override | ||
public ResponsiveUIChunkValidator alignedAsGrid(int horizontalGridSize, int verticalGridSize) { | ||
validateGridAlignment(horizontalGridSize, verticalGridSize); | ||
return this; | ||
} | ||
|
||
@Override | ||
public ResponsiveUIChunkValidator areNotOverlappedWithEachOther() { | ||
validateElementsAreNotOverlapped(rootElements); | ||
return this; | ||
} | ||
|
||
@Override | ||
public ResponsiveUIChunkValidator withSameSize() { | ||
validateSameSize(rootElements); | ||
return this; | ||
} | ||
} |
Oops, something went wrong.