Skip to content

Commit

Permalink
Merge pull request #52 from AutomateThePlanet/android-custom-driver-o…
Browse files Browse the repository at this point in the history
…ptions-fix

Added custom capabilities on app restart
  • Loading branch information
teo-nikolov authored Nov 25, 2024
2 parents d15cba5 + d2379c7 commit 88fc682
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,13 @@ private static String getBuildName() {
}

private static <TOption extends MutableCapabilities> void addDriverConfigOptions(TOption chromeOptions) {
for (var optionKey : APP_CONFIGURATION.get().appiumOptions.keySet()) {
chromeOptions.setCapability(optionKey, APP_CONFIGURATION.get().appiumOptions.get(optionKey));
for (var optionEntry : APP_CONFIGURATION.get().appiumOptions.entrySet()) {
chromeOptions.setCapability(optionEntry.getKey(), optionEntry.getValue());
}
}

private static <TOption extends MutableCapabilities> void addCustomDriverOptions(TOption mobileOptions) {
for (var optionKey : CUSTOM_DRIVER_OPTIONS.get().keySet()) {
mobileOptions.setCapability(optionKey, CUSTOM_DRIVER_OPTIONS.get().get(optionKey));
}
getCustomDriverOptions().forEach(mobileOptions::setCapability);
}

public static void close() {
Expand All @@ -225,7 +223,7 @@ public static void close() {

if (WRAPPED_ANDROID_DRIVER.get() != null) {
WRAPPED_ANDROID_DRIVER.get().quit();
CUSTOM_DRIVER_OPTIONS.get().clear();
// CUSTOM_DRIVER_OPTIONS.get().clear();
}

DISPOSED.set(true);
Expand Down

0 comments on commit 88fc682

Please sign in to comment.