完成测试用例类基本方法开发,顺带编写三个用例添加方法
This commit is contained in:
parent
8a8582e71e
commit
f695260052
|
@ -361,19 +361,16 @@
|
|||
<except id='1' value='*{成功预期前文}**{信息}*创建成功,界面返回到列表页,其*{信息}*列表上显示新增的信息*{成功预期后文}*'/>
|
||||
</excepts>
|
||||
<titles>
|
||||
<title id='1' value='新增不同*{控件名称}*的*{信息}*' />
|
||||
<title id='1' value='添加信息完整的的*{信息}*' />
|
||||
</titles>
|
||||
<preconditions>
|
||||
<precondition id='1' value='已在新增*{信息}*的页面上' />
|
||||
<precondition id='2' value='除*{控件名称}*外,其他信息均正确填写' />
|
||||
</preconditions>
|
||||
<ranks>
|
||||
<rank id='1' value='1' />
|
||||
<rank id='2' value='2' />
|
||||
<rank id='3' value='3' />
|
||||
</ranks>
|
||||
<keys>
|
||||
<key id='1' value='*{控件名称}*、*{信息}*、新增' />
|
||||
<key id='1' value='*{信息}*、新增' />
|
||||
</keys>
|
||||
</case>
|
||||
|
||||
|
@ -388,19 +385,16 @@
|
|||
<except id='2' value='*{失败预期前文}**{信息}*创建失败,并给出相应的提示*{失败预期后文}*'/>
|
||||
</excepts>
|
||||
<titles>
|
||||
<title id='1' value='新增不同*{控件名称}*的*{信息}*' />
|
||||
<title id='1' value='添加信息不完整的*{信息}*' />
|
||||
</titles>
|
||||
<preconditions>
|
||||
<precondition id='1' value='已在新增*{信息}*的页面上' />
|
||||
<precondition id='2' value='除*{控件名称}*外,其他信息均正确填写' />
|
||||
</preconditions>
|
||||
<ranks>
|
||||
<rank id='1' value='1' />
|
||||
<rank id='2' value='2' />
|
||||
<rank id='3' value='3' />
|
||||
</ranks>
|
||||
<keys>
|
||||
<key id='1' value='*{控件名称}*、*{信息}*、新增' />
|
||||
<key id='1' value='*{信息}*、新增' />
|
||||
</keys>
|
||||
</case>
|
||||
</cases>
|
|
@ -22,7 +22,6 @@ import org.dom4j.io.SAXReader;
|
|||
*
|
||||
*/
|
||||
public abstract class Case {
|
||||
|
||||
/**
|
||||
* 步骤
|
||||
*/
|
||||
|
@ -75,14 +74,18 @@ public abstract class Case {
|
|||
/**
|
||||
* 存储xml文件中其需要替换的词语
|
||||
*/
|
||||
HashMap<String, String> textMap = new HashMap<String, String>();
|
||||
HashMap<String, String> wordMap = new HashMap<String, String>(16);
|
||||
|
||||
/**
|
||||
* 存储字段的文本内容
|
||||
*/
|
||||
HashMap<String, ArrayList<String>> fieldTextMap = new HashMap<String, ArrayList<String>>(16);
|
||||
|
||||
/**
|
||||
* 根据用例xml文件来构造Case类
|
||||
* @param configXmlFile xml配置文件
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Case(File configXmlFile) {
|
||||
// 判断传入的configurationFile是否为一个文件类对象,若非文件类对象,则抛出异常
|
||||
try {
|
||||
|
@ -93,6 +96,8 @@ public abstract class Case {
|
|||
|
||||
//查找并存储替换的词语
|
||||
saveWord();
|
||||
//保存字段的词语
|
||||
saveField();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,11 +203,11 @@ public abstract class Case {
|
|||
*/
|
||||
public void setReplaceWord(String word, String text) {
|
||||
//判断该词语是否存在于textMap中,若不存在,则抛出异常
|
||||
if (!textMap.containsKey(word)) {
|
||||
if (!wordMap.containsKey(word)) {
|
||||
throw new IncorrectFileException("未找到需要替换的词语:" + word);
|
||||
}
|
||||
//存储替换的词语
|
||||
textMap.put(word, text);
|
||||
wordMap.put(word, text);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,7 +254,7 @@ public abstract class Case {
|
|||
//存储待替换的变量名
|
||||
String var = sb.substring(index + START_SIGN.length(), sb.indexOf(END_SIGN));
|
||||
//替换该变量名
|
||||
sb.replace(index, sb.indexOf(END_SIGN) + END_SIGN.length(), textMap.get(var));
|
||||
sb.replace(index, sb.indexOf(END_SIGN) + END_SIGN.length(), wordMap.get(var));
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
@ -285,8 +290,8 @@ public abstract class Case {
|
|||
throw new LabelNotFoundException("不存在的标签:<" + label.getName() + " " + labelIdAttribute + "='" + id +"'...>");
|
||||
}
|
||||
|
||||
//返回处理替换的单词后相应的文本,若集合存在多个元素,则只取第一个元素
|
||||
return textElement.attributeValue(labelValueAttribute);
|
||||
//返回处理替换的单词后相应的文本
|
||||
return replaceText(textElement.attributeValue(labelValueAttribute));
|
||||
|
||||
}
|
||||
|
||||
|
@ -297,7 +302,7 @@ public abstract class Case {
|
|||
* @return 标签中存储的文本,并进行处理
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
String[] getAllLabelText(String caseName, LabelType label) {
|
||||
ArrayList<String> getAllLabelText(String caseName, LabelType label) {
|
||||
//定位case标签的名称属性名
|
||||
String caseLabelNameAttribute = "name";
|
||||
//定位相应标签中存储用例内容的属性
|
||||
|
@ -311,10 +316,10 @@ public abstract class Case {
|
|||
//获取所有的节点
|
||||
List<Element> textElements = configXml.selectNodes(xpath);
|
||||
//存储节点中的value属性内的文本
|
||||
String[] texts = new String[textElements.size()];
|
||||
ArrayList<String> texts = new ArrayList<String>();
|
||||
//存储节点值
|
||||
for (int i = 0; i < textElements.size(); i++) {
|
||||
texts[i] = textElements.get(i).attributeValue(labelValueAttribute);
|
||||
texts.add(replaceText(textElements.get(i).attributeValue(labelValueAttribute)));
|
||||
}
|
||||
|
||||
return texts;
|
||||
|
@ -328,7 +333,7 @@ public abstract class Case {
|
|||
//定义能获取到文本的属性,以便于后续的调整
|
||||
String textAttribute = "value";
|
||||
|
||||
//获取xml中包含value的元素,并将其中包含需要替换的词语存储至textMap\
|
||||
//获取xml中包含value的元素,并将其中包含需要替换的词语存储至wordMap
|
||||
List<Element> textElement = configXml.selectNodes("//*[@" + textAttribute + "]");
|
||||
textElement.stream().
|
||||
//获取元素的value属性,将其转换为文本对象
|
||||
|
@ -339,8 +344,58 @@ public abstract class Case {
|
|||
Arrays.asList(e.split(START_SIGN_REGIX)).stream().filter(s -> s.indexOf(END_SIGN) > -1).
|
||||
forEach(s -> {
|
||||
//将需要存储的替换词语存入textMap中
|
||||
textMap.put(s.substring(0, s.indexOf(END_SIGN)), "");
|
||||
wordMap.put(s.substring(0, s.indexOf(END_SIGN)), "");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于保存xml文件中的字段
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
void saveField() {
|
||||
//获取case标签下所有的标签,存储至fieldTextMap,以初始化所有的字段名称
|
||||
((List<Element>) (configXml.getRootElement().elements("case"))).forEach(caseElement -> {
|
||||
((List<Element>) caseElement.elements()).forEach(labelElement -> {
|
||||
//去掉末尾的s
|
||||
String name = labelElement.getName();
|
||||
fieldTextMap.put(name.substring(0, name.length() - 1), new ArrayList<String>());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于添加一行文本
|
||||
* @param label 标签名称(枚举)
|
||||
* @param text 相应内容
|
||||
*/
|
||||
void addFieldText(LabelType label, String text) {
|
||||
fieldTextMap.get(label.getName()).add(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于整体替换当前存储的内容
|
||||
* @param label 标签名称(枚举)
|
||||
* @param texts 一组内容
|
||||
*/
|
||||
void addFieldText(LabelType label, ArrayList<String> texts) {
|
||||
fieldTextMap.put(label.getName(), texts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于清空字段的内容,以避免存储上一次输入的用例
|
||||
*/
|
||||
void clearFieldText() {
|
||||
fieldTextMap.forEach((key, value) -> {
|
||||
fieldTextMap.get(key).clear();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回字段内容Map,测试使用
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String, ArrayList<String>> getFieldTextMap() {
|
||||
return fieldTextMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,5 +61,4 @@ public enum FieldType {
|
|||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package pres.auxiliary.work.n.tcase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.testcase.writecase.InputType;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>InformationCase.java</p>
|
||||
|
@ -58,16 +55,16 @@ public class InformationCase extends Case {
|
|||
//若传入的参数为成功或失败预期的前文时,则在文本后加上逗号
|
||||
if (SUCCESS_EXCEPT_TEXT_START.equals(word) || FAIL_EXCEPT_TEXT_START.equals(word)) {
|
||||
//判断文本最后一个字符是否为逗号,若不是逗号,则将逗号拼接上
|
||||
if (text.lastIndexOf(",") == text.length() - 1) {
|
||||
text += ",";
|
||||
if (text.lastIndexOf(",") != text.length() - 1) {
|
||||
text += ",";
|
||||
}
|
||||
}
|
||||
|
||||
//若传入的参数为成功或失败预期的后文时,则在文本前加上逗号
|
||||
if (SUCCESS_EXCEPT_TEXT_END.equals(word) || FAIL_EXCEPT_TEXT_END.equals(word)) {
|
||||
//判断文本第一个字符是否为逗号,若不是逗号,则将逗号拼接上
|
||||
if (text.indexOf(",") == 0) {
|
||||
text = "," + text;
|
||||
if (text.indexOf(",") != 0) {
|
||||
text = "," + text;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,44 +72,119 @@ public class InformationCase extends Case {
|
|||
}
|
||||
|
||||
/**
|
||||
* 该方法用于生成正确填写所有信息的用例
|
||||
* 用于生成正确填写所有信息的用例
|
||||
*
|
||||
* @return Tab对象
|
||||
* @throws IOException
|
||||
* @return 类本身
|
||||
*/
|
||||
public Case addWholeInformationCase() throws IOException {
|
||||
public Case addWholeInformationCase() {
|
||||
//清空字段的内容
|
||||
clearFieldText();
|
||||
// 存储case标签的name属性内容
|
||||
String caseName = "addWholeInformationCase";
|
||||
|
||||
//存储标题信息
|
||||
String title = replaceText(getText(caseName, LabelType.TITLE, 1));
|
||||
addFieldText(LabelType.TITLE, getAllLabelText(caseName, LabelType.TITLE));
|
||||
//存储步骤信息
|
||||
ArrayList<String> step = new ArrayList<>();
|
||||
addFieldText(LabelType.STEP, getAllLabelText(caseName, LabelType.STEP));
|
||||
//存储预期信息
|
||||
addFieldText(LabelType.EXCEPT, getAllLabelText(caseName, LabelType.EXCEPT));
|
||||
//存储前置条件信息
|
||||
addFieldText(LabelType.PRECONDITION, getAllLabelText(caseName, LabelType.PRECONDITION));
|
||||
//存储关键词信息
|
||||
addFieldText(LabelType.KEY, getAllLabelText(caseName, LabelType.KEY));
|
||||
//存储优先级信息
|
||||
addFieldText(LabelType.RANK, getAllLabelText(caseName, LabelType.RANK));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 该方法用于生成不完全填写所有信息的用例
|
||||
*
|
||||
* @return 类本身
|
||||
*/
|
||||
public Case addUnWholeInformationCase() {
|
||||
//清空字段的内容
|
||||
clearFieldText();
|
||||
// 存储case标签的name属性内容
|
||||
String caseName = "addUnWholeInformationCase";
|
||||
|
||||
// 存储需要使用的变量
|
||||
textMap.put("buttonName", getButtonName());
|
||||
// 用于存储读取测试用例的id号
|
||||
ArrayList<Integer> l = new ArrayList<>();
|
||||
|
||||
// 清空步骤与预期中存储的信息
|
||||
//st.delete(0, st.length());
|
||||
ex.delete(0, ex.length());
|
||||
|
||||
// 用于存储步骤数
|
||||
int step = 1;
|
||||
|
||||
// 添加步骤
|
||||
l.add(1);
|
||||
// st.append(step + ".正确填写所有的信息,点击“" + getButtonName() + "”按钮\r\n");
|
||||
ex.append(step++ + "." + successExpectation.toString() + "\r\n");
|
||||
|
||||
// 将ArrayList转换成数组
|
||||
int[] id = new int[l.size()];
|
||||
for (int i = 0; i < l.size(); i++) {
|
||||
id[i] = l.get(i);
|
||||
//存储标题信息
|
||||
addFieldText(LabelType.TITLE, getAllLabelText(caseName, LabelType.TITLE));
|
||||
|
||||
//存储步骤与预期信息
|
||||
//不填写任何信息
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "1"));
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, "2"));
|
||||
//只填写所有的必填项信息
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "2"));
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, "1"));
|
||||
//只填写所有的非必填项信息
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "3"));
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, "2"));
|
||||
|
||||
//存储前置条件信息
|
||||
addFieldText(LabelType.PRECONDITION, getAllLabelText(caseName, LabelType.PRECONDITION));
|
||||
//存储关键词信息
|
||||
addFieldText(LabelType.KEY, getAllLabelText(caseName, LabelType.KEY));
|
||||
//存储优先级信息
|
||||
addFieldText(LabelType.RANK, getAllLabelText(caseName, LabelType.RANK));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 该方法用于生成正确填写所有信息的用例
|
||||
*
|
||||
* @return 类本身
|
||||
*/
|
||||
public Case addBasicTextboxCase(String name, boolean isMust, boolean isRepeat, InputRuleType... inputRuleTypes) {
|
||||
//清空字段的内容
|
||||
clearFieldText();
|
||||
// 存储case标签的name属性内容
|
||||
String caseName = "addTextboxCase";
|
||||
//添加控件名称
|
||||
wordMap.put("控件名称", name);
|
||||
//转换输入限制为集合类型
|
||||
List<InputRuleType> inputRules = Arrays.asList(inputRuleTypes);
|
||||
|
||||
//存储标题信息
|
||||
addFieldText(LabelType.TITLE, getLabelText(caseName, LabelType.TITLE, "1"));
|
||||
|
||||
//存储步骤与预期信息
|
||||
//不填写或只输入空格
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "1"));
|
||||
//根据是否必填来判断填入成功或失败预期
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, isMust ? "2" : "1"));
|
||||
|
||||
//填写特殊字符或HTML代码
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "2"));
|
||||
//根据是否存在输入
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, inputRules.size() == 0 || inputRules.contains(InputRuleType.SPE) ? "1" : "2"));
|
||||
|
||||
//输入非限制的字符
|
||||
if (inputRules.size() != 0) {
|
||||
String inputRuleText = "";
|
||||
for (InputRuleType inputRule : inputRules) {
|
||||
inputRuleText += (inputRule.getName() + "、");
|
||||
}
|
||||
wordMap.put("输入限制", inputRuleText.substring(0, inputRuleText.length() - 1));
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "3"));
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, "2"));
|
||||
}
|
||||
return after(("添加信息完整的" + getInformationName()), new StringBuilder(getStep(methodName, id)[0]), ex, ("信息完整," + getInformationName()), 1,
|
||||
getPrecondition());
|
||||
|
||||
//填写存在的内容
|
||||
addFieldText(LabelType.STEP, getLabelText(caseName, LabelType.STEP, "12"));
|
||||
//根据是否必填来判断填入成功或失败预期
|
||||
addFieldText(LabelType.EXCEPT, getLabelText(caseName, LabelType.EXCEPT, isRepeat ? "2" : "1"));
|
||||
|
||||
//存储前置条件信息
|
||||
addFieldText(LabelType.PRECONDITION, getAllLabelText(caseName, LabelType.PRECONDITION));
|
||||
//存储关键词信息
|
||||
addFieldText(LabelType.KEY, getAllLabelText(caseName, LabelType.KEY));
|
||||
//存储优先级信息
|
||||
addFieldText(LabelType.RANK, getLabelText(caseName, LabelType.RANK, isMust ? "1" : "2"));
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package pres.auxiliary.work.n.tcase;
|
|||
|
||||
/**
|
||||
* <p><b>文件名:</b>LabelType.java</p>
|
||||
* <p><b>用途:</b>定义Label标签的名称枚举,用于定位获取的标签内容</p>
|
||||
* <p><b>用途:</b>定义测试用例xml文件中标签的名称枚举,用于定位获取的标签内容</p>
|
||||
* <p><b>编码时间:</b>2020年3月12日下午6:49:22</p>
|
||||
* <p><b>修改时间:</b>2020年3月12日下午6:49:22</p>
|
||||
* @author 彭宇琦
|
||||
|
|
|
@ -2,20 +2,64 @@ package pres.auxiliary.work.testcase;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.n.tcase.InformationCase;
|
||||
import pres.auxiliary.work.n.tcase.InputRuleType;
|
||||
|
||||
public class InformationCaseTest {
|
||||
InformationCase ic = new InformationCase(new File("ConfigurationFiles/CaseConfigurationFile/CaseTemplet/AddInformation.xml"));
|
||||
InformationCase ic = new InformationCase(new File("ConfigurationFiles/CaseConfigurationFile/CaseTemplet/AddInformation.xml"));
|
||||
|
||||
@BeforeMethod
|
||||
@BeforeClass
|
||||
public void start() {
|
||||
ic.setReplaceWord(InformationCase.BUTTON_NAME, "普通");
|
||||
ic.setReplaceWord(InformationCase.BUTTON_NAME, "保存");
|
||||
ic.setReplaceWord(InformationCase.ADD_INFORMATION, "用户列表");
|
||||
ic.setReplaceWord(InformationCase.FAIL_EXCEPT_TEXT_START, "测试失败预期前文");
|
||||
ic.setReplaceWord(InformationCase.FAIL_EXCEPT_TEXT_END, "测试失败预期后文");
|
||||
ic.setReplaceWord(InformationCase.SUCCESS_EXCEPT_TEXT_START, "测试成功预期前文");
|
||||
ic.setReplaceWord(InformationCase.SUCCESS_EXCEPT_TEXT_END, "测试成功预期后文");
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void outputInformation() {
|
||||
System.out.println("------------------------------");
|
||||
ic.getFieldTextMap().forEach((k, v) -> {
|
||||
System.out.println(k + ":");
|
||||
v.forEach(System.out :: println);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addWholeInformationCase()}方法
|
||||
*/
|
||||
@Test
|
||||
public void getTextTest() {
|
||||
public void addWholeInformationCaseTest() {
|
||||
ic.addWholeInformationCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addUnWholeInformationCase()}方法
|
||||
*/
|
||||
@Test
|
||||
public void addUnWholeInformationCaseTest() {
|
||||
ic.addUnWholeInformationCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addBasicTextboxCase(String, boolean, boolean, pres.auxiliary.work.n.tcase.InputRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addBasicTextboxCaseTest_NotRule() {
|
||||
ic.addBasicTextboxCase("测试控件1", true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addBasicTextboxCase(String, boolean, boolean, pres.auxiliary.work.n.tcase.InputRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addBasicTextboxCaseTest_HaveRule() {
|
||||
ic.addBasicTextboxCase("测试控件2", false, true, InputRuleType.EN, InputRuleType.NUM);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ import org.testng.annotations.Test;
|
|||
import pres.auxiliary.work.n.tcase.FieldType;
|
||||
import pres.auxiliary.work.n.tcase.MarkColorsType;
|
||||
import pres.auxiliary.work.n.tcase.TestCaseTemplet;
|
||||
import pres.auxiliary.work.n.tcase.WriteTestCase;
|
||||
import pres.auxiliary.work.n.tcase.WriteTestCase.CaseMark;
|
||||
import pres.auxiliary.work.n.tcase.TestCaseWrite;
|
||||
import pres.auxiliary.work.n.tcase.TestCaseWrite.CaseMark;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -38,7 +38,7 @@ import pres.auxiliary.work.n.tcase.WriteTestCase.CaseMark;
|
|||
*
|
||||
*/
|
||||
public class WriteTestCaseTest {
|
||||
WriteTestCase wtc;
|
||||
TestCaseWrite wtc;
|
||||
|
||||
/**
|
||||
* 配置文件类对象
|
||||
|
@ -55,7 +55,7 @@ public class WriteTestCaseTest {
|
|||
temp.setCoverFile(true);
|
||||
temp.create();
|
||||
|
||||
wtc = new WriteTestCase(conFile, tempFile);
|
||||
wtc = new TestCaseWrite(conFile, tempFile);
|
||||
|
||||
wtc.setPresupposeField(FieldType.EXPECT, "预期");
|
||||
wtc.setPresupposeField(FieldType.PRECONDITION, "前置条件");
|
||||
|
@ -104,7 +104,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#addContent(String, String)}方法
|
||||
* 测试{@link TestCaseWrite#addContent(String, String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addContentTest() {
|
||||
|
@ -112,7 +112,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#setPresupposeField(FieldType, String)}方法
|
||||
* 测试{@link TestCaseWrite#setPresupposeField(FieldType, String)}方法
|
||||
*/
|
||||
@Test(enabled = false)
|
||||
public void setPresupposeFieldTest() {
|
||||
|
@ -124,7 +124,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#setRank(String...)}方法
|
||||
* 测试{@link TestCaseWrite#setRank(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void setRankTest() {
|
||||
|
@ -133,7 +133,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#addStep(String...)}方法
|
||||
* 测试{@link TestCaseWrite#addStep(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addStepTest() {
|
||||
|
@ -141,7 +141,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#addExcept(String...)}方法
|
||||
* 测试{@link TestCaseWrite#addExcept(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addExceptTest() {
|
||||
|
@ -149,7 +149,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#addPrecondition(String...)}方法
|
||||
* 测试{@link TestCaseWrite#addPrecondition(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addPreconditionTest() {
|
||||
|
@ -157,7 +157,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#addTitle(String)}方法
|
||||
* 测试{@link TestCaseWrite#addTitle(String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addTitleTest() {
|
||||
|
@ -165,7 +165,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#addRank(int)}方法
|
||||
* 测试{@link TestCaseWrite#addRank(int)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addRankTest_NotData() {
|
||||
|
@ -175,7 +175,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#end()}方法
|
||||
* 测试{@link TestCaseWrite#end()}方法
|
||||
*/
|
||||
@Test
|
||||
public void endTest() {
|
||||
|
@ -189,7 +189,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link WriteTestCase#setReplactWord(String, String)}方法
|
||||
* 测试{@link TestCaseWrite#setReplactWord(String, String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void setReplactWordTest() {
|
||||
|
|
|
@ -11,10 +11,10 @@ import org.testng.annotations.Test;
|
|||
import pres.auxiliary.work.n.tcase.FieldType;
|
||||
import pres.auxiliary.work.n.tcase.MarkColorsType;
|
||||
import pres.auxiliary.work.n.tcase.TestCaseTemplet;
|
||||
import pres.auxiliary.work.n.tcase.WriteTestCase;
|
||||
import pres.auxiliary.work.n.tcase.TestCaseWrite;
|
||||
|
||||
public class WriteTestCaseTest_WriteCase {
|
||||
WriteTestCase wtc;
|
||||
TestCaseWrite wtc;
|
||||
|
||||
/**
|
||||
* 配置文件类对象
|
||||
|
@ -31,7 +31,7 @@ public class WriteTestCaseTest_WriteCase {
|
|||
temp.setCoverFile(true);
|
||||
temp.create();
|
||||
|
||||
wtc = new WriteTestCase(conFile, tempFile);
|
||||
wtc = new TestCaseWrite(conFile, tempFile);
|
||||
|
||||
wtc.setPresupposeField(FieldType.EXPECT, "预期");
|
||||
wtc.setPresupposeField(FieldType.PRECONDITION, "前置条件");
|
||||
|
|
Loading…
Reference in New Issue