/** * This method will grab the app path from the config and install the app on the attached iOS * device. Please make sure the appPath is accessible by the appium server. * * <p>Please make sure to set the app path using the setApp method. */ public void installApp() { if (desired.getCapability("app") != null) { this.installApp(desired.getCapability("app").toString()); } else { logger.error("You have to supply the app parameter before calling the install app."); } }
private void setSafely(DesiredCapabilities caps, String key, Object value) { if (value == null || caps.getCapability(key) != null) { return; } caps.setCapability(key, value); }
@Test public void shouldCreateDesiredCapabilitiesFromPropertiesFile() throws IOException { Properties prop = new Properties(); prop.setProperty("abc", "def"); prop.setProperty("123", "098"); DesiredCapabilitiesFromPropertyFileProvider dcp = new DesiredCapabilitiesFromPropertyFileProvider(); dcp.properties = prop; DesiredCapabilities dc = dcp.provide(); assertEquals("def", dc.getCapability("abc")); assertEquals("098", dc.getCapability("123")); }