|
1 | | -[](https://travis-ci.org/ITArray/Automotion) |
| 1 | +[](https://travis-ci.org/ITArray/Automotion) |
2 | 2 |
|
3 | 3 | # Automotion # |
4 | | - |
| 4 | + |
5 | 5 |
|
6 | 6 | ##### Example: https://github.com/ITArray/automotion-example |
7 | 7 | ### Steps to connect ### |
|
40 | 40 | * For Web local run: |
41 | 41 |
|
42 | 42 | IS_LOCAL=True |
43 | | - BROWSER=Firefox|Chrome|IE|Safari |
| 43 | + BROWSER=Firefox|Chrome|IE|Safari|EDGE |
44 | 44 |
|
45 | 45 | * For Web remote run: |
46 | 46 |
|
47 | 47 | IS_REMOTE=True |
48 | | - BROWSER=Firefox|Chrome|IE|Safari |
| 48 | + BROWSER=Firefox|Chrome|IE|Safari|EDGE |
49 | 49 | EXECUTOR=http://{host}:{port}/wd/hub |
50 | 50 | (optional available with Chrome only) MOBILE_DEVICE_EMULATION=Google Nexus 5|Apple iPhone 6|Samsung Galaxy S5 |
51 | 51 |
|
|
79 | 79 | EXECUTOR=http://{host}:{port}/wd/hub |
80 | 80 | DEVICE=Device name or ID |
81 | 81 |
|
82 | | -### Possibilities ### |
| 82 | +### Responsive UI Validation ### |
83 | 83 | - Responsive UI Validator allows to validate UI on web or mobile page using lots of criterias. Also it allows tu build thr HTMl report after validation. |
84 | 84 |
|
85 | | - ResponsiveUIValidator uiValidator = new ResponsiveUIValidator(driver); |
| 85 | + ResponsiveUIValidator uiValidator = new ResponsiveUIValidator(driver); |
86 | 86 |
|
87 | 87 |
|
88 | 88 | boolean result = uiValidator.init() |
|
106 | 106 |
|
107 | 107 |
|
108 | 108 | uiValidator.generateReport(); |
| 109 | + |
| 110 | + - Description for each methods available in the framework: |
| 111 | + |
| 112 | + * Init method: |
| 113 | + |
| 114 | + init(); // Method that defines start of new validation. Needs to be called each time before calling findElement(), findElements() |
| 115 | + |
| 116 | + init("Scenario name"); // Method that defines start of new validation with specified name of scenario. Needs to be called each time before calling findElement(), findElements() |
| 117 | + |
| 118 | + setColorForRootElement(Color color); // Set color for main element. This color will be used for highlighting element in results |
| 119 | + |
| 120 | + setColorForHighlightedElements(Color color); // Set color for compared elements. This color will be used for highlighting elements in results |
| 121 | + |
| 122 | + setLinesColor(Color color); // Set color for grid lines. This color will be used for the lines of alignment grid in results |
| 123 | + |
| 124 | + findElement(WebElement element, String readableNameOfElement); // Main method to specify which element we want to validate (can be called only findElement() OR findElements() for single validation) |
| 125 | + |
| 126 | + findElements(List<WebElement> elements); // Main method to specify the list of elements that we want to validate (can be called only findElement() OR findElements() for single validation) |
| 127 | + |
| 128 | + * For single element findElement({element}, "name"): |
| 129 | + |
| 130 | + insideOf(WebElement containerElement, String readableContainerName); // Verify that element is located inside of specified element |
| 131 | + |
| 132 | + withLeftElement(WebElement element); // Verify that element which located left to is correct |
| 133 | + |
| 134 | + withLeftElement(WebElement element, int minMargin, int maxMargin); // Verify that element which located left to is correct with specified margins |
| 135 | + |
| 136 | + withRightElement(WebElement element); // Verify that element which located right to is correct |
| 137 | + |
| 138 | + withRightElement(WebElement element, int minMargin, int maxMargin); // Verify that element which located right to is correct with specified margins |
| 139 | + |
| 140 | + withTopElement(WebElement element); // Verify that element which located top to is correct |
| 141 | + |
| 142 | + withTopElement(WebElement element, int minMargin, int maxMargin); // Verify that element which located top to is correct with specified margins |
| 143 | + |
| 144 | + withBottomElement(WebElement element); // Verify that element which located bottom to is correct |
| 145 | + |
| 146 | + withBottomElement(WebElement element, int minMargin, int maxMargin); // Verify that element which located bottom to is correct with specified margins |
| 147 | + |
| 148 | + notOverlapWith(WebElement element, String readableName); // Verify that element is NOT overlapped with specified element |
| 149 | + |
| 150 | + overlapWith(WebElement element, String readableName); // Verify that element is overlapped with specified element |
| 151 | + |
| 152 | + notOverlapWith(List<WebElement> elements); // Verify that element is NOT overlapped with every element is the list |
| 153 | + |
| 154 | + sameOffsetLeftAs(WebElement element, String readableName); // Verify that element has the same left offset as specified element |
| 155 | + |
| 156 | + sameOffsetLeftAs(List<WebElement> elements); // Verify that element has the same left offset as every element is the list |
| 157 | + |
| 158 | + sameOffsetRightAs(WebElement element, String readableName); // Verify that element has the same right offset as specified element |
| 159 | + |
| 160 | + sameOffsetRightAs(List<WebElement> elements); // Verify that element has the same right offset as every element is the list |
| 161 | + |
| 162 | + sameOffsetTopAs(WebElement element, String readableName); // Verify that element has the same top offset as specified element |
| 163 | + |
| 164 | + sameOffsetTopAs(List<WebElement> elements); // Verify that element has the same top offset as every element is the list |
| 165 | + |
| 166 | + sameOffsetBottomAs(WebElement element, String readableName); // Verify that element has the same bottom offset as specified element |
| 167 | + |
| 168 | + sameOffsetBottomAs(List<WebElement> elements); // Verify that element has the same bottom offset as every element is the list |
| 169 | + |
| 170 | + sameWidthAs(WebElement element, String readableName); // Verify that element has the same width as specified element |
| 171 | + |
| 172 | + sameWidthAs(List<WebElement> elements); // Verify that element has the same width as every element in the list |
| 173 | + |
| 174 | + minWidth(int width); // Verify that width of element is not less than specified |
| 175 | + |
| 176 | + maxWidth(int width); // Verify that width of element is not bigger than specified |
| 177 | + |
| 178 | + widthBetween(int min, int max); // Verify that width of element is in range |
| 179 | + |
| 180 | + sameHeightAs(WebElement element, String readableName); // Verify that element has the same height as specified element |
| 181 | + |
| 182 | + sameHeightAs(List<WebElement> elements); // Verify that element has the same height as every element in the list |
| 183 | + |
| 184 | + minHeight(int height); // Verify that height of element is not less than specified |
| 185 | + |
| 186 | + maxHeight(int height); // Verify that height of element is not bigger than specified |
| 187 | + |
| 188 | + sameSizeAs(WebElement element, String readableName); // Verify that element has the same size as specified element |
| 189 | + |
| 190 | + sameSizeAs(List<WebElement> elements); // Verify that element has the same size as every element in the list |
| 191 | + |
| 192 | + heightBetween(int min, int max); // Verify that height of element is in range |
| 193 | + |
| 194 | + minOffset(int top, int right, int bottom, int left); // Verify that min offset of element is not less than (min value is -10000) |
| 195 | + |
| 196 | + maxOffset(int top, int right, int bottom, int left); // Verify that max offset of element is not bigger than (min value is -10000) |
| 197 | + |
| 198 | + withCssValue(String cssProperty, String... args); // Verify that element has correct CSS values |
| 199 | + |
| 200 | + withoutCssValue(String cssProperty, String... args); // Verify that concrete CSS values are absent for specified element |
| 201 | + |
| 202 | + equalLeftRightOffset(); // Verify that element has equal left and right offsets (e.g. Bootstrap container) |
| 203 | + |
| 204 | + equalTopBottomOffset(); // Verify that element has equal top and bottom offset (aligned vertically in center) |
| 205 | + |
| 206 | + changeMetricsUnitsTo(ResponsiveUIValidator.Units units); // Change units to Pixels or % (Units.PX, Units.PERCENT) |
| 207 | + |
| 208 | + * For list of elements findElements({element}): |
| 209 | + |
| 210 | + insideOf(WebElement containerElement, String readableContainerName); // Verify that elements are located inside of specified element |
| 211 | + |
| 212 | + alignedAsGrid(int horizontalGridSize); // Verify that elements are aligned in a grid view width specified amount of columns |
| 213 | + |
| 214 | + alignedAsGrid(int horizontalGridSize, int verticalGridSize); // Verify that elements are aligned in a grid view width specified amount of columns and rows |
| 215 | + |
| 216 | + areNotOverlappedWithEachOther(); // Verify that every element in the list is not overlapped with another element from this list |
| 217 | + |
| 218 | + withSameSize(); // Verify that elements in the list have the same size |
| 219 | + |
| 220 | + withSameWidth(); // Verify that elements in the list have the same width |
| 221 | + |
| 222 | + withSameHeight(); // Verify that elements in the list have the same height |
| 223 | + |
| 224 | + sameRightOffset(); // Verify that elements in the list have the right offset |
| 225 | + |
| 226 | + sameLeftOffset(); // Verify that elements in the list have the same left offset |
| 227 | + |
| 228 | + sameTopOffset(); // Verify that elements in the list have the same top offset |
| 229 | + |
| 230 | + sameBottomOffset(); // Verify that elements in the list have the same bottom offset |
| 231 | + |
| 232 | + equalLeftRightOffset(); // Verify that every element in the list have equal right and left offset (aligned horizontally in center) |
| 233 | + |
| 234 | + equalTopBottomOffset(); // Verify that every element in the list have equal top and bottom offset (aligned vertically in center) |
| 235 | + |
| 236 | + changeMetricsUnitsTo(ResponsiveUIValidator.Units units); // Change units to Pixels or % (Units.PX, Units.PERCENT) |
| 237 | + |
| 238 | + * Generating results: |
| 239 | + |
| 240 | + drawMap(); // Methods needs to be called to collect all the results in JSON file and screenshots |
| 241 | + |
| 242 | + validate(); // Call method to summarize and validate the results (can be called with drawMap(). In this case result will be only True or False) |
| 243 | + |
| 244 | + generateReport(); // Call method to generate HTML report |
| 245 | + |
| 246 | + generateReport("file report name"); // Call method to generate HTML report with specified file report name |
109 | 247 |
|
| 248 | +### Possibilities ### |
110 | 249 | - Verification that elements are aligned correctly on the web or mobile page |
111 | 250 | * Elements horizontally are aligned correctly: |
112 | 251 |
|
|
177 | 316 | DriverHelper.scrollUpMobileElement(AppiumDriver driver, MobileElement element) |
178 | 317 | DriverHelper.scrollDownMobileElement(AppiumDriver driver, MobileElement element, int duration) - duration not less than 500ms |
179 | 318 | DriverHelper.scrollUpMobileElement(AppiumDriver driver, MobileElement element, int duration) - duration not less than 500ms |
| 319 | + DriverHelper.zoomInOutPage(WebDriver driver, int zoomPercent) - zoom In/Out the page |
180 | 320 |
|
181 | 321 | DriverHelper.hideKeyboard(AppiumDriver driver) - super method that perform hiding of keyboard for Android and iOS |
182 | 322 |
|
|
0 commit comments