How to use toSafeBoolean method of io.appium.java_client.internal.CapabilityHelpers class

Best io.appium code snippet using io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean

Run io.appium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

SupportsShowServerLogsOption.java

Source: SupportsShowServerLogsOption.java Github

copy
1/*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * See the NOTICE file distributed with this work for additional
5 * information regarding copyright ownership.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package io.appium.java_client.mac.options;
18
19import io.appium.java_client.remote.options.BaseOptions;
20import io.appium.java_client.remote.options.CanSetCapability;
21import org.openqa.selenium.Capabilities;
22
23import java.util.Optional;
24
25import static io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean;
26
27public interface SupportsShowServerLogsOption<T extends BaseOptions<T>> extends
28        Capabilities, CanSetCapability<T> {
29    String SHOW_SERVER_LOGS_OPTION = "showServerLogs";
30
31    /**
32     * Enforce showing of WDA server logs in the Appium log..
33     *
34     * @return self instance for chaining.
35     */
36    default T showServerLogs() {
37        return amend(SHOW_SERVER_LOGS_OPTION, true);
38    }
39
40    /**
41     * Set it to true in order to include xcodebuild output to the Appium
42     * server log. false by default.
43     *
44     * @param value Whether to show WDA server logs in the Appium log.
45     * @return self instance for chaining.
46     */
47    default T setShowServerLogs(boolean value) {
48        return amend(SHOW_SERVER_LOGS_OPTION, value);
49    }
50
51    /**
52     * Get whether to show WDA server logs in the Appium log.
53     *
54     * @return True or false.
55     */
56    default Optional<Boolean> doesShowServerLogs() {
57        return Optional.ofNullable(toSafeBoolean(getCapability(SHOW_SERVER_LOGS_OPTION)));
58    }
59}
60
Full Screen

SupportsShowIosLogOption.java

Source: SupportsShowIosLogOption.java Github

copy
1/*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * See the NOTICE file distributed with this work for additional
5 * information regarding copyright ownership.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package io.appium.java_client.ios.options.other;
18
19import io.appium.java_client.remote.options.BaseOptions;
20import io.appium.java_client.remote.options.CanSetCapability;
21import org.openqa.selenium.Capabilities;
22
23import java.util.Optional;
24
25import static io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean;
26
27public interface SupportsShowIosLogOption<T extends BaseOptions<T>> extends
28        Capabilities, CanSetCapability<T> {
29    String SHOW_IOS_LOG_OPTION = "showIOSLog";
30
31    /**
32     * Enforces showing any logs captured from a device in the appium logs.
33     *
34     * @return self instance for chaining.
35     */
36    default T showIosLog() {
37        return amend(SHOW_IOS_LOG_OPTION, true);
38    }
39
40    /**
41     * Whether to show any logs captured from a device in the appium logs.
42     * Default false.
43     *
44     * @param value Whether to show any logs captured from a device in the appium logs.
45     * @return self instance for chaining.
46     */
47    default T setShowIosLog(boolean value) {
48        return amend(SHOW_IOS_LOG_OPTION, value);
49    }
50
51    /**
52     * Get whether to show any logs captured from a device in the appium logs.
53     *
54     * @return True or false.
55     */
56    default Optional<Boolean> doesShowIosLog() {
57        return Optional.ofNullable(toSafeBoolean(getCapability(SHOW_IOS_LOG_OPTION)));
58    }
59}
60
Full Screen

SupportsAllowDelayAdbOption.java

Source: SupportsAllowDelayAdbOption.java Github

copy
1/*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * See the NOTICE file distributed with this work for additional
5 * information regarding copyright ownership.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package io.appium.java_client.android.options.adb;
18
19import io.appium.java_client.remote.options.BaseOptions;
20import io.appium.java_client.remote.options.CanSetCapability;
21import org.openqa.selenium.Capabilities;
22
23import java.util.Optional;
24
25import static io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean;
26
27public interface SupportsAllowDelayAdbOption<T extends BaseOptions<T>> extends
28        Capabilities, CanSetCapability<T> {
29    String ALLOW_DELAY_ADB_OPTION = "allowDelayAdb";
30
31    /**
32     * Being set to false prevents emulator to use -delay-adb feature to detect its startup.
33     * See https://github.com/appium/appium/issues/14773 for more details.
34     *
35     * @param value Set it to false in order to prevent the emulator to use -delay-adb feature.
36     * @return self instance for chaining.
37     */
38    default T setAllowDelayAdb(boolean value) {
39        return amend(ALLOW_DELAY_ADB_OPTION, value);
40    }
41
42    /**
43     * Get whether to prevent the emulator to use -delay-adb feature.
44     *
45     * @return True or false.
46     */
47    default Optional<Boolean> doesAllowDelayAdb() {
48        return Optional.ofNullable(toSafeBoolean(getCapability(ALLOW_DELAY_ADB_OPTION)));
49    }
50}
51
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Most used method in CapabilityHelpers

Trigger toSafeBoolean code on LambdaTest Cloud Grid

Execute automation tests with toSafeBoolean on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)