Ejemplo n.º 1
0
  @BeforeClass
  public static void beforeClass() throws Exception {
    service = AppiumDriverLocalService.buildDefaultService();
    service.start();

    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.SELENDROID);
    capabilities.setCapability(MobileCapabilityType.SELENDROID_PORT, SELENDROID_PORT);
    driver = new AndroidDriver<WebElement>(service.getUrl(), capabilities);
  }
Ejemplo n.º 2
0
  @Before
  public void setUp() throws Exception {
    if (service == null || !service.isRunning())
      throw new RuntimeException("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, "8.4");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new IOSDriver<WebElement>(service.getUrl(), capabilities);
  }
Ejemplo n.º 3
0
  @BeforeSuite
  public void setUpAppium() throws MalformedURLException, InterruptedException {
    server =
        AppiumDriverLocalService.buildService(
            new AppiumServiceBuilder()
                .usingDriverExecutable(new File("C://Program Files//nodejs//node.exe"))
                .withAppiumJS(
                    new File("C://Program Files//Appium//node_modules//appium//bin//appium.js"))
                .withIPAddress("127.0.0.1")
                .usingAnyFreePort());
    server.start();
    Thread.sleep(2000);
    File appDir = new File("C:\\Users\\FC\\workspace\\fropcorn\\src\\test\\java");
    File app = new File(appDir, "fropcorndev.apk");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
    // capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,"Appium");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.1.1");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "a01b27a8");
    capabilities.setCapability(MobileCapabilityType.APP_PACKAGE, "com.fropcorn.www");
    // capabilities.setCapability(MobileCapabilityType.APP_WAIT_PACKAGE, "com.fropcorn.www");
    capabilities.setCapability(
        MobileCapabilityType.APP_ACTIVITY, "md569a6b40b6c9dd89241ed1fe199a0a771.SplashScreen");
    // capabilities.setCapability(MobileCapabilityType.APP_WAIT_ACTIVITY,
    // "md512edb7b4c20f0852a0829c1270f9f40a.RegistrationActivity");
    // capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());

    driver = new AndroidDriver<MobileElement>(server, capabilities);
    driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);

    //		 final String URL_STRING = "http://127.0.0.1:4723/wd/hub";
    //
    //	        URL url = new URL(URL_STRING);
    //
    //	        //Use a empty DesiredCapabilities object
    //	        driver = new AndroidDriver<MobileElement>(url, new DesiredCapabilities());
    //
    //	        //Use a higher value if your mobile elements take time to show up
    //	        driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
  }
  @Before
  public void setUp() throws Exception {
    File appDir = new File("src/test/java/io/appium/java_client");
    File app = new File(appDir, "RottenTomatoes.zip");

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new IOSDriver<>(service.getUrl(), capabilities);

    rottenTomatoes = new RottenTomatoes();
    PageFactory.initElements(
        new AppiumFieldDecorator(driver, new TimeOutDuration(5, TimeUnit.SECONDS)), rottenTomatoes);
  }
 @AfterClass
 public static void afterClass() throws Exception {
   if (service != null) service.stop();
 }
 @BeforeClass
 public static void beforeClass() throws Exception {
   service = AppiumDriverLocalService.buildDefaultService();
   service.start();
 }
Ejemplo n.º 7
0
  @AfterClass
  public static void afterClass() throws Exception {
    if (driver != null) driver.quit();

    if (service != null) service.stop();
  }
Ejemplo n.º 8
0
 @AfterClass
 public static void afterClass() {
   if (service != null) service.stop();
 }