Skip to content

Commit

Permalink
#5328 add some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Apr 14, 2024
1 parent dc65a3a commit a3a5726
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.ie.InternetExplorerOptions;
import org.openqa.selenium.safari.SafariOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.ArrayList;
Expand Down Expand Up @@ -39,6 +41,8 @@
* Email: roman.iovlev.jdi@gmail.com; Skype: roman.iovlev
*/
public class DriverData {
private static final Logger log = LoggerFactory.getLogger(DriverData.class);

public static String getDriverFolder() {
return isNotBlank(DRIVER.path) && !DRIVER.path.equalsIgnoreCase("default")
? DRIVER.path : mergePath(COMMON.testPath, "resources", "drivers");
Expand Down Expand Up @@ -102,15 +106,21 @@ public static MutableCapabilities getCapabilities(
setupErrors.clear();
}
try {
DRIVER.capabilities.common.forEach((property, value) -> setupCapability(caps, property, value));
DRIVER.capabilities.common.forEach((property, value) -> {
if (property != null && value != null) {
setupCapability(caps, property, value);
} else {
logger.error("Property is not valid %s %", property, value);
}
});
} catch (Throwable ex) {
logger.info("Failed to set COMMON_CAPABILITIES Capabilities for Driver: " + safeException(ex));
}
return caps;
}

public static void setupCapability(MutableCapabilities cap, String property, String value) {
if (!property.equals(ARGUMENTS_PROPERTY)) {
if (!ARGUMENTS_PROPERTY.equals(property)) {
if (property.toLowerCase().contains("version")) {
cap.setCapability(property, value);
} else {
Expand Down

0 comments on commit a3a5726

Please sign in to comment.