Skip to content

Commit 7dce212

Browse files
author
Denys Zaiats
committed
[issue-22] - fix issue with getting caps
1 parent 374a77f commit 7dce212

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/main/java/util/driver/WebDriverFactory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public class WebDriverFactory {
3434
private RemoteWebDriver remoteWebDriver;
3535
private DesiredCapabilities capabilities;
3636

37+
public WebDriverFactory() {
38+
capabilities = getCapabilities();
39+
LOG.info("Using capabilities: " + capabilities.toString());
40+
remoteUrlPath = getRemoteUrlPath();
41+
}
42+
3743
private static void setChromeDriver() {
3844
Platform platform = Platform.getCurrent();
3945
String chromeBinary = "src/main/resources/drivers/chromedriver"
@@ -59,9 +65,6 @@ private static void setEdgeDriver() {
5965
}
6066

6167
public WebDriver getDriver() {
62-
capabilities = getCapabilities();
63-
LOG.info("Using capabilities: " + capabilities.toString());
64-
remoteUrlPath = getRemoteUrlPath();
6568
if (isMobile()) {
6669
driver = getMobileDriver();
6770
LOG.info("Start Mobile driver");

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,11 @@ int getRetinaValue(int value) {
709709
return value;
710710
}
711711
} else {
712-
return value;
712+
if (isIOS()) {
713+
return 2 * value;
714+
} else {
715+
return value;
716+
}
713717
}
714718
}
715719

src/main/java/util/validator/UIValidator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class UIValidator extends ResponsiveUIValidator implements Validator {
1919
heightRoot = rootElement.getSize().getHeight();
2020
pageWidth = (int) getPageWidth();
2121
pageHeight = (int) getPageHeight();
22-
pageHeight = getRetinaValue(driver.manage().window().getSize().getHeight());
2322
startTime = System.currentTimeMillis();
2423
}
2524

0 commit comments

Comments
 (0)