Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@
import io.appium.java_client.ios.options.wda.SupportsWdaStartupRetryIntervalOption;
import io.appium.java_client.ios.options.wda.SupportsWebDriverAgentUrlOption;
import io.appium.java_client.ios.options.wda.SupportsXcodeCertificateOptions;
import io.appium.java_client.ios.options.webview.SupportsAbsoluteWebLocationsOption;
import io.appium.java_client.ios.options.webview.SupportsAdditionalWebviewBundleIdsOption;
import io.appium.java_client.ios.options.webview.SupportsEnableAsyncExecuteFromHttpsOption;
import io.appium.java_client.ios.options.webview.SupportsFullContextListOption;
import io.appium.java_client.ios.options.webview.SupportsIncludeSafariInWebviewsOption;
import io.appium.java_client.ios.options.webview.SupportsNativeWebTapOption;
import io.appium.java_client.ios.options.webview.SupportsNativeWebTapStrictOption;
import io.appium.java_client.ios.options.webview.SupportsSafariAllowPopupsOption;
import io.appium.java_client.ios.options.webview.SupportsSafariGarbageCollectOption;
import io.appium.java_client.ios.options.webview.SupportsSafariIgnoreFraudWarningOption;
import io.appium.java_client.ios.options.webview.SupportsSafariIgnoreWebHostnamesOption;
import io.appium.java_client.ios.options.webview.SupportsSafariInitialUrlOption;
import io.appium.java_client.ios.options.webview.SupportsSafariLogAllCommunicationHexDumpOption;
import io.appium.java_client.ios.options.webview.SupportsSafariLogAllCommunicationOption;
import io.appium.java_client.ios.options.webview.SupportsSafariOpenLinksInBackgroundOption;
import io.appium.java_client.ios.options.webview.SupportsSafariSocketChunkSizeOption;
import io.appium.java_client.ios.options.webview.SupportsSafariWebInspectorMaxFrameLengthOption;
import io.appium.java_client.ios.options.webview.SupportsWebviewConnectRetriesOption;
import io.appium.java_client.ios.options.webview.SupportsWebviewConnectTimeoutOption;
import io.appium.java_client.remote.AutomationName;
import io.appium.java_client.remote.MobilePlatform;
import io.appium.java_client.remote.options.BaseOptions;
Expand Down Expand Up @@ -164,9 +183,28 @@ public class XCUITestOptions extends BaseOptions<XCUITestOptions> implements
SupportsSimulatorPasteboardAutomaticSyncOption<XCUITestOptions>,
SupportsSimulatorDevicesSetPathOption<XCUITestOptions>,
SupportsCustomSslCertOption<XCUITestOptions>,
SupportsWebkitResponseTimeoutOption<XCUITestOptions>,
// TODO: Web context options: https://github.com/appium/appium-xcuitest-driver#web-context
// Web context options: https://github.com/appium/appium-xcuitest-driver#web-context
SupportsAutoWebViewOption<XCUITestOptions>,
SupportsAbsoluteWebLocationsOption<XCUITestOptions>,
SupportsSafariGarbageCollectOption<XCUITestOptions>,
SupportsIncludeSafariInWebviewsOption<XCUITestOptions>,
SupportsSafariLogAllCommunicationOption<XCUITestOptions>,
SupportsSafariLogAllCommunicationHexDumpOption<XCUITestOptions>,
SupportsSafariSocketChunkSizeOption<XCUITestOptions>,
SupportsSafariWebInspectorMaxFrameLengthOption<XCUITestOptions>,
SupportsAdditionalWebviewBundleIdsOption<XCUITestOptions>,
SupportsWebviewConnectTimeoutOption<XCUITestOptions>,
SupportsSafariIgnoreWebHostnamesOption<XCUITestOptions>,
SupportsNativeWebTapOption<XCUITestOptions>,
SupportsNativeWebTapStrictOption<XCUITestOptions>,
SupportsSafariInitialUrlOption<XCUITestOptions>,
SupportsSafariAllowPopupsOption<XCUITestOptions>,
SupportsSafariIgnoreFraudWarningOption<XCUITestOptions>,
SupportsSafariOpenLinksInBackgroundOption<XCUITestOptions>,
SupportsWebviewConnectRetriesOption<XCUITestOptions>,
SupportsWebkitResponseTimeoutOption<XCUITestOptions>,
SupportsEnableAsyncExecuteFromHttpsOption<XCUITestOptions>,
SupportsFullContextListOption<XCUITestOptions>,
// TODO: Other options: https://github.com/appium/appium-xcuitest-driver#other
SupportsClearSystemFilesOption<XCUITestOptions>,
SupportsEnablePerformanceLoggingOption<XCUITestOptions> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.ios.options.webview;

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 SupportsAbsoluteWebLocationsOption<T extends BaseOptions<T>> extends
Capabilities, CanSetCapability<T> {
String ABSOLUTE_WEB_LOCATIONS_OPTION = "absoluteWebLocations";

/**
* Enforces Get Element Location to return coordinates
* relative to the page origin for web view elements.
*
* @return self instance for chaining.
*/
default T absoluteWebLocations() {
return amend(ABSOLUTE_WEB_LOCATIONS_OPTION, true);
}

/**
* This capability will direct the Get Element Location command, when used
* within webviews, to return coordinates which are relative to the origin of
* the page, rather than relative to the current scroll offset. This capability
* has no effect outside of webviews. Default false.
*
* @param value Whether to return coordinates relative to the page origin for web view elements.
* @return self instance for chaining.
*/
default T setAbsoluteWebLocations(boolean value) {
return amend(ABSOLUTE_WEB_LOCATIONS_OPTION, value);
}

/**
* Get whether Get Element Location returns coordinates
* relative to the page origin for web view elements.
*
* @return True or false.
*/
default Optional<Boolean> doesAbsoluteWebLocations() {
return Optional.ofNullable(toSafeBoolean(getCapability(ABSOLUTE_WEB_LOCATIONS_OPTION)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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.ios.options.webview;

import io.appium.java_client.remote.options.BaseOptions;
import io.appium.java_client.remote.options.CanSetCapability;
import org.openqa.selenium.Capabilities;

import java.util.List;
import java.util.Optional;

public interface SupportsAdditionalWebviewBundleIdsOption<T extends BaseOptions<T>> extends
Capabilities, CanSetCapability<T> {
String ADDITIONAL_WEBVIEW_BUNDLE_IDS_OPTION = "additionalWebviewBundleIds";

/**
* Array of possible bundle identifiers for webviews. This is sometimes
* necessary if the Web Inspector is found to be returning a modified
* bundle identifier for the app. Defaults to [].
*
* @param identifiers Identifiers list.
* @return self instance for chaining.
*/
default T setAdditionalWebviewBundleIds(List<String> identifiers) {
return amend(ADDITIONAL_WEBVIEW_BUNDLE_IDS_OPTION, identifiers);
}

/**
* Get the array of possible bundle identifiers for webviews.
*
* @return Identifier list.
*/
default Optional<List<String>> getAdditionalWebviewBundleIds() {
//noinspection unchecked
return Optional.ofNullable(
(List<String>) getCapability(ADDITIONAL_WEBVIEW_BUNDLE_IDS_OPTION)
);
}
}
Original file line number Diff line number Diff line change
@@ -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.ios.options.webview;

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 SupportsEnableAsyncExecuteFromHttpsOption<T extends BaseOptions<T>> extends
Capabilities, CanSetCapability<T> {
String ENABLE_ASYNC_EXECUTE_FROM_HTTPS_OPTION = "enableAsyncExecuteFromHttps";

/**
* Enforces to allow simulators to execute async JavaScript on pages using HTTPS.
*
* @return self instance for chaining.
*/
default T enableAsyncExecuteFromHttps() {
return amend(ENABLE_ASYNC_EXECUTE_FROM_HTTPS_OPTION, true);
}

/**
* Capability to allow simulators to execute asynchronous JavaScript
* on pages using HTTPS. Defaults to false.
*
* @param value Whether to allow simulators to execute async JavaScript on pages using HTTPS.
* @return self instance for chaining.
*/
default T setEnableAsyncExecuteFromHttps(boolean value) {
return amend(ENABLE_ASYNC_EXECUTE_FROM_HTTPS_OPTION, value);
}

/**
* Get whether to allow simulators to execute async JavaScript on pages using HTTPS.
*
* @return True or false.
*/
default Optional<Boolean> doesEnableAsyncExecuteFromHttps() {
return Optional.ofNullable(toSafeBoolean(getCapability(ENABLE_ASYNC_EXECUTE_FROM_HTTPS_OPTION)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.ios.options.webview;

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 SupportsFullContextListOption<T extends BaseOptions<T>> extends
Capabilities, CanSetCapability<T> {
String FULL_CONTEXT_LIST_OPTION = "fullContextList";

/**
* Enforces to return the detailed information on contexts for the get available
* context command.
*
* @return self instance for chaining.
*/
default T fullContextList() {
return amend(FULL_CONTEXT_LIST_OPTION, true);
}

/**
* Sets to return the detailed information on contexts for the get available
* context command. If this capability is enabled, then each item in the returned
* contexts list would additionally include WebView title, full URL and the bundle
* identifier. Defaults to false.
*
* @param value Whether to return the detailed info on available context command.
* @return self instance for chaining.
*/
default T setFullContextList(boolean value) {
return amend(FULL_CONTEXT_LIST_OPTION, value);
}

/**
* Get whether to return the detailed information on contexts for the get available
* context command.
*
* @return True or false.
*/
default Optional<Boolean> doesFullContextList() {
return Optional.ofNullable(toSafeBoolean(getCapability(FULL_CONTEXT_LIST_OPTION)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* 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.ios.options.webview;

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 SupportsIncludeSafariInWebviewsOption<T extends BaseOptions<T>> extends
Capabilities, CanSetCapability<T> {
String INCLUDE_SAFARI_IN_WEBVIEWS_OPTION = "includeSafariInWebviews";

/**
* Enforces Safari web views to be added to the list of contexts available
* during a native/webview app test.
*
* @return self instance for chaining.
*/
default T includeSafariInWebviews() {
return amend(INCLUDE_SAFARI_IN_WEBVIEWS_OPTION, true);
}

/**
* Add Safari web contexts to the list of contexts available during a
* native/webview app test. This is useful if the test opens Safari and
* needs to be able to interact with it. Defaults to false.
*
* @param value Whether to add Safari to the list of contexts available during a native/webview app test.
* @return self instance for chaining.
*/
default T setIncludeSafariInWebviews(boolean value) {
return amend(INCLUDE_SAFARI_IN_WEBVIEWS_OPTION, value);
}

/**
* Get whether to add Safari web views to the list of contexts available
* during a native/webview app test.
*
* @return True or false.
*/
default Optional<Boolean> doesIncludeSafariInWebviews() {
return Optional.ofNullable(toSafeBoolean(getCapability(INCLUDE_SAFARI_IN_WEBVIEWS_OPTION)));
}
}
Loading