Skip to content

Commit d2379c7

Browse files
committed
fix method redundancy
1 parent 3a8f0c6 commit d2379c7

File tree

1 file changed

+3
-7
lines changed
  • bellatrix.android/src/main/java/solutions/bellatrix/android/infrastructure

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ private static AndroidDriver initializeDriverGridMode(GridSettings gridSettings,
9494
options.put(MobileCapabilityType.PLATFORM_NAME, "Android");
9595
options.put(MobileCapabilityType.PLATFORM_VERSION, getAppConfiguration().getAndroidVersion());
9696
options.put(MobileCapabilityType.DEVICE_NAME, getAppConfiguration().getDeviceName());
97-
getCustomDriverOptions().forEach(caps::setCapability);
9897

9998
if (getAppConfiguration().getIsMobileWebExecution()) {
10099
options.put(MobileCapabilityType.BROWSER_NAME, ConfigurationService.get(AndroidSettings.class).getDefaultBrowser());
@@ -125,7 +124,6 @@ private static AndroidDriver initializeDriverRegularMode(String serviceUrl) {
125124
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
126125
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, getAppConfiguration().getAndroidVersion());
127126
caps.setCapability(MobileCapabilityType.DEVICE_NAME, getAppConfiguration().getDeviceName());
128-
getCustomDriverOptions().forEach(caps::setCapability);
129127

130128
if (getAppConfiguration().getIsMobileWebExecution()) {
131129
caps.setCapability(MobileCapabilityType.BROWSER_NAME, ConfigurationService.get(AndroidSettings.class).getDefaultBrowser());
@@ -209,15 +207,13 @@ private static String getBuildName() {
209207
}
210208

211209
private static <TOption extends MutableCapabilities> void addDriverConfigOptions(TOption chromeOptions) {
212-
for (var optionKey : APP_CONFIGURATION.get().appiumOptions.keySet()) {
213-
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());
214212
}
215213
}
216214

217215
private static <TOption extends MutableCapabilities> void addCustomDriverOptions(TOption mobileOptions) {
218-
for (var optionKey : CUSTOM_DRIVER_OPTIONS.get().keySet()) {
219-
mobileOptions.setCapability(optionKey, CUSTOM_DRIVER_OPTIONS.get().get(optionKey));
220-
}
216+
getCustomDriverOptions().forEach(mobileOptions::setCapability);
221217
}
222218

223219
public static void close() {

0 commit comments

Comments
 (0)