PhoenixAutotest框架发布了2.x版本。这次发布,对框架整体结构做了重构,职能划分清晰。 现在的模块划分包括: 自动化接口定义 数据源定义 测试报告定义 runner模块 自动化接口定义部分,目前给出了Selenium版本的实现。 数据源定义部分,给出了excel、xml、yaml三种格式的实现。 测试报告部分,给出了数据库、excel、jira三种形式的实现。 这样划分开后,用户可以根据需要来添加指定的依赖,减少了不必要的jar文件依赖。 另外,简化了框架的使用方法,下面给出一个最简单的入门示例: import java.io.IOException; import org.suren.autotest.web.framework.annotation.AutoApplication; import org.suren.autotest.web.framework.annotation.AutoLocator; import org.suren.autotest.web.framework.annotation.AutoPage; import org.suren.autotest.web.framework.selenium.WebPage; import org.suren.autotest.web.framework.settings.Phoenix; import org.suren.autotest.web.framework.util.ThreadUtil; import com.surenpi.autotest.webui.core.LocatorType; import com.surenpi.autotest.webui.ui.Button; import com.surenpi.autotest.webui.ui.Text; @AutoApplication public class BaiduTest { public static void main(String[] args) throws IOException { Phoenix phoenix = new Phoenix(BaiduTest.class); phoenix.init(); BaiduPage page = phoenix.getPage(BaiduPage.class); page.open(); page.getKeyword().fillValue("PhoenixAutotest"); page.getSearchBut().click(); ThreadUtil.silentSleep(3000); phoenix.close(); } } @AutoPage(url = "http://baidu.com") class BaiduPage extends WebPage { @AutoLocator(locator = LocatorType.BY_ID, value = "kw") private Text keyword; @AutoLocator(locator = LocatorType.BY_ID, value = "su") private Button searchBut; public Text getKeyword() { return keyword; } public void setKeyword(Text keyword) { this.keyword = keyword; } public Button getSearchBut() { return searchBut; } public void setSearchBut(Button searchBut) { this.searchBut = searchBut; } } 为了能够适应开源项目多人协作的状况,目前源码已经支持目前浏览的流水线(pipeline),当代码(code)发生变化后会通过Jenkins自动构建-测试-发布到Maven中央仓库中。 下面是 maven 依赖信息一览 https://mvnrepository.com/artifact/com.surenpi.autotest/autotest.web.framework WebUI 自动化测试框架 PhoenixAutotest 发布 20170722下载地址