Skip to content
Merged
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 @@ -20,7 +20,7 @@
import io.appium.java_client.remote.options.CanSetCapability;
import org.openqa.selenium.Capabilities;

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

public interface SupportsEnvironmentOption<T extends BaseOptions<T>> extends
Expand All @@ -33,20 +33,20 @@ public interface SupportsEnvironmentOption<T extends BaseOptions<T>> extends
* the parent process. This capability is only going to be applied if the application
* is not running on session startup.
*
* @param arguments E.g. ["--help"].
* @param env E.g. ["--help"].
* @return self instance for chaining.
*/
default T setEnvironment(List<String> arguments) {
return amend(ENVIRONMENT_OPTION, arguments);
default T setEnvironment(Map<String, String> env) {
return amend(ENVIRONMENT_OPTION, env);
}

/**
* Get the application environment variables mapping.
*
* @return Application environment mapping.
*/
default Optional<List<String>> getEnvironment() {
default Optional<Map<String, String>> getEnvironment() {
//noinspection unchecked
return Optional.ofNullable((List<String>) getCapability(ENVIRONMENT_OPTION));
return Optional.ofNullable((Map<String, String>) getCapability(ENVIRONMENT_OPTION));
}
}