首页 测试 体会 查看内容

iOS及Android自动化实践

2014-6-25 14:32| 发布者: tianzc| 查看: 705| 评论: 0

摘要:   App:网易看游戏(Xone)  工具:appium 1.0  Appium 1.0较以往的版本有了比较大的变化。  1.xpath路径改变  Before:/window/navigationBar/button  Current://UIAApplication/UIAWindow/UIANavigat ...
public class PassportLogin extends BaseTest {private static Logger log = Logger.getLogger(PassportLogin.class);@DataProvider(name = "passportLoginData")public static Object[][] passportLoginData() {return new Object[][] {{ "正确的网易通行证登录", "[email protected]", "xxxxx", "" },{ "非网易账号的网易通行证登录", "[email protected]", "xxxx", "" },{ "网易通行证登录,密码错误", "[email protected]", "xxx","用户名或密码错误" },{ "不输入账号和密码", "", "", "用户名不能为空" },{ "不输入密码", "[email protected]", "", "密码不能为空" },{ "不输入账号", "", "xxxx", "用户名不能为空" },{ "错误的网易通行证登录", MyRandom.getRandomString(10) + "@163.com",MyRandom.getRandomString(6), "用户名或密码错误" } };}@BeforeClasspublic void setUp() {driver = new Orange();mainPage = new MainPage(driver);account = new Account(driver);as = new AssertSettings(driver);usPage = new UserSettingsPage(driver);homePage = new HomePage(driver);mainPage.enterMainPage();mainPage.enterLogin();account.logoutTrue();}@AfterClasspublic void tearDown() {driver.quit();}@AfterMethodpublic void end() throws InterruptedException {log.info("-------------------------------------------------------------------");}@Test(dataProvider = "passportLoginData")public void passportLoginTest(String testName, String passport,String password, String errorCode) throws InterruptedException {log.info("测试内容:" + testName);mainPage.enterLogin();account.login(passport, password);if (errorCode != "") {boolean b = as.assertLogin(errorCode);driver.sleep(3000);mainPage.flickToRight();mainPage.closePage();Assert.assertTrue(b);} else {mainPage.enterLogin();homePage.settingsClick();usPage.passportClick();account.logout();}}}
  2.编码,贴下通行证登录模块的代码,供参考  测试类:PassportLogin

鲜花

握手

雷人

路过

鸡蛋

扫一扫关注最新动态

毒镜头:老镜头、摄影器材资料库、老镜头样片、摄影
爱评测 aipingce.com  
返回顶部