All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.seleniumtests.browserfactory.ICloudCapabilityFactory Maven / Gradle / Ivy

There is a newer version: 4.23.18
Show newest version
package com.seleniumtests.browserfactory;

import org.openqa.selenium.MutableCapabilities;

import com.seleniumtests.driver.DriverConfig;

import io.appium.java_client.remote.MobileCapabilityType;

public abstract class ICloudCapabilityFactory extends ICapabilitiesFactory {

	protected static final String ANDROID_PLATFORM = "android";
	protected static final String IOS_PLATFORM = "ios";
	protected static final String NO_APP_UPLOAD = "NO_UPLOAD:";

	protected ICloudCapabilityFactory(DriverConfig webDriverConfig) {
		super(webDriverConfig);
	}
	
	/**
	 * Do we upload application ?
	 * It depends on "NO_UPLOAD:" prefix in path
	 * Application path is changed accordingly
	 * @param capabilities
	 * @return
	 */
	protected boolean isUploadApp(MutableCapabilities capabilities) {
		boolean uploadApp = !((String) capabilities.getCapability(MobileCapabilityType.APP)).startsWith(NO_APP_UPLOAD);
		if (!uploadApp) {
			capabilities.setCapability(MobileCapabilityType.APP, ((String) capabilities.getCapability(MobileCapabilityType.APP)).replace(NO_APP_UPLOAD, ""));
		}
		
		return uploadApp;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy