final String URL_STRING = "http://0.0.0.0:4723/wd/hub";
regBase.url = new URL(URL_STRING);
regBase.capabilities = new DesiredCapabilities();
regBase.capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "***");
regBase.capabilities.setCapability(MobileCapabilityType.UDID, "*******");
regBase.capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
regBase.capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "12.4");
regBase.capabilities.setCapability(MobileCapabilityType.APP, "/Users/*******");
regBase.capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
regBase.capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
regBase.capabilities.setCapability("useNewWDA", true);
regBase.capabilities.setCapability("xcodeOrgId", "*******");
regBase.capabilities.setCapability("xcodeSigningId", "iPhone Developer");
regBase.capabilities.setCapability("agentPath", "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj");
regBase.capabilities.setCapability("bootstrapPath", "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent");
regBase.capabilities.setCapability("updatedWDABundleId", "*********");
regBase.capabilities.setCapability(IOSMobileCapabilityType.AUTO_ACCEPT_ALERTS, false); // True will auto accept
regBase.iosDriver = new IOSDriver<IOSElement>(regBase.url, regBase.capabilities);
regBase.iosDriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
Thread.sleep(10000);
// Инициализация ios фабрики страниц:
import io.appium.java_client.ios.IOSDriver; import io.appium.java_client.ios.IOSElement;
public class IOSPageFactory {
public IOSPageFactory(IOSDriver<IOSElement> driver) {
this.driver = driver;
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}
@iOSXCUITFindBy (xpath = "//XCUIElementTypeButton[@name='SIGN IN']")
public static WebElement YellowSignIn1;