use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.
the class AndroidTest method beforeClass.
/**
* initialization.
*/
@BeforeClass
public static void beforeClass() {
service = AppiumDriverLocalService.buildDefaultService();
service.start();
if (service == null || !service.isRunning()) {
throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
}
File appDir = new File("src/test/java/io/appium/java_client");
File app = new File(appDir, "ApiDemos-debug.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new AppiumDriver<>(service.getUrl(), capabilities);
}
use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.
the class BaseAndroidTest method beforeClass.
/**
* initialization.
*/
@BeforeClass
public static void beforeClass() {
service = AppiumDriverLocalService.buildDefaultService();
service.start();
if (service == null || !service.isRunning()) {
throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
}
File appDir = new File("src/test/java/io/appium/java_client");
File app = new File(appDir, "ApiDemos-debug.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new AndroidDriver<>(service.getUrl(), capabilities);
}
use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.
the class FingerPrintTest method initDriver.
private static void initDriver() {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability("appPackage", "com.android.settings");
capabilities.setCapability("appActivity", "Settings");
driver = new AndroidDriver<>(service.getUrl(), capabilities);
driver.manage().timeouts().implicitlyWait(15, SECONDS);
}
use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.
the class AppXCUITTest method beforeClass.
/**
* initialization.
*/
@BeforeClass
public static void beforeClass() {
service = AppiumDriverLocalService.buildDefaultService();
service.start();
if (service == null || !service.isRunning()) {
throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
}
File appDir = new File("src/test/java/io/appium/java_client");
File app = new File(appDir, "TestApp.app.zip");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.1");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6");
capabilities.setCapability(IOSMobileCapabilityType.ALLOW_TOUCHID_ENROLL, "true");
// sometimes environment has performance problems
capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new IOSDriver<>(service.getUrl(), capabilities);
}
use of org.openqa.selenium.remote.DesiredCapabilities in project java-client by appium.
the class BaseIOSWebViewTest method beforeClass.
@BeforeClass
public static void beforeClass() {
service = AppiumDriverLocalService.buildDefaultService();
service.start();
if (service == null || !service.isRunning()) {
throw new AppiumServerHasNotBeenStartedLocallyException("An appium server node is not started!");
}
File appDir = new File("src/test/java/io/appium/java_client");
File app = new File(appDir, "WebViewApp.app.zip");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.2");
// sometimes environment has performance problems
capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new IOSDriver<>(service.getUrl(), capabilities);
}
Aggregations