第三層測試層,測試的斷言驗證的
MILY: Consolas, 'Courier New', Courier, mono; BACKGROUND-COLOR: transparent; WORD-WRAP: break-word">
- @Test
- public void testIndex() throws FileNotFoundException, InterruptedException {
- int count = 15;
- PostClient client = new PostClient();
- init_date();
- client.login("this92", "123456");
- client.openUrl(TestUtil.Site,TestUtil.PostURL);
- client.waitForPageToLoad("30000");
- postView(list,UIObjects,count);
- }
- public void init_date() throws FileNotFoundException{
- UIObjects = Yaml.loadType(new FileInputStream(new File( +"post_view_UI.yml")), HashMap.class);
- list = Yaml.loadType(new FileInputStream(new File(+"post_view_value.yml")), HashMap.class);
- }
這些用yml存放一些數據。
還有最后一層,是對于測試數據的封裝,比如email的生成,還有一些公用方法的封裝。
目前從效果,比以前把所有的邏輯寫在testcase中提高了一定的重用性,對于頁面的改版只要需要修改部分頁面層,測試邏輯那塊基本上不需要修改。
google的視頻資源 http://www.youtube.com/watch?v=hWQdCdH77NA
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/