Skip to content

Commit 4becfcd

Browse files
committed
[1.4.1] - added fix for HTML reporting. Extended verification for insideIn() method
1 parent 900d23f commit 4becfcd

File tree

6 files changed

+31
-61
lines changed

6 files changed

+31
-61
lines changed

.gitignore

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,4 @@
1-
### JetBrains template
2-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
3-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4-
5-
# User-specific stuff:
6-
.idea/workspace.xml
7-
.idea/tasks.xml
8-
.idea/dictionaries
9-
.idea/vcs.xml
10-
.idea/jsLibraryMappings.xml
11-
12-
# Sensitive or high-churn files:
13-
.idea/dataSources.ids
14-
.idea/dataSources.xml
15-
.idea/dataSources.local.xml
16-
.idea/sqlDataSources.xml
17-
.idea/dynamic.xml
18-
.idea/uiDesigner.xml
19-
20-
# Gradle:
21-
.idea/gradle.xml
22-
.idea/libraries
1+
target
232
*.iml
243
.idea
25-
drivers
26-
27-
# Mongo Explorer plugin:
28-
.idea/mongoSettings.xml
29-
30-
## File-based project format:
31-
*.iws
32-
33-
## Plugin-specific files:
34-
35-
# IntelliJ
36-
/out/
37-
38-
# mpeltonen/sbt-idea plugin
39-
.idea_modules/
40-
41-
# JIRA plugin
42-
atlassian-ide-plugin.xml
43-
44-
# Crashlytics plugin (for Android Studio and IntelliJ)
45-
com_crashlytics_export_strings.xml
46-
crashlytics.properties
47-
crashlytics-build.properties
48-
fabric.properties
49-
50-
# Created by .ignore support plugin (hsz.mobi)
4+
drivers

deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
mvn clean deploy -DperformRelease=true -DconnectionUrl=scm:git:https://github.com/dzaiats/java.automation.library.git
2+
mvn clean deploy -DperformRelease=true -DconnectionUrl=scm:git:https://github.com/ITArray/Automotion.git

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<licenses>
1515
<license>
1616
<name>Apache-2.0</name>
17-
<url>https://github.com/dzaiats/Automotion/blob/master/LICENSE</url>
17+
<url>https://github.com/ITArray/Automotion/blob/master/LICENSE-2.0</url>
1818
</license>
1919
</licenses>
2020

@@ -28,9 +28,9 @@
2828
</developers>
2929

3030
<scm>
31-
<connection>scm:git:[email protected]:dzaiats/java.automation.library.git</connection>
32-
<developerConnection>scm:git:[email protected]:dzaiats/java.automation.library.git</developerConnection>
33-
<url>[email protected]:dzaiats/java.automation.library.git</url>
31+
<connection>scm:git:[email protected]:ITArray/Automotion.git</connection>
32+
<developerConnection>scm:git:[email protected]:ITArray/Automotion.git</developerConnection>
33+
<url>[email protected]:ITArray/Automotion.git</url>
3434
</scm>
3535

3636
<properties>

src/main/java/util/validator/ResponsiveUIValidator.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -736,21 +736,32 @@ private void validateSameSize(List<WebElement> elements) {
736736
int h2 = el2.getSize().getHeight();
737737
int w2 = el2.getSize().getWidth();
738738
if (h1 != h2 || w1 != w2) {
739-
putJsonDetailsWithoutElement("Elements in a gird have different size.");
739+
putJsonDetailsWithElement("Elements in a grid have different size.", el1);
740740
}
741741
}
742742
}
743743
}
744744
}
745745

746746
private void validateInsideOfContainer(WebElement element, String readableContainerName) {
747-
float xContainer = element.getLocation().getX();
748-
float yContainer = element.getLocation().getY();
749-
float widthContainer = element.getSize().getWidth();
750-
float heightContainer = element.getSize().getHeight();
751-
752-
if (xRoot < xContainer || yRoot < yContainer || (xRoot + widthRoot) > (xContainer + widthContainer) || (yRoot + heightRoot) > (yContainer + heightContainer)) {
753-
putJsonDetailsWithElement(String.format("Element '%s' is not inside of '%s'", rootElementReadableName, readableContainerName), element);
747+
float xContainer = element.getLocation().x;
748+
float yContainer = element.getLocation().y;
749+
float widthContainer = element.getSize().width;
750+
float heightContainer = element.getSize().height;
751+
if (rootElements == null || rootElements.isEmpty()) {
752+
if (xRoot < xContainer || yRoot < yContainer || (xRoot + widthRoot) > (xContainer + widthContainer) || (yRoot + heightRoot) > (yContainer + heightContainer)) {
753+
putJsonDetailsWithElement(String.format("Element '%s' is not inside of '%s'", rootElementReadableName, readableContainerName), element);
754+
}
755+
}else{
756+
for (WebElement el: rootElements){
757+
float xRoot = el.getLocation().x;
758+
float yRoot = el.getLocation().y;
759+
float widthRoot = el.getSize().width;
760+
float heightRoot = el.getSize().height;
761+
if (xRoot < xContainer || yRoot < yContainer || (xRoot + widthRoot) > (xContainer + widthContainer) || (yRoot + heightRoot) > (yContainer + heightContainer)) {
762+
putJsonDetailsWithElement(String.format("Element is not inside of '%s'", readableContainerName), element);
763+
}
764+
}
754765
}
755766
}
756767

src/test/java/ResponsiveValidatorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public void testThatResponsiveValidatorWorks() {
3434
.alignedAsGrid(1, 3)
3535
.areNotOverlappedWithEachOther()
3636
.withSameSize()
37+
.insideOf(page.container(), "List View container")
3738
.drawMap()
3839
.validate();
3940

src/test/java/TestPage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public WebElement myPhotos() {
3535
return getWebElement(By.id("my-photos"));
3636
}
3737

38+
public WebElement container(){
39+
return getWebElement(By.className("gallery"));
40+
}
41+
3842
public WebElement footer() {
3943
return getWebElement(ExpectedConditions.elementToBeClickable(By.id("footer")));
4044
}

0 commit comments

Comments
 (0)