码迷,mamicode.com
首页 > 移动开发 > 详细

安卓ios app自动化测试用例模板

时间:2017-10-22 01:34:47      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:version   log4   androi   style   apach   oid   cap   class   exce   

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.openqa.selenium.Point;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.net.URL;
import java.util.concurrent.TimeUnit;


public class AppTest {
    private static AndroidDriver<AndroidElement> driver;
    static Logger log = LogManager.getLogger( InterfaceTest.class.getName());
    Login login = new Login(driver);
    PageObject pageobject = new PageObject(driver);
    

    @org.junit.BeforeClass
    public static void beforeTest() throws Exception {
        DesiredCapabilities capabilities=new DesiredCapabilities();
        capabilities.setCapability("deviceName", "Default");
        capabilities.setCapability("device", "android");
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("browserName", "");
        capabilities.setCapability("version", "7.0");
        capabilities.setCapability("appPackage", "com.eg.XXXXXX");
        capabilities.setCapability("appActivity", ".XXXXLogin");
        driver=new AndroidDriver<AndroidElement>(new URL("http://localhost:4723/wd/hub"),capabilities);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    }
    
    /**
     * 关闭
     */
    @org.junit.AfterClass
    public static void afterTest() {
        if (driver != null) {
            driver.quit();
        }
        log.debug("---------------------------测试完毕");
    }
    
    
    @Test
    public void testOpenAPI() throws InterruptedException {

        log.debug("------------------------开始测试");
        loginTest();

        
    }

       public void loginTest() {

                    具体的测试内容.............

        }

 

安卓ios app自动化测试用例模板

标签:version   log4   androi   style   apach   oid   cap   class   exce   

原文地址:http://www.cnblogs.com/111testing/p/7707351.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!