Search in sources :

Example 1 with AppiumFieldDecorator

use of io.appium.java_client.pagefactory.AppiumFieldDecorator in project java-client by appium.

the class IOSMobileBrowserCompatibilityTest method setUp.

/**
 * The setting up.
 */
@Before
public void setUp() {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.SAFARI);
    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);
    driver = new IOSDriver<>(service.getUrl(), capabilities);
    PageFactory.initElements(new AppiumFieldDecorator(driver, 5, TimeUnit.SECONDS), this);
}
Also used : AppiumFieldDecorator(io.appium.java_client.pagefactory.AppiumFieldDecorator) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Before(org.junit.Before)

Example 2 with AppiumFieldDecorator

use of io.appium.java_client.pagefactory.AppiumFieldDecorator in project java-client by appium.

the class DesktopBrowserCompatibilityTest method chromeTest.

@Test
public void chromeTest() {
    WebDriver driver = new ChromeDriver();
    try {
        PageFactory.initElements(new AppiumFieldDecorator(driver, 15, TimeUnit.SECONDS), this);
        driver.get(new File("src/test/java/io/appium/java_client/hello appium - saved page.htm").toURI().toString());
        assertNotEquals(0, foundLinks.size());
        assertNotEquals(0, main.size());
        assertEquals(null, trap1);
        assertEquals(null, trap2);
    } finally {
        driver.quit();
    }
}
Also used : WebDriver(org.openqa.selenium.WebDriver) AppiumFieldDecorator(io.appium.java_client.pagefactory.AppiumFieldDecorator) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver) ChromeDriverPathUtil.getChromeDriver(io.appium.java_client.ChromeDriverPathUtil.getChromeDriver) File(java.io.File) Test(org.junit.Test)

Example 3 with AppiumFieldDecorator

use of io.appium.java_client.pagefactory.AppiumFieldDecorator in project java-client by appium.

the class MobileBrowserCompatibilityTest method setUp.

/**
 * The setting up.
 */
@Before
public void setUp() {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.BROWSER);
    driver = new AndroidDriver<RemoteWebElement>(service.getUrl(), capabilities);
    // This time out is set because test can be run on slow Android SDK emulator
    PageFactory.initElements(new AppiumFieldDecorator(driver, 5, TimeUnit.SECONDS), this);
}
Also used : AppiumFieldDecorator(io.appium.java_client.pagefactory.AppiumFieldDecorator) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) RemoteWebElement(org.openqa.selenium.remote.RemoteWebElement) Before(org.junit.Before)

Example 4 with AppiumFieldDecorator

use of io.appium.java_client.pagefactory.AppiumFieldDecorator in project java-client by appium.

the class TimeoutTest method setUp.

/**
 * The setting up.
 */
@Before
public void setUp() {
    setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, getChromeDriver().getAbsolutePath());
    driver = new ChromeDriver();
    timeOutDuration = new TimeOutDuration(DEFAULT_TIMEOUT, DEFAULT_TIMEUNIT);
    initElements(new AppiumFieldDecorator(driver, timeOutDuration), this);
}
Also used : AppiumFieldDecorator(io.appium.java_client.pagefactory.AppiumFieldDecorator) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver) ChromeDriverPathUtil.getChromeDriver(io.appium.java_client.ChromeDriverPathUtil.getChromeDriver) TimeOutDuration(io.appium.java_client.pagefactory.TimeOutDuration) Before(org.junit.Before)

Aggregations

AppiumFieldDecorator (io.appium.java_client.pagefactory.AppiumFieldDecorator)4 Before (org.junit.Before)3 ChromeDriverPathUtil.getChromeDriver (io.appium.java_client.ChromeDriverPathUtil.getChromeDriver)2 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)2 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)2 TimeOutDuration (io.appium.java_client.pagefactory.TimeOutDuration)1 File (java.io.File)1 Test (org.junit.Test)1 WebDriver (org.openqa.selenium.WebDriver)1 RemoteWebElement (org.openqa.selenium.remote.RemoteWebElement)1