|
- @Before
- public void openAlertMaintenancePage(){
- loginPage = new AdminLoginPage(selenium);
- indexPage = loginPage.loginAsAdmin();
- alertMaintenancePage= indexPage.clickAlertMaintenance();
- transactionAlertMaintenancePage = alertMaintenancePage.clickTransactionAlertMaintenance();
- }
-
- @Test
- public void test_AddTransactionAlert() throws Exception{
-
- dr = new ReadExcel("TestingData.xls", "Transaction Alert");
- params=dr.getValue("test_AddTransactionAlert");
-
- AlertCreatePage alertCreatePage = transactionAlertMaintenancePage.clickAddNewAlert();
- alertCreatePage.typeAlertID(params.get("Alert Id"));
- alertCreatePage.selectGroup(params.get("Alert Group"));
- alertCreatePage.selectCreditDebit(params.get("Type"));
- alertCreatePage.typeTransactionCode(params.get("Transaction Code"));
- alertCreatePage.selectStatus(params.get("Alert Status"));
- alertCreatePage.typeDescription(params.get("Alert Description"));
- alertCreatePage.typeMessage(params.get("Alert Message"));
-
- AlertReadPage alertReadPage = alertCreatePage.clickSubmit();
- transactionAlertMaintenancePage = alertReadPage.clickOK();
- assertTrue(transactionAlertMaintenancePage.hasAlertID(params.get("Alert Id")));
-
- }
复制代码 这是我现在用到的一个模板,我从excel里面读取数据,是在每一个测试方法里面。但是一个class里面有多个测试用例,是在初始化方法适合取得所有测试数据好了,还是一个静态方法里面?
我这样能够怎么优化比较好,谢谢了! |
|