WebUI发布自动化测试框架PhoenixAutotest
来源:互联网 发布:城市大数据专业委员会 编辑:程序博客网 时间:2024/05/16 08:12
介绍
WebUI自动化测试框架phoenix.webui.framework发布20170610版本。
本次发布修正了一些bug,更多Isseus信息请访问Github。添加的主要功能如下:
增加了通过注解的方式来配置PageObject(页面对象),单元测试代码如下(本文所有的代码都可以在Github项目中获取):
/* * * * Copyright 2002-2007 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * */package org.suren.autotest.web.framework.page;import org.suren.autotest.web.framework.annotation.AutoDataSource;import org.suren.autotest.web.framework.annotation.AutoLocator;import org.suren.autotest.web.framework.annotation.AutoPage;import org.suren.autotest.web.framework.annotation.AutoStrategy;import org.suren.autotest.web.framework.core.LocatorType;import org.suren.autotest.web.framework.core.StrategyType;import org.suren.autotest.web.framework.core.ui.Button;import org.suren.autotest.web.framework.core.ui.Text;/** * 使用注解的示例Page类 * @author suren * @date 2017年6月7日 下午7:10:40 */@AutoPage(url = "http://maimai.cn/")@AutoDataSource(name = "data", resource = "dataSource/xml/user_data_anno.xml")public class AnnotationPage extends Page{@AutoStrategy(type = StrategyType.PRIORITY)@AutoLocator(locator = LocatorType.BY_PARTIAL_LINK_TEXT, value = "实名动态")private Button toLoginBut;@AutoLocator(locator = LocatorType.BY_XPATH, value = "//input[@placeholder='请输入手机号码/脉脉号']")private Text phoneText;public Button getToLoginBut() {return toLoginBut;}public void setToLoginBut(Button toLoginBut) {this.toLoginBut = toLoginBut;}public Text getPhoneText() {return phoneText;}public void setPhoneText(Text phoneText) {this.phoneText = phoneText;}}
测试代码如下:
/* * * * Copyright 2002-2007 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * */package org.suren.autotest.web.framework.util;import org.junit.*;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.suren.autotest.web.framework.IgnoreReasonConstants;import org.suren.autotest.web.framework.page.AnnotationPage;import org.suren.autotest.web.framework.settings.DriverConstants;import org.suren.autotest.web.framework.settings.SettingUtil;import java.io.IOException;/** * 测试使用注解配置的方式 * @author suren * @date 2017年6月7日 下午7:10:12 */@Configuration@ComponentScan(basePackages = "org.suren.autotest.web.webframework.page")public class AutoAnnotationTest{private SettingUtil util;@Beforepublic void setUp(){util = new SettingUtil();}@Testpublic void basicTest(){util.getEngine().setDriverStr(DriverConstants.DRIVER_HTML_UNIT);util.getEngine().init();AnnotationPage page = util.getPage(AnnotationPage.class);Assert.assertNotNull(page);Assert.assertNotNull(page.getUrl());Assert.assertNotNull(page.getToLoginBut());page.open();page.getToLoginBut().click();}@Test@Ignore(value = IgnoreReasonConstants.REAL_BROWSER)public void realTest(){util.getEngine().setDriverStr(DriverConstants.DRIVER_CHROME);util.getEngine().init();util.initData();AnnotationPage page = util.getPage(AnnotationPage.class);page.open();page.getToLoginBut().click();page.getPhoneText().fillNotBlankValue();ThreadUtil.silentSleep(3000);}@Afterpublic void tearDown() throws IOException{util.close();}}
相关链接
PhoenixAutotest 的详细介绍:点击查看
PhoenixAutotest 的下载地址:点击下载
本文转载自:http://www.linuxprobe.com/webui-phoenixautotest.html
免费提供最新Linux技术教程书籍,为开源技术爱好者努力做得更多更好:http://www.linuxprobe.com/
阅读全文
0 0
- WebUI发布自动化测试框架PhoenixAutotest
- WebUI发布自动化测试框架PhoenixAutotest
- webUI自动化测试框架---”pyswat“介绍
- webUI自动化测试框架(一):简介和Demo入门
- webUI自动化测试框架(二):代码分层-基础层
- WebUI 自动化测试利器 - selenium
- python+selenium 自动化测试webui
- webUI自动化测试框架(三):代码分层-对象库层
- webUI自动化测试框架(四):代码分层-操作层及用例层
- WebUI自动化测试的一些问题
- PhoenixAutoTest
- WebUI自动化测试过程中遇到的问题总结
- phoenixframe自动化测试平台webUI用例实例
- 禅道自动化测试框架ZenTaoATF1.0发布
- ITF接口自动化测试框架 V0.8版本发布
- 最新消息:Android自动化测试框架-Robotium 4.3发布!
- 迟来消息:Android自动化测试框架-Robotium 4.2发布!
- 自动化测试框架: 协同
- truffle webpack下localhost能够访问,而IP地址无法访问的解决方法
- linux系统下实现文件拷贝
- 阿里巴巴智能操作系统YunOS 6 系统发布
- 详解 Redis 应用场景及应用实例
- Mysql 教程大全
- WebUI发布自动化测试框架PhoenixAutotest
- poj1164(dfs)城堡问题
- 鬼吹灯之黄皮子坟 全集 迅雷百度下载,谈现在互联网产品流量的获取成本!
- C++模板实现单链表
- scipy中的包及其作用
- IDEA如何创建.properties文件
- 萌新的程序猿之旅二
- 【Android 从入门到放弃】Glide(4.0 RC版) 的使用01
- 用java实现屏幕找图