本文整理汇总了Java中com.surenpi.autotest.webui.ui.Button类的典型用法代码示例。如果您正苦于以下问题:Java Button类的具体用法?Java Button怎么用?Java Button使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Button类属于com.surenpi.autotest.webui.ui包,在下文中一共展示了Button类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simple
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* 测试简单流程,通过编码的方式输入数据
* @throws IOException
* @throws DocumentException
* @throws SAXException
*/
@Test
public void simple() throws IOException, DocumentException, SAXException
{
util.readFromClassPath("elements/xml/maimai.xml");
util.initData();
HomePage homePage = util.getPage(HomePage.class);
Assert.assertNotNull(homePage);
Assert.assertNotNull(homePage.getUrl());
Assert.assertTrue("起始页地址不合法",
homePage.paramTranslate(homePage.getUrl()).startsWith("http"));
homePage.open();
Button toLoginBut = homePage.getToLoginBut();
Assert.assertNotNull(toLoginBut);
toLoginBut.click();
LoginPage loginPage = util.getPage(LoginPage.class);
Assert.assertNotNull(loginPage);
Text phone = loginPage.getPhone();
Assert.assertNotNull(phone);
phone.fillValue("18211145623");
}
示例2: dataSource
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* 测试简单流程,数据在数据源(xml格式)中
* @throws SAXException
* @throws DocumentException
* @throws IOException
*/
@Test
public void dataSource() throws IOException, DocumentException, SAXException
{
util.readFromClassPath("elements/xml/maimai.xml");
util.initData();
HomePage homePage = util.getPage(HomePage.class);
Assert.assertNotNull(homePage);
Assert.assertNotNull(homePage.getUrl());
Assert.assertTrue("起始页地址不合法",
homePage.paramTranslate(homePage.getUrl()).startsWith("http"));
homePage.open();
Button toLoginBut = homePage.getToLoginBut();
Assert.assertNotNull(toLoginBut);
toLoginBut.click();
LoginPage loginPage = util.getPage(LoginPage.class);
Assert.assertNotNull(loginPage);
Text phone = loginPage.getPhone();
Assert.assertNotNull(phone);
Assert.assertNotNull("数据未从数据源中加载", phone.getValue());
phone.fillNotBlankValue();
}
示例3: excelDataSource
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* 测试excel格式的数据源加载
* @throws IOException
* @throws DocumentException
* @throws SAXException
*/
@Test
public void excelDataSource() throws IOException, DocumentException, SAXException
{
util.readFromClassPath("elements/xml/maimai_exceldata.xml");
util.initData();
HomePage homePage = util.getPage(HomePage.class);
Assert.assertNotNull(homePage);
Assert.assertNotNull(homePage.getUrl());
Assert.assertTrue("起始页地址不合法",
homePage.paramTranslate(homePage.getUrl()).startsWith("http"));
homePage.open();
Button toLoginBut = homePage.getToLoginBut();
Assert.assertNotNull(toLoginBut);
toLoginBut.click();
LoginPage loginPage = util.getPage(LoginPage.class);
Assert.assertNotNull(loginPage);
Text phone = loginPage.getPhone();
Assert.assertNotNull(phone);
Assert.assertNotNull("数据未从数据源中加载", phone.getValue());
phone.fillNotBlankValue();
}
示例4: yamlDataSource
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* 测试yaml格式的数据源加载
* @throws IOException
* @throws DocumentException
* @throws SAXException
*/
@Test
public void yamlDataSource() throws IOException, DocumentException, SAXException
{
util.readFromClassPath("elements/xml/maimai_yamldata.xml");
util.initData();
HomePage homePage = util.getPage(HomePage.class);
Assert.assertNotNull(homePage);
Assert.assertNotNull(homePage.getUrl());
Assert.assertTrue("起始页地址不合法",
homePage.paramTranslate(homePage.getUrl()).startsWith("http"));
homePage.open();
Button toLoginBut = homePage.getToLoginBut();
Assert.assertNotNull(toLoginBut);
toLoginBut.click();
LoginPage loginPage = util.getPage(LoginPage.class);
Assert.assertNotNull(loginPage);
Text phone = loginPage.getPhone();
Assert.assertNotNull(phone);
Assert.assertNotNull("数据未从数据源中加载", phone.getValue());
phone.fillNotBlankValue();
}
示例5: buildSearchButton
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* @param absEle
*/
private Button buildSearchButton(AbstractElement absEle)
{
Map<String, String> map = Collections.singletonMap(
absEle.getDataStr(SEARCH_BUT_BY), absEle.getDataStr(SEARCH_BUT_INFO));
map.put("strategy", "priority");
LocatorUtil.setLocator(map, searchBut);
return searchBut;
}
示例6: buildOperationBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* @param absEle
*/
private Button buildOperationBut(AbstractElement absEle)
{
Map<String, String> map = Collections.singletonMap(
absEle.getDataStr(OPER_BUT_BY), absEle.getDataStr(OPER_BUT_INFO));
map.put("strategy", "priority");
LocatorUtil.setLocator(map, operationBut);
return operationBut;
}
示例7: set
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* 根据属性名称设置值
* @param instance instance
* @param name name
* @param value value
*/
public static void set(Object instance, String name, Object value)
{
if(value == null)
{
return;
}
Class<? extends Object> cls = instance.getClass();
try
{
Method setterMethod = cls.getMethod("set" + name.substring(0, 1).toUpperCase() + name.substring(1), value.getClass());
if(value instanceof Button)
{
setterMethod.invoke(instance, new Button());
}
else
{
setterMethod.invoke(instance, value);
}
}
catch(NoSuchMethodException | SecurityException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e)
{
e.printStackTrace();
}
}
示例8: getToLoginBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/** getter and setter */
public Button getToLoginBut() {
return toLoginBut;
}
示例9: setToLoginBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
public void setToLoginBut(Button toLoginBut) {
this.toLoginBut = toLoginBut;
}
示例10: getLoginBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* getter and setter methods zone
*/
public Button getLoginBut()
{
return loginBut;
}
示例11: setLoginBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
public void setLoginBut(Button loginBut)
{
this.loginBut = loginBut;
}
示例12: getGossipBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* getter and setter methods zone
*/
public Button getGossipBut()
{
return gossipBut;
}
示例13: setGossipBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
public void setGossipBut(Button gossipBut)
{
this.gossipBut = gossipBut;
}
示例14: getLoginBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* @return the loginBut
*/
public Button getLoginBut()
{
return loginBut;
}
示例15: setLoginBut
import com.surenpi.autotest.webui.ui.Button; //导入依赖的package包/类
/**
* @param loginBut the loginBut to set
*/
public void setLoginBut(Button loginBut)
{
this.loginBut = loginBut;
}