Skip to content

Commit

Permalink
Added empty check because PropertyManager returns emtpy String in cas…
Browse files Browse the repository at this point in the history
…e of platform property is not set
  • Loading branch information
martingrossmann committed Jan 24, 2022
1 parent dcd6da6 commit 75b0348
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void initBrowser() {
}

if (StringUtils.isBlank(this.getPlatformName().orElse(null))) {
this.setPlatformName(PropertyManager.getProperty(TesterraProperties.BROWSER_PLATFORM, null));
this.setPlatformName(PropertyManager.getProperty(TesterraProperties.BROWSER_PLATFORM, ""));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,12 @@ public static WebDriver getWebDriver(AbstractWebDriverRequest webDriverRequest)
webDriverRequest.setBrowserVersion(WebDriverManager.getConfig().getBrowserVersion());
}

if (StringUtils.isBlank(webDriverRequest.getPlatformName().orElse(null))) {
WebDriverManager.getConfig().getPlatformName().ifPresent(webDriverRequest::setPlatformName);
if (StringUtils.isEmpty(webDriverRequest.getPlatformName().orElse(null))) {
WebDriverManager.getConfig().getPlatformName().ifPresent(platfrom -> {
if (StringUtils.isNotEmpty(platfrom)) {
webDriverRequest.setPlatformName(platfrom);
}
});
}

String browser = webDriverRequest.getBrowser();
Expand Down

0 comments on commit 75b0348

Please sign in to comment.