You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LOG.error("Failed to create map file: " + e.getMessage());
171
187
}
172
188
173
189
g = img.createGraphics();
@@ -237,69 +253,80 @@ public JSONObject validate() {
237
253
}
238
254
if (minWidth > MIN_MARGIN) {
239
255
if (widthRoot < minWidth) {
240
-
errorMessage.add(String.format("Expected min width of element \"" + rootElementReadableName + "\"is: %spx. Actual width is: %spx", minWidth, widthRoot));
256
+
errorMessage.add(String.format("Expected min width of element '%s' is: %spx. Actual width is: %spx", rootElementReadableName, minWidth, widthRoot));
241
257
if (drawMap) {
242
258
drawElementRect(g, Color.RED, rootElement);
243
259
}
244
260
}
245
261
}
246
262
if (maxWidth > MIN_MARGIN) {
247
263
if (widthRoot > maxWidth) {
248
-
errorMessage.add(String.format("Expected max width of element \"" + rootElementReadableName + "\"is: %spx. Actual width is: %spx", maxWidth, widthRoot));
264
+
errorMessage.add(String.format("Expected max width of element '%s' is: %spx. Actual width is: %spx", rootElementReadableName, maxWidth, widthRoot));
249
265
if (drawMap) {
250
266
drawElementRect(g, Color.RED, rootElement);
251
267
}
252
268
}
253
269
}
254
270
if (minHeight > MIN_MARGIN) {
255
271
if (heightRoot < minHeight) {
256
-
errorMessage.add(String.format("Expected min height of element \"" + rootElementReadableName + "\"is: %spx. Actual height is: %spx", minHeight, heightRoot));
272
+
errorMessage.add(String.format("Expected min height of element '%s' is: %spx. Actual height is: %spx", rootElementReadableName, minHeight, heightRoot));
257
273
if (drawMap) {
258
274
drawElementRect(g, Color.RED, rootElement);
259
275
}
260
276
}
261
277
}
262
278
if (maxHeight > MIN_MARGIN) {
263
279
if (heightRoot > maxHeight) {
264
-
errorMessage.add(String.format("Expected max height of element \"" + rootElementReadableName + "\"is: %spx. Actual height is: %spx", maxHeight, heightRoot));
280
+
errorMessage.add(String.format("Expected max height of element '%s' is: %spx. Actual height is: %spx", rootElementReadableName, maxHeight, heightRoot));
errorMessage.add(String.format("Expected min left margin of element \"" + rootElementReadableName + "\"is: %spx. Actual left margin is: %spx", minLeftMargin, xRoot));
288
+
if (xRoot < minLeftMargin){
289
+
errorMessage.add(String.format("Expected min left margin of element '%s' is: %spx. Actual left margin is: %spx", rootElementReadableName, minLeftMargin, xRoot));
274
290
}
275
-
if (yRoot < minTopMargin){
276
-
errorMessage.add(String.format("Expected min top margin of element \"" + rootElementReadableName + "\"is: %spx. Actual top margin is: %spx", minTopMargin, yRoot));
291
+
if (yRoot < minTopMargin){
292
+
errorMessage.add(String.format("Expected min top margin of element '%s' is: %spx. Actual top margin is: %spx", rootElementReadableName, minTopMargin, yRoot));
277
293
}
278
-
if (elementRightMargin < minRightMargin){
279
-
errorMessage.add(String.format("Expected min top margin of element \"" + rootElementReadableName + "\"is: %spx. Actual right margin is: %spx", minRightMargin, elementRightMargin));
294
+
if (elementRightMargin < minRightMargin){
295
+
errorMessage.add(String.format("Expected min top margin of element '%s' is: %spx. Actual right margin is: %spx", rootElementReadableName, minRightMargin, elementRightMargin));
280
296
}
281
-
if (elementBottomMargin < minBottomMargin){
282
-
errorMessage.add(String.format("Expected min bottom margin of element \"" + rootElementReadableName + "\"is: %spx. Actual bottom margin is: %spx", minBottomMargin, elementBottomMargin));
297
+
if (elementBottomMargin < minBottomMargin){
298
+
errorMessage.add(String.format("Expected min bottom margin of element '%s' is: %spx. Actual bottom margin is: %spx", rootElementReadableName, minBottomMargin, elementBottomMargin));
errorMessage.add(String.format("Expected max left margin of element \"" + rootElementReadableName + "\"is: %spx. Actual left margin is: %spx", maxLeftMargin, xRoot));
302
+
if (xRoot > maxLeftMargin){
303
+
errorMessage.add(String.format("Expected max left margin of element '%s' is: %spx. Actual left margin is: %spx", rootElementReadableName, maxLeftMargin, xRoot));
288
304
}
289
-
if (yRoot > maxTopMargin){
290
-
errorMessage.add(String.format("Expected max top margin of element \"" + rootElementReadableName + "\"is: %spx. Actual top margin is: %spx", maxTopMargin, yRoot));
305
+
if (yRoot > maxTopMargin){
306
+
errorMessage.add(String.format("Expected max top margin of element '%s' is: %spx. Actual top margin is: %spx", rootElementReadableName, maxTopMargin, yRoot));
291
307
}
292
-
if (elementRightMargin > maxRightMargin){
293
-
errorMessage.add(String.format("Expected max right margin of element \"" + rootElementReadableName + "\"is: %spx. Actual right margin is: %spx", maxRightMargin, elementRightMargin));
308
+
if (elementRightMargin > maxRightMargin){
309
+
errorMessage.add(String.format("Expected max right margin of element '%s' is: %spx. Actual right margin is: %spx", rootElementReadableName, maxRightMargin, elementRightMargin));
294
310
}
295
-
if (elementBottomMargin > maxBottomMargin){
296
-
errorMessage.add(String.format("Expected max bottom margin of element \"" + rootElementReadableName + "\" is: %spx. Actual bottom margin is: %spx", maxBottomMargin, elementBottomMargin));
311
+
if (elementBottomMargin > maxBottomMargin) {
312
+
errorMessage.add(String.format("Expected max bottom margin of element '%s' is: %spx. Actual bottom margin is: %spx", rootElementReadableName, maxBottomMargin, elementBottomMargin));
313
+
}
314
+
}
315
+
if (!overlapElements.isEmpty()) {
316
+
for (Map.Entry<WebElement, String> entry : overlapElements.entrySet()) {
317
+
if (elementsAreOverlapped(rootElement, entry.getKey())) {
318
+
errorMessage.add(String.format("Element '%s' is overlapped with element '%s' but should not", rootElementReadableName, entry.getValue()));
0 commit comments