1. 程式人生 > >phoenixframe自動化測試平臺web介面測試例項

phoenixframe自動化測試平臺web介面測試例項

package org.phoenix.cases.lianmeng;

import java.util.LinkedList;

import org.phoenix.action.WebElementActionProxy;
import org.phoenix.model.CaseLogBean;
import org.phoenix.model.UnitLogBean;

/**
 * 使用phoenix做介面測試的案例
 * @author mengfeiyang
 *
 */
public class ContactJieKou extends WebElementActionProxy{
	private static String caseName = "報告檢視";
	public ContactJieKou() {
	}
	@Override
	public LinkedList<UnitLogBean> run(CaseLogBean arg0) {
		init(caseName,arg0);
		
		webProxy.openNewWindowByPhantomJs("http://lianmeng.360.cn/media/contact/index.html");
		String s = webProxy.title();
		System.out.println(s);
		String r = webProxy.checkPoint().checkIsMatcher("360聯盟 - 聯絡我們", s);
		if(r == null){
			System.out.println("==================介面通過===================");
		}
		webProxy.closeWindow();
		return getUnitLog();
	}
	
	public static void main(String[] args) {
		ContactJieKou yw = new ContactJieKou();
		LinkedList<UnitLogBean> ll = yw.run(new CaseLogBean());
		for(UnitLogBean l : ll){
			System.out.println(l.getContent());
		}
	}
	
}