use of io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException 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 io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException 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 io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException in project java-client by appium.
the class UIAutomator2Test 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.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);
driver = new AndroidDriver<>(service.getUrl(), capabilities);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
use of io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException in project java-client by appium.
the class IOSTest 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_NAME, MobilePlatform.IOS);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.2");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
// sometimes environment has performance problems
capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new AppiumDriver<>(service.getUrl(), capabilities);
}
use of io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException in project java-client by appium.
the class UICatalogIOSTest 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, "UICatalog.app.zip");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.2");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
// sometimes environment has performance problems
capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
driver = new IOSDriver<>(service.getUrl(), capabilities);
}
Aggregations