2013?????????????С??[2] ????????
???????????? ???????[ 2013/12/13 10:47:55 ] ????????
????Δ????????????
@Test(description = "addToCart_????????_??????????????????????????"?? dataProvider = "test_addToCart_normal_data")
@Rollback
public void test_addToCart_normal(String caseNote?? long itemId?? int count) {
Custom tom = new Custom("Tom");
this.setCustom(tom);
cartBean.addToCart(itemId?? count);
Item item = tom.getCart.getItems.get(0); // ????????е????????
Assert.assertEquals(item.getId?? itemId?? "itemId is wrong");
Assert.assertEquals(item.getCount?? count?? "count is wrong");
}
@DataProvider
public Object[][] test_addToCart_normal_data() {
return new Object[][] {
// caseNote?? itemId?? count
{"Milk - just a dozen"?? 39001L?? 12?? }??
{"Bread - huge number"?? 116001L?? 999}??
{"Bean - less then 10"?? 1018100L?? 2}??
};
}
|
?????????
?????????????????????β???addToCart()?????????????????????????????????????????????????????
???????????????????????????e????????????????????????????????????????????e??????????????????????
????????????????@Rollback???????????к???????????????????????????????????????????????????????????????????????????????????@Rollback?????????????????????2???
??????????????TestNg??@DataProvider????????????ж??????????????????????????
????????????????н????????caseNote?????????????????????????Ч?????????????
????Δ??????????
@Test(description = "addToCart_??????_??????????????????????"?? dataProvider = "test_addToCart_error_data")
@Rollback
public void test_addToCart_error(String caseNote?? long itemId?? int count?? int expectedErrorCode) {
Custom tom = new Custom("Tom");
this.setCustom(tom);
try {
cartBean.addToCart(itemId?? count);
Assert.fail();
} catch (Exception e) {
Assert.assertEquals(e.getErrorCode?? expectedErrorCode);
}
}
@DataProvider
public Object[][] test_addToCart_error_data() {
return new Object[][] {
// caseNote?? itemId?? count?? expectedErrorCode
{"iPad - 0 count"?? 39001L?? 0?? Cart.ZERO_COUNT}??
{"MacBookPro - more then stock"?? 116001L?? 1024?? Cart.MORE_THAN_STOCK}??
{"no such item"?? 0L?? 1L?? Cart.NO_SUCH_ITEM}
};
}
|
?????????
?????????????????????????? errorCode ????? ?????errorCode???????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
iOS???????mocha??chai??sinon??istanbul???????????????????????????????????????д?????Java????????7??????Android?????????Robolectric3.0????(?)???Kiwi?????????????????????????????????Python?????????????????????????????????????Controller????????д?????????10???????????????????Angular????????????Component??Directive??Pipe ???ServiceAndroid????????????????????????????????--Mockito??????iOS UnitTest???????Vue?????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????