添加配置文件抽象类
This commit is contained in:
parent
b72b0c1324
commit
e749f71038
|
@ -0,0 +1,87 @@
|
|||
<factorypath>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-java/3.141.0/selenium-java-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-api/3.141.0/selenium-api-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/3.141.0/selenium-chrome-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-edge-driver/3.141.0/selenium-edge-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/3.141.0/selenium-firefox-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/3.141.0/selenium-ie-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-opera-driver/3.141.0/selenium-opera-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/3.141.0/selenium-remote-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-safari-driver/3.141.0/selenium-safari-driver-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/seleniumhq/selenium/selenium-support/3.141.0/selenium-support-3.141.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/net/bytebuddy/byte-buddy/1.8.15/byte-buddy-1.8.15.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/guava/guava/25.0-jre/guava-25.0-jre.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okhttp3/okhttp/3.11.0/okhttp-3.11.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okio/okio/1.14.0/okio-1.14.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/opencsv/opencsv/4.1/opencsv-4.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-text/1.1/commons-text-1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-beanutils/commons-beanutils/1.9.3/commons-beanutils-1.9.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi/3.17/poi-3.17.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-codec/commons-codec/1.10/commons-codec-1.10.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-collections4/4.1/commons-collections4-4.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi-ooxml/3.17/poi-ooxml-3.17.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi-ooxml-schemas/3.17/poi-ooxml-schemas-3.17.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/xmlbeans/xmlbeans/2.6.0/xmlbeans-2.6.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/virtuald/curvesapi/1.04/curvesapi-1.04.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/poi/poi-scratchpad/3.17/poi-scratchpad-3.17.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jaxen/jaxen/1.1-beta-6/jaxen-1.1-beta-6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jdom/jdom/1.0/jdom-1.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/xom/xom/1.0b3/xom-1.0b3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/xalan/xalan/2.6.0/xalan-2.6.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/ccil/cowan/tagsoup/tagsoup/0.9.7/tagsoup-0.9.7.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jfree/jfreechart/1.0.19/jfreechart-1.0.19.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jfree/jcommon/1.0.23/jcommon-1.0.23.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/hynnet/jacob/1.14.3/jacob-1.14.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/net/sourceforge/tess4j/tess4j/4.5.1/tess4j-4.5.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/net/java/dev/jna/jna/5.5.0/jna-5.5.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/jai-imageio/jai-imageio-core/1.4.0/jai-imageio-core-1.4.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/ghost4j/ghost4j/1.0.1/ghost4j-1.0.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/log4j/log4j/1.2.17/log4j-1.2.17.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/xmlgraphics/xmlgraphics-commons/1.4/xmlgraphics-commons-1.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/lowagie/itext/2.1.7/itext-2.1.7.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/pdfbox/pdfbox/2.0.18/pdfbox-2.0.18.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/pdfbox/fontbox/2.0.18/fontbox-2.0.18.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/pdfbox/pdfbox-tools/2.0.18/pdfbox-tools-2.0.18.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/pdfbox/pdfbox-debugger/2.0.18/pdfbox-debugger-2.0.18.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/pdfbox/jbig2-imageio/3.0.3/jbig2-imageio-3.0.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-io/commons-io/2.6/commons-io-2.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/net/sourceforge/lept4j/lept4j/1.13.0/lept4j-1.13.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jboss/jboss-vfs/3.2.15.Final/jboss-vfs-3.2.15.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jboss/logging/jboss-logging/3.1.4.GA/jboss-logging-3.1.4.GA.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/log4j-over-slf4j/1.7.30/log4j-over-slf4j-1.7.30.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/alibaba/fastjson/1.2.61/fastjson-1.2.61.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/cn/hutool/hutool-all/5.0.2/hutool-all-5.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/noraui/ojdbc7/12.1.0.2/ojdbc7-12.1.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jsoup/jsoup/1.13.1/jsoup-1.13.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-aop/5.2.7.RELEASE/spring-aop-5.2.7.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-beans/5.2.7.RELEASE/spring-beans-5.2.7.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-core/5.2.7.RELEASE/spring-core-5.2.7.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jcl/5.2.7.RELEASE/spring-jcl-5.2.7.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/aspectj/aspectjrt/1.9.5/aspectjrt-1.9.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar" enabled="true" runInBatchMode="false"/>
|
||||
</factorypath>
|
|
@ -0,0 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.apt.aptEnabled=true
|
||||
org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
|
||||
org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
// 使用 IntelliSense 了解相关属性。
|
||||
// 悬停以查看现有属性的描述。
|
||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "CodeLens (Launch) - TestCreateXml",
|
||||
"request": "launch",
|
||||
"mainClass": "test.javase.TestCreateXml",
|
||||
"projectName": "Autest",
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "CodeLens (Launch) - Test123",
|
||||
"request": "launch",
|
||||
"mainClass": "test.javase.Test123",
|
||||
"projectName": "Autest"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Debug (Launch) - Current File",
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"java.configuration.updateBuildConfiguration": "automatic"
|
||||
}
|
|
@ -8,13 +8,13 @@
|
|||
<column id="condition" name="前置条件" wide="30" align="left" index='true'/>
|
||||
</sheet>
|
||||
<sheet name="运行记录" freeze="5" >
|
||||
<column id="id" name="序号" wide="8" align="center"/>
|
||||
<column id="id" name="运行记录编号" wide="8" align="center"/>
|
||||
<column id="case_id" name="用例编号" wide="17" align="center"/>
|
||||
<column id="class_name" name="类名" wide="25" align="left"/>
|
||||
<column id="method_name" name="方法名" wide="15" align="left"/>
|
||||
<column id="state" name="执行状态" wide="10" align="center"/>
|
||||
<column id="step" name="执行步骤" wide="25" align="left" index='true'/>
|
||||
<column id="result" name="执行结果" wide="25" align="left" index='true'/>
|
||||
<column id="step" name="执行步骤" wide="25" align="left" index='true' row_text='3'/>
|
||||
<column id="result" name="执行结果" wide="25" align="left" index='true' row_text='3'/>
|
||||
<column id="bug_number" name="Bug数量" wide="10" align="center"/>
|
||||
<column id="screenshot_position" name="截图位置" wide="25" align="center"/>
|
||||
<column id="use_time" name="执行耗时" wide="15" align="center"/>
|
||||
|
@ -32,7 +32,7 @@
|
|||
</sheet>
|
||||
|
||||
<sheet name="错误记录" freeze="4">
|
||||
<column id="id" name="序号" wide="8" align="center"/>
|
||||
<column id="id" name="运行记录编号" wide="8" align="center"/>
|
||||
<column id="class_name" name="类名" wide="25" align="left"/>
|
||||
<column id="method_name" name="方法名" wide="15" align="left"/>
|
||||
<column id="error_step" name="错误步骤" wide="25" align="left" index='true' row_text='1'/>
|
||||
|
|
BIN
Result/测试用例.xlsx
BIN
Result/测试用例.xlsx
Binary file not shown.
|
@ -197,7 +197,7 @@ public abstract class AbstractBrower {
|
|||
*/
|
||||
abstract void openBrower();
|
||||
|
||||
public JSONObject getAllInformation() {
|
||||
public String getAllInformation() {
|
||||
// 遍历所有标签页,存储标签页信息
|
||||
JSONArray labelInformation = new JSONArray();
|
||||
pageMap.forEach((name, page) -> {
|
||||
|
@ -206,9 +206,9 @@ public abstract class AbstractBrower {
|
|||
// 存储标签页信息
|
||||
informationJson.put("标签信息", labelInformation);
|
||||
|
||||
return informationJson;
|
||||
return informationJson.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于返回当前在浏览器中被打开的页面
|
||||
* @return 在浏览器中被打开的{@link Page}对象
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package pres.auxiliary.work.selenium.element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pres.auxiliary.work.selenium.location.AbstractRead;
|
||||
import pres.auxiliary.work.selenium.xml.ByType;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>ElementData.java</p>
|
||||
* <p><b>用途:</b>
|
||||
* 用于存储页面元素的基本信息,以便于在查找元素中进行使用
|
||||
* </p>
|
||||
* <p><b>编码时间:</b>2020年9月27日上午7:50:44</p>
|
||||
* <p><b>修改时间:</b>2020年9月27日上午7:50:44</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
*/
|
||||
public class ElementData {
|
||||
/**
|
||||
* 存储元素的名称或定位内容
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 存储元素的定位方式,需要与valueList一一对应
|
||||
*/
|
||||
private ArrayList<ByType> byTypeList = new ArrayList<>();
|
||||
/**
|
||||
* 存储元素的定位内容,需要与byTypeList一一对应
|
||||
*/
|
||||
private ArrayList<String> valueList = new ArrayList<>();
|
||||
/**
|
||||
* 用于标记元素的类型
|
||||
*/
|
||||
private ElementType elementType;
|
||||
/**
|
||||
* 用于存储元素的父层窗体(所有的父层窗体)
|
||||
*/
|
||||
private ArrayList<String> iframeNameList = new ArrayList<>();
|
||||
/**
|
||||
* 存储元素
|
||||
*/
|
||||
private long waitTime;
|
||||
|
||||
/**
|
||||
* 根据元素名称,在配置文件中查找元素,将元素的信息进行存储
|
||||
* @param name 元素名称
|
||||
* @AbstractReadConfig 配置文件类对象
|
||||
*/
|
||||
public ElementData(String name, AbstractRead arc) {
|
||||
//存储元素名称
|
||||
this.name = name;
|
||||
|
||||
//根据传入的读取配置文件类对象,使用其中的返回方法,初始化元素信息
|
||||
arc.setElementName(name);
|
||||
byTypeList = arc.getElementByTypeList();
|
||||
valueList = arc.getValueList();
|
||||
elementType = arc.getElementType();
|
||||
iframeNameList = arc.getIframeNameList();
|
||||
waitTime = arc.getWaitTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素名称
|
||||
* @return 元素名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素定位类型集合
|
||||
* @return 元素定位类型集合
|
||||
*/
|
||||
public ArrayList<ByType> getByTypeList() {
|
||||
return byTypeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素定位内容集合
|
||||
* @return 元素定位内容集合
|
||||
*/
|
||||
public ArrayList<String> getValueList() {
|
||||
return valueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素类型
|
||||
* @return 元素
|
||||
*/
|
||||
public ElementType getElementType() {
|
||||
return elementType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素父层窗体名称列表
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<String> getIframeNameList() {
|
||||
return iframeNameList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素加载超时时间
|
||||
* @return 元素加载超时时间
|
||||
*/
|
||||
public long getWaitTime() {
|
||||
return waitTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pres.auxiliary.work.selenium.element.ElementType;
|
||||
import pres.auxiliary.work.selenium.xml.ByType;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>AbstractReadConfig.java</p>
|
||||
* <p><b>用途:</b>
|
||||
* 定义读取自动化测试中元素定位方式的基本方法
|
||||
* </p>
|
||||
* <p><b>编码时间:</b>2020年9月28日上午7:37:00</p>
|
||||
* <p><b>修改时间:</b>2020年9月28日上午7:37:00</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractRead {
|
||||
/**
|
||||
* 指向元素名称
|
||||
*/
|
||||
protected String name;
|
||||
|
||||
/**
|
||||
* 用于设置元素名称
|
||||
* @param name 元素名称
|
||||
*/
|
||||
public void setElementName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于返回元素名称
|
||||
* @return 元素名称
|
||||
*/
|
||||
public String getElementName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于返回元素的所有定位方式集合
|
||||
* @return 元素的所有定位方式({@link ByType}枚举)集合
|
||||
*/
|
||||
public abstract ArrayList<ByType> getElementByTypeList();
|
||||
|
||||
/**
|
||||
* 用于返回与定位方式对应的元素定位内容集合
|
||||
* @return 元素定位内容集合
|
||||
*/
|
||||
public abstract ArrayList<String> getValueList();
|
||||
|
||||
/**
|
||||
* 用于返回元素的类型
|
||||
* @return 元素类型({@link ElementType}枚举)
|
||||
*/
|
||||
public abstract ElementType getElementType();
|
||||
|
||||
/**
|
||||
* 用于返回元素的所有父窗体名称集合
|
||||
* @return 元素的所有父窗体名称集合
|
||||
*/
|
||||
public abstract ArrayList<String> getIframeNameList();
|
||||
|
||||
/**
|
||||
* 用于返回元素的等待时间
|
||||
* @return 元素的等待时间
|
||||
*/
|
||||
public abstract long getWaitTime();
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <b>文件名:</b>ByType.java
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>用途:</b>用于枚举出能被识别的元素定位方式
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>编码时间:</b>2019年10月24日下午5:18:57
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>修改时间:</b>2019年10月24日下午5:18:57
|
||||
* </p>
|
||||
*
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public enum ByType {
|
||||
/** 通过xpath方式进行定位 */
|
||||
XPATH("xpath"),
|
||||
/** 通过css方式进行定位 */
|
||||
CSS("css"),
|
||||
/** 通过className方式进行定位 */
|
||||
CLASSNAME("classname"),
|
||||
/** 通过id方式进行定位 */
|
||||
ID("id"),
|
||||
/** 通过linkText方式进行定位 */
|
||||
LINKTEXT("linktext"),
|
||||
/** 通过name方式进行定位 */
|
||||
NAME("name"),
|
||||
/** 通过tagName方式进行定位 */
|
||||
TAGNAME("tagname"),
|
||||
/**
|
||||
* 通过jQuert的方式进行定位
|
||||
*/
|
||||
// JQ("jquert"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 定义枚举值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
private ByType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回元素定位枚举对应的定位方式名称
|
||||
*
|
||||
* @return 元素定位方式名称
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* 该异常在XML文件不正确或XML路径不存在时抛出
|
||||
*
|
||||
* @author 彭宇琦
|
||||
* @version V1.0
|
||||
*
|
||||
*/
|
||||
public class IncorrectXmlPathException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public IncorrectXmlPathException() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public IncorrectXmlPathException(String arg0, Throwable arg1, boolean arg2,
|
||||
boolean arg3) {
|
||||
super(arg0, arg1, arg2, arg3);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public IncorrectXmlPathException(String arg0, Throwable arg1) {
|
||||
super(arg0, arg1);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public IncorrectXmlPathException(String arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public IncorrectXmlPathException(Throwable arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>NoSuchSignValueException.java</p>
|
||||
* <p><b>用途:</b>用于当模板内容中标志的值未定义为元素的属性中时,抛出的异常</p>
|
||||
* <p><b>编码时间:</b>2019年10月25日上午11:12:20</p>
|
||||
* <p><b>修改时间:</b>2019年10月25日上午11:12:20</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class NoSuchSignValueException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public NoSuchSignValueException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public NoSuchSignValueException(String message, Throwable cause, boolean enableSuppression,
|
||||
boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
public NoSuchSignValueException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public NoSuchSignValueException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public NoSuchSignValueException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import pres.auxiliary.work.selenium.element.ElementType;
|
||||
import pres.auxiliary.work.selenium.xml.ByType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <b>文件名:</b>ReadXml.java
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>用途:</b>该类用于从指定格式的xml中读取元素信息<br/>
|
||||
*
|
||||
* <b>注意:</b>
|
||||
* <ol>
|
||||
* <li>标签的name属性必须唯一,否则读取会出现错误
|
||||
* <li>不同类型的定位模板可以使用一个id属性,但同一种类型的定位模板id属性是唯一的,
|
||||
* 如xpath模板可以使用id='1',css模板可以使用id='1',但另一xpath模板的id属性就不能
|
||||
* 再定为1,但建议模板的id也唯一存在
|
||||
* <li>元素定位标签只能写xpath、css、classname、id、linktext、name、tagname
|
||||
* <li>所有标签均为小写
|
||||
* <ol>
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>编码时间:</b>2017年9月25日下午4:23:40
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>修改时间:</b>2020年9月29日上午9:40:40
|
||||
* </p>
|
||||
*
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 8
|
||||
*
|
||||
*/
|
||||
public class ReadXml extends AbstractRead {
|
||||
/**
|
||||
* 存储构造后的Document类对象,以读取xml文件中的内容
|
||||
*/
|
||||
private Document dom;
|
||||
|
||||
public ReadXml(File xmlFile) throws DocumentException {
|
||||
dom = new SAXReader().read(xmlFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ByType> getElementByTypeList() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getValueList() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementType getElementType() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getIframeNameList() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getWaitTime() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* 该异常在查找到相同文件名时抛出的异常
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
*/
|
||||
public class RepeatedXmlFileNameException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RepeatedXmlFileNameException() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public RepeatedXmlFileNameException(String arg0, Throwable arg1,
|
||||
boolean arg2, boolean arg3) {
|
||||
super(arg0, arg1, arg2, arg3);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public RepeatedXmlFileNameException(String arg0, Throwable arg1) {
|
||||
super(arg0, arg1);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public RepeatedXmlFileNameException(String arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public RepeatedXmlFileNameException(Throwable arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>UndefinedElementException.java</p>
|
||||
* <p><b>用途:</b>用于查找xml文件中元素不存在时抛出的异常</p>
|
||||
* <p><b>编码时间:</b>2019年10月25日上午8:30:20</p>
|
||||
* <p><b>修改时间:</b>2019年10月25日上午8:30:20</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class UndefinedElementException extends RuntimeException {
|
||||
|
||||
public UndefinedElementException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public UndefinedElementException(String message, Throwable cause, boolean enableSuppression,
|
||||
boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
public UndefinedElementException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public UndefinedElementException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public UndefinedElementException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* 若传入的模型参数有误时抛出的异常
|
||||
* @author 彭宇琦
|
||||
* @version V1.0
|
||||
*
|
||||
*/
|
||||
public class UndefinedModeException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UndefinedModeException() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public UndefinedModeException(String arg0, Throwable arg1, boolean arg2,
|
||||
boolean arg3) {
|
||||
super(arg0, arg1, arg2, arg3);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public UndefinedModeException(String arg0, Throwable arg1) {
|
||||
super(arg0, arg1);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public UndefinedModeException(String arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public UndefinedModeException(Throwable arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package pres.auxiliary.work.selenium.location;
|
||||
|
||||
/**
|
||||
* 该异常提示用户需要检查xml文件是否为空
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
*/
|
||||
public class XmlFileNameIsNullException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public XmlFileNameIsNullException() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public XmlFileNameIsNullException(String arg0, Throwable arg1,
|
||||
boolean arg2, boolean arg3) {
|
||||
super(arg0, arg1, arg2, arg3);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public XmlFileNameIsNullException(String arg0, Throwable arg1) {
|
||||
super(arg0, arg1);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public XmlFileNameIsNullException(String arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public XmlFileNameIsNullException(Throwable arg0) {
|
||||
super(arg0);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
|
@ -7,6 +7,8 @@ import org.dom4j.Document;
|
|||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import pres.auxiliary.tool.date.Time;
|
||||
import pres.auxiliary.tool.file.MarkColorsType;
|
||||
import pres.auxiliary.tool.file.excel.AbstractWriteExcel;
|
||||
|
@ -71,7 +73,12 @@ public class ExcelRecord extends AbstractWriteExcel<ExcelRecord> {
|
|||
* @return 类本身
|
||||
*/
|
||||
public ExcelRecord setBrowerInformation(AbstractBrower brower) {
|
||||
//TODO 添加浏览器信息内容
|
||||
//获取浏览器信息,将其转换为JSONObject对象
|
||||
JSONObject json = JSONObject.parseObject(brower.getAllInformation());
|
||||
switchSheet("运行记录")
|
||||
.addContent("brower", json.get("浏览器名称").toString())
|
||||
.addContent("version", json.get("浏览器版本").toString())
|
||||
.addContent("system", json.get("操作系统版本").toString());
|
||||
|
||||
return this;
|
||||
}
|
||||
|
@ -164,6 +171,16 @@ public class ExcelRecord extends AbstractWriteExcel<ExcelRecord> {
|
|||
.addContent("screenshot_position", screenshotFile.getPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于添加运行记录编号
|
||||
* @param text 编号文本
|
||||
* @return 类本身
|
||||
*/
|
||||
public ExcelRecord runId(String text) {
|
||||
return switchSheet("运行记录")
|
||||
.addContent("id", text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于添加异常步骤的信息,传入异常类后,将会自动记录异常步骤
|
||||
* @param exception 异常类
|
||||
|
@ -172,6 +189,9 @@ public class ExcelRecord extends AbstractWriteExcel<ExcelRecord> {
|
|||
public ExcelRecord exception(Exception exception) {
|
||||
isError = true;
|
||||
return switchSheet("错误记录")
|
||||
.addContent("id", fieldMap.get("运行记录").get("id").getContent(0))
|
||||
.addContent("class_name", fieldMap.get("运行记录").get("class_name").getContent(0))
|
||||
.addContent("method_name", fieldMap.get("运行记录").get("method_name").getContent(0))
|
||||
.addContent("error_step", fieldMap.get("运行记录").get("step").content.size() == 0 ? "" : fieldMap.get("运行记录").get("step").getContent(-1))
|
||||
.addContent("error_class", exception.getClass().getName())
|
||||
.addContent("error_information", exception.getMessage());
|
||||
|
@ -200,6 +220,20 @@ public class ExcelRecord extends AbstractWriteExcel<ExcelRecord> {
|
|||
return switchSheet("测试用例").addContent("condition", text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于添加测试用例的用例编号,不支持传入多个用例编号,每次调用方法后将覆盖之前传入的内容
|
||||
* @param text 用例编号
|
||||
* @return 类本身
|
||||
*/
|
||||
public ExcelRecord caseId(String text) {
|
||||
return switchSheet("测试用例")
|
||||
.clearContent("case_id")
|
||||
.addContent("case_id", text)
|
||||
.switchSheet("运行记录")
|
||||
.clearContent("case_id")
|
||||
.addContent("case_id", text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于添加测试用例的标题,不支持传入多个标题,每次调用方法后将覆盖之前传入的内容
|
||||
* @param text 标题
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package pres.auxiliary.work.selenium.xml;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>ElementData.java</p>
|
||||
* <p><b>用途:</b>
|
||||
* 用于存储页面元素的基本信息,以便于在查找中进行使用
|
||||
* </p>
|
||||
* <p><b>编码时间:</b>2020年9月27日上午7:50:44</p>
|
||||
* <p><b>修改时间:</b>2020年9月27日上午7:50:44</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
*
|
||||
*/
|
||||
public class ElementData {
|
||||
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue