diff --git a/src/main/java/io/appium/java_client/android/options/app/ActivityOptions.java b/src/main/java/io/appium/java_client/android/options/app/ActivityOptions.java index e0cc553a0..de328149f 100644 --- a/src/main/java/io/appium/java_client/android/options/app/ActivityOptions.java +++ b/src/main/java/io/appium/java_client/android/options/app/ActivityOptions.java @@ -16,7 +16,7 @@ package io.appium.java_client.android.options.app; -import io.appium.java_client.android.options.BaseMapOptionData; +import io.appium.java_client.remote.options.BaseMapOptionData; import java.util.Map; import java.util.Optional; diff --git a/src/main/java/io/appium/java_client/android/options/app/IntentOptions.java b/src/main/java/io/appium/java_client/android/options/app/IntentOptions.java index 2ba619aac..e651a4b91 100644 --- a/src/main/java/io/appium/java_client/android/options/app/IntentOptions.java +++ b/src/main/java/io/appium/java_client/android/options/app/IntentOptions.java @@ -16,7 +16,7 @@ package io.appium.java_client.android.options.app; -import io.appium.java_client.android.options.BaseMapOptionData; +import io.appium.java_client.remote.options.BaseMapOptionData; import java.util.List; import java.util.Map; diff --git a/src/main/java/io/appium/java_client/android/options/localization/AppLocale.java b/src/main/java/io/appium/java_client/android/options/localization/AppLocale.java index d7d0209d0..f8f0147f7 100644 --- a/src/main/java/io/appium/java_client/android/options/localization/AppLocale.java +++ b/src/main/java/io/appium/java_client/android/options/localization/AppLocale.java @@ -16,10 +16,8 @@ package io.appium.java_client.android.options.localization; -import io.appium.java_client.android.options.BaseMapOptionData; +import io.appium.java_client.remote.options.BaseMapOptionData; -import java.util.Collections; -import java.util.HashMap; import java.util.Map; import java.util.Optional; diff --git a/src/main/java/io/appium/java_client/android/options/BaseMapOptionData.java b/src/main/java/io/appium/java_client/remote/options/BaseMapOptionData.java similarity index 96% rename from src/main/java/io/appium/java_client/android/options/BaseMapOptionData.java rename to src/main/java/io/appium/java_client/remote/options/BaseMapOptionData.java index ce473a607..004d1bdf5 100644 --- a/src/main/java/io/appium/java_client/android/options/BaseMapOptionData.java +++ b/src/main/java/io/appium/java_client/remote/options/BaseMapOptionData.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.appium.java_client.android.options; +package io.appium.java_client.remote.options; import com.google.gson.GsonBuilder; @@ -24,7 +24,7 @@ import java.util.Optional; public abstract class BaseMapOptionData> { - protected Map options; + private Map options; public BaseMapOptionData() { } diff --git a/src/main/java/io/appium/java_client/windows/options/RunScript.java b/src/main/java/io/appium/java_client/windows/options/RunScript.java new file mode 100644 index 000000000..e31fa38fc --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/RunScript.java @@ -0,0 +1,69 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseMapOptionData; + +import java.util.Map; +import java.util.Optional; + +public class RunScript extends BaseMapOptionData { + public RunScript() { + } + + public RunScript(Map options) { + super(options); + } + + /** + * Allows to provide a multiline PowerShell script. + * + * @param script A valid PowerShell script. + * @return self instance for chaining. + */ + public RunScript withScript(String script) { + return assignOptionValue("script", script); + } + + /** + * Get a multiline PowerShell script. + * + * @return PowerShell script. + */ + public Optional getScript() { + return getOptionValue("script"); + } + + /** + * Allows to provide a single-line PowerShell script. + * + * @param command A valid PowerShell script. + * @return self instance for chaining. + */ + public RunScript withCommand(String command) { + return assignOptionValue("command", command); + } + + /** + * Get a single-line PowerShell script. + * + * @return PowerShell script. + */ + public Optional getCommand() { + return getOptionValue("command"); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsAppArgumentsOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsAppArgumentsOption.java new file mode 100644 index 000000000..e5a8f55c3 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsAppArgumentsOption.java @@ -0,0 +1,48 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.net.URL; +import java.util.Optional; + +public interface SupportsAppArgumentsOption> extends + Capabilities, CanSetCapability { + String APP_ARGUMENTS_OPTION = "appArguments"; + + /** + * Application arguments string. + * + * @param args E.g. "/?" + * @return self instance for chaining. + */ + default T setAppArguments(String args) { + return amend(APP_ARGUMENTS_OPTION, args); + } + + /** + * Get application arguments. + * + * @return Application arguments. + */ + default Optional setAppArguments() { + return Optional.ofNullable((String) getCapability(APP_ARGUMENTS_OPTION)); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsAppTopLevelWindowOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsAppTopLevelWindowOption.java new file mode 100644 index 000000000..8490398f1 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsAppTopLevelWindowOption.java @@ -0,0 +1,50 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.util.Optional; + +public interface SupportsAppTopLevelWindowOption> extends + Capabilities, CanSetCapability { + String APP_TOP_LEVEL_WINDOW_OPTION = "appTopLevelWindow"; + + /** + * Set the hexadecimal handle of an existing application top level + * window to attach to, for example 0x12345 (should be of string type). + * Either this capability or app one must be provided on session startup. + * + * @param identifier E.g. "0x12345". + * @return self instance for chaining. + */ + default T setAppTopLevelWindow(String identifier) { + return amend(APP_TOP_LEVEL_WINDOW_OPTION, identifier); + } + + /** + * Get the hexadecimal handle of an existing application top level + * window to attach to. + * + * @return Top level window handle. + */ + default Optional getAppTopLevelWindow() { + return Optional.ofNullable((String) getCapability(APP_TOP_LEVEL_WINDOW_OPTION)); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsAppWorkingDirOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsAppWorkingDirOption.java new file mode 100644 index 000000000..bc3e1e074 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsAppWorkingDirOption.java @@ -0,0 +1,49 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.util.Optional; + +public interface SupportsAppWorkingDirOption> extends + Capabilities, CanSetCapability { + String APP_WORKING_DIR_OPTION = "appWorkingDir"; + + /** + * Full path to the folder, which is going to be set as the working + * dir for the application under test. This is only applicable for classic apps. + * + * @param path Existing folder path on the server file system. + * @return self instance for chaining. + */ + default T setAppWorkingDir(String path) { + return amend(APP_WORKING_DIR_OPTION, path); + } + + /** + * Get the full path to the folder, which is going to be set as the working + * dir for the application under test. + * + * @return Folder path on the server file system. + */ + default Optional getAppWorkingDir() { + return Optional.ofNullable((String) getCapability(APP_WORKING_DIR_OPTION)); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsCreateSessionTimeoutOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsCreateSessionTimeoutOption.java new file mode 100644 index 000000000..334209fe8 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsCreateSessionTimeoutOption.java @@ -0,0 +1,55 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.time.Duration; +import java.util.Optional; + +import static io.appium.java_client.internal.CapabilityHelpers.toDuration; + +public interface SupportsCreateSessionTimeoutOption> extends + Capabilities, CanSetCapability { + String CREATE_SESSION_TIMEOUT_OPTION = "createSessionTimeout"; + + /** + * Set the timeout used to retry Appium Windows Driver session startup. + * This capability could be used as a workaround for the long startup times + * of UWP applications (aka Failed to locate opened application window + * with appId: TestCompany.my_app4!App, and processId: 8480). Default value is 20000ms. + * + * @param timeout The timeout value. + * @return self instance for chaining. + */ + default T setCreateSessionTimeout(Duration timeout) { + return amend(CREATE_SESSION_TIMEOUT_OPTION, timeout.toMillis()); + } + + /** + * Get the timeout used to retry Appium Windows Driver session startup. + * + * @return The timeout value. + */ + default Optional getCreateSessionTimeout() { + return Optional.ofNullable( + toDuration(getCapability(CREATE_SESSION_TIMEOUT_OPTION)) + ); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsMsExperimentalWebDriverOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsMsExperimentalWebDriverOption.java new file mode 100644 index 000000000..a4415707a --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsMsExperimentalWebDriverOption.java @@ -0,0 +1,59 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.util.Optional; + +import static io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean; + +public interface SupportsMsExperimentalWebDriverOption> extends + Capabilities, CanSetCapability { + String MS_EXPERIMENTAL_WEBDRIVER_OPTION = "ms:experimental-webdriver"; + + /** + * Enforce to enable experimental driver features and optimizations. + * + * @return self instance for chaining. + */ + default T experimentalWebDriver() { + return amend(MS_EXPERIMENTAL_WEBDRIVER_OPTION, true); + } + + /** + * Enables experimental features and optimizations. See Appium Windows + * Driver release notes for more details on this capability. false by default. + * + * @param value Whether to enable experimental features and optimizations. + * @return self instance for chaining. + */ + default T setExperimentalWebDriver(boolean value) { + return amend(MS_EXPERIMENTAL_WEBDRIVER_OPTION, value); + } + + /** + * Get whether to enable experimental features and optimizations. + * + * @return True or false. + */ + default Optional isExperimentalWebDriver() { + return Optional.ofNullable(toSafeBoolean(getCapability(MS_EXPERIMENTAL_WEBDRIVER_OPTION))); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsMsWaitForAppLaunchOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsMsWaitForAppLaunchOption.java new file mode 100644 index 000000000..2066616ce --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsMsWaitForAppLaunchOption.java @@ -0,0 +1,55 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.time.Duration; +import java.util.Optional; + +import static io.appium.java_client.internal.CapabilityHelpers.toDuration; + +public interface SupportsMsWaitForAppLaunchOption> extends + Capabilities, CanSetCapability { + String MS_WAIT_FOR_APP_LAUNCH_OPTION = "ms:waitForAppLaunch"; + + /** + * Similar to createSessionTimeout, but is + * applied on the server side. Enables Appium Windows Driver to wait for + * a defined amount of time after an app launch is initiated prior to + * attaching to the application session. The limit for this is 50 seconds. + * + * @param timeout The timeout value. + * @return self instance for chaining. + */ + default T setWaitForAppLaunch(Duration timeout) { + return amend(MS_WAIT_FOR_APP_LAUNCH_OPTION, timeout.getSeconds()); + } + + /** + * Get the timeout used to retry Appium Windows Driver session startup. + * + * @return The timeout value. + */ + default Optional doesWaitForAppLaunch() { + return Optional.ofNullable( + toDuration(getCapability(MS_WAIT_FOR_APP_LAUNCH_OPTION), Duration::ofSeconds) + ); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsPostrunOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsPostrunOption.java new file mode 100644 index 000000000..b766820c3 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsPostrunOption.java @@ -0,0 +1,55 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.util.Map; +import java.util.Optional; + +public interface SupportsPostrunOption> extends + Capabilities, CanSetCapability { + String POSTRUN_OPTION = "postrun"; + + /** + * An object containing either script or command key. The value of + * each key must be a valid PowerShell script or command to be + * executed after an WinAppDriver session is finished. + * See + * https://github.com/appium/appium-windows-driver#power-shell-commands-execution + * for more details. + * + * @param script E.g. {script: 'Get-Process outlook -ErrorAction SilentlyContinue'}. + * @return self instance for chaining. + */ + default T setPostrun(RunScript script) { + return amend(POSTRUN_OPTION, script.toMap()); + } + + /** + * Get the postrun script. + * + * @return Postrun script. + */ + default Optional getPostrun() { + //noinspection unchecked + return Optional.ofNullable(getCapability(POSTRUN_OPTION)) + .map((v) -> new RunScript((Map) v)); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsPrerunOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsPrerunOption.java new file mode 100644 index 000000000..d3722da48 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsPrerunOption.java @@ -0,0 +1,55 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.util.Map; +import java.util.Optional; + +public interface SupportsPrerunOption> extends + Capabilities, CanSetCapability { + String PRERUN_OPTION = "prerun"; + + /** + * An object containing either script or command key. The value of + * each key must be a valid PowerShell script or command to be + * executed prior to the WinAppDriver session startup. + * See + * https://github.com/appium/appium-windows-driver#power-shell-commands-execution + * for more details. + * + * @param script E.g. {script: 'Get-Process outlook -ErrorAction SilentlyContinue'}. + * @return self instance for chaining. + */ + default T setPrerun(RunScript script) { + return amend(PRERUN_OPTION, script.toMap()); + } + + /** + * Get the prerun script. + * + * @return Prerun script. + */ + default Optional getPrerun() { + //noinspection unchecked + return Optional.ofNullable(getCapability(PRERUN_OPTION)) + .map((v) -> new RunScript((Map) v)); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/SupportsSystemPortOption.java b/src/main/java/io/appium/java_client/windows/options/SupportsSystemPortOption.java new file mode 100644 index 000000000..65ab9fb31 --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/SupportsSystemPortOption.java @@ -0,0 +1,52 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.CanSetCapability; +import org.openqa.selenium.Capabilities; + +import java.util.Optional; + +import static io.appium.java_client.internal.CapabilityHelpers.toInteger; + +public interface SupportsSystemPortOption> extends + Capabilities, CanSetCapability { + String SYSTEM_PORT_OPTION = "systemPort"; + + /** + * The port number to execute Appium Windows Driver server listener on, + * for example 5556. The port must not be occupied. The default starting port + * number for a new Appium Windows Driver session is 4724. If this port is + * already busy then the next free port will be automatically selected. + * + * @param port port number in range 0..65535 + * @return self instance for chaining. + */ + default T setSystemPort(int port) { + return amend(SYSTEM_PORT_OPTION, port); + } + + /** + * Get the port number to execute Appium Windows Driver server listener on. + * + * @return System port value. + */ + default Optional getSystemPort() { + return Optional.ofNullable(toInteger(getCapability(SYSTEM_PORT_OPTION))); + } +} diff --git a/src/main/java/io/appium/java_client/windows/options/WindowsOptions.java b/src/main/java/io/appium/java_client/windows/options/WindowsOptions.java new file mode 100644 index 000000000..0d25a1ece --- /dev/null +++ b/src/main/java/io/appium/java_client/windows/options/WindowsOptions.java @@ -0,0 +1,59 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.appium.java_client.windows.options; + +import io.appium.java_client.remote.AutomationName; +import io.appium.java_client.remote.MobilePlatform; +import io.appium.java_client.remote.options.BaseOptions; +import io.appium.java_client.remote.options.SupportsAppOption; +import org.openqa.selenium.Capabilities; + +import java.util.Map; + +/** + * https://github.com/appium/appium-windows-driver#usage + */ +public class WindowsOptions extends BaseOptions implements + SupportsAppOption, + SupportsAppArgumentsOption, + SupportsAppTopLevelWindowOption, + SupportsAppWorkingDirOption, + SupportsCreateSessionTimeoutOption, + SupportsMsWaitForAppLaunchOption, + SupportsMsExperimentalWebDriverOption, + SupportsSystemPortOption, + SupportsPrerunOption, + SupportsPostrunOption { + public WindowsOptions() { + setCommonOptions(); + } + + public WindowsOptions(Capabilities source) { + super(source); + setCommonOptions(); + } + + public WindowsOptions(Map source) { + super(source); + setCommonOptions(); + } + + private void setCommonOptions() { + setPlatformName(MobilePlatform.WINDOWS); + setAutomationName(AutomationName.WINDOWS); + } +}