Skip to content

Commit 88fc682

Browse files
authored
Merge pull request #52 from AutomateThePlanet/android-custom-driver-options-fix
Added custom capabilities on app restart
2 parents d15cba5 + d2379c7 commit 88fc682

File tree

1 file changed

+4
-6
lines changed
  • bellatrix.android/src/main/java/solutions/bellatrix/android/infrastructure

1 file changed

+4
-6
lines changed

bellatrix.android/src/main/java/solutions/bellatrix/android/infrastructure/DriverService.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,13 @@ private static String getBuildName() {
207207
}
208208

209209
private static <TOption extends MutableCapabilities> void addDriverConfigOptions(TOption chromeOptions) {
210-
for (var optionKey : APP_CONFIGURATION.get().appiumOptions.keySet()) {
211-
chromeOptions.setCapability(optionKey, APP_CONFIGURATION.get().appiumOptions.get(optionKey));
210+
for (var optionEntry : APP_CONFIGURATION.get().appiumOptions.entrySet()) {
211+
chromeOptions.setCapability(optionEntry.getKey(), optionEntry.getValue());
212212
}
213213
}
214214

215215
private static <TOption extends MutableCapabilities> void addCustomDriverOptions(TOption mobileOptions) {
216-
for (var optionKey : CUSTOM_DRIVER_OPTIONS.get().keySet()) {
217-
mobileOptions.setCapability(optionKey, CUSTOM_DRIVER_OPTIONS.get().get(optionKey));
218-
}
216+
getCustomDriverOptions().forEach(mobileOptions::setCapability);
219217
}
220218

221219
public static void close() {
@@ -225,7 +223,7 @@ public static void close() {
225223

226224
if (WRAPPED_ANDROID_DRIVER.get() != null) {
227225
WRAPPED_ANDROID_DRIVER.get().quit();
228-
CUSTOM_DRIVER_OPTIONS.get().clear();
226+
// CUSTOM_DRIVER_OPTIONS.get().clear();
229227
}
230228

231229
DISPOSED.set(true);

0 commit comments

Comments
 (0)