diff --git a/pom.xml b/pom.xml index 98c72fa..c212a87 100644 --- a/pom.xml +++ b/pom.xml @@ -189,19 +189,19 @@ com.github.aquality-automation aquality-selenium-core - 4.0.2 + 4.0.3 io.appium java-client - 9.2.2 + 9.2.3 org.testng testng - 7.9.0 + 7.10.2 test @@ -215,7 +215,7 @@ commons-io commons-io - 2.15.1 + 2.16.1 test diff --git a/src/main/java/aquality/appium/mobile/configuration/DeviceSettings.java b/src/main/java/aquality/appium/mobile/configuration/DeviceSettings.java index c17e19e..0809bb4 100644 --- a/src/main/java/aquality/appium/mobile/configuration/DeviceSettings.java +++ b/src/main/java/aquality/appium/mobile/configuration/DeviceSettings.java @@ -2,8 +2,7 @@ import aquality.selenium.core.utilities.ISettingsFile; import aquality.selenium.core.utilities.JsonSettingsFile; -import org.openqa.selenium.Capabilities; -import org.openqa.selenium.remote.DesiredCapabilities; +import io.appium.java_client.remote.options.BaseOptions; import java.util.HashMap; import java.util.Map; @@ -27,9 +26,9 @@ private ISettingsFile getDevicesSettingsFile() { } @Override - public Capabilities getCapabilities() { + public BaseOptions getCapabilities() { Map deviceCapabilities = getCapabilitiesFromSettings(); - DesiredCapabilities capabilities = new DesiredCapabilities(); + BaseOptions capabilities = new BaseOptions<>(); deviceCapabilities.forEach(capabilities::setCapability); return capabilities; } diff --git a/src/main/java/aquality/appium/mobile/configuration/DriverSettings.java b/src/main/java/aquality/appium/mobile/configuration/DriverSettings.java index e5984d8..8f50807 100644 --- a/src/main/java/aquality/appium/mobile/configuration/DriverSettings.java +++ b/src/main/java/aquality/appium/mobile/configuration/DriverSettings.java @@ -4,8 +4,7 @@ import aquality.appium.mobile.application.PlatformName; import aquality.selenium.core.localization.ILocalizationManager; import aquality.selenium.core.utilities.ISettingsFile; -import org.openqa.selenium.Capabilities; -import org.openqa.selenium.remote.DesiredCapabilities; +import io.appium.java_client.remote.options.BaseOptions; import java.io.File; import java.io.IOException; @@ -29,9 +28,9 @@ public DriverSettings(ISettingsFile settingsFile, PlatformName platformName) { } @Override - public Capabilities getCapabilities() { + public BaseOptions getCapabilities() { Map capabilitiesFromSettings = getCapabilitiesFromSettings(); - DesiredCapabilities capabilities = new DesiredCapabilities(); + BaseOptions capabilities = new BaseOptions<>(); capabilitiesFromSettings.forEach((key, value) -> { if (key.toLowerCase().endsWith("options")) { value = settingsFile.getMap(getDriverSettingsPath(CAPABILITIES, key)); @@ -68,7 +67,7 @@ private boolean hasApplicationPath() { return settingsFile.getMap(getDriverSettingsPath()).containsKey(APPLICATION_PATH_KEY) || getDeviceCapabilities().is(APP_CAPABILITY_KEY); } - private Capabilities getDeviceCapabilities() { + private BaseOptions getDeviceCapabilities() { String deviceKey = (String) settingsFile.getValueOrDefault(getDriverSettingsPath(DEVICE_KEY_KEY), null); IDeviceSettings deviceSettings = new DeviceSettings(deviceKey); return deviceSettings.getCapabilities(); diff --git a/src/main/java/aquality/appium/mobile/configuration/IDeviceSettings.java b/src/main/java/aquality/appium/mobile/configuration/IDeviceSettings.java index a9e6e7a..9ce548f 100644 --- a/src/main/java/aquality/appium/mobile/configuration/IDeviceSettings.java +++ b/src/main/java/aquality/appium/mobile/configuration/IDeviceSettings.java @@ -1,6 +1,6 @@ package aquality.appium.mobile.configuration; -import org.openqa.selenium.Capabilities; +import io.appium.java_client.remote.options.BaseOptions; /** * Describes desired device settings. @@ -9,7 +9,7 @@ public interface IDeviceSettings { /** * Capabilities related to desired device. - * @return initialized {@link Capabilities}. + * @return initialized {@link BaseOptions}. */ - Capabilities getCapabilities(); + BaseOptions getCapabilities(); } diff --git a/src/main/java/aquality/appium/mobile/configuration/IDriverSettings.java b/src/main/java/aquality/appium/mobile/configuration/IDriverSettings.java index 40cf14e..f6a553d 100644 --- a/src/main/java/aquality/appium/mobile/configuration/IDriverSettings.java +++ b/src/main/java/aquality/appium/mobile/configuration/IDriverSettings.java @@ -1,6 +1,6 @@ package aquality.appium.mobile.configuration; -import org.openqa.selenium.Capabilities; +import io.appium.java_client.remote.options.BaseOptions; /** * Describes AppiumDriver settings. @@ -9,9 +9,9 @@ public interface IDriverSettings { /** * Gets appium driver capabilities. - * @return initialized {@link Capabilities}. + * @return initialized {@link BaseOptions}. */ - Capabilities getCapabilities(); + BaseOptions getCapabilities(); /** * Provides a path to the application.