1:增加web调试接口日志

2:增加日志接口
This commit is contained in:
seagull 2017-09-25 11:34:23 +08:00
parent 59a4df6be4
commit 4accdc0521
3 changed files with 32 additions and 0 deletions

View File

@ -180,6 +180,7 @@ public class WebTestCaseDebug{
String ExpectedResultVariable = casescript.get("ExpectedResults").toString().substring(2); String ExpectedResultVariable = casescript.get("ExpectedResults").toString().substring(2);
String temptestnote = InvokeMethod.CallCase(packagename,functionname,getParameterValues,steps.get(i).getSteptype(),steps.get(i).getAction()); String temptestnote = InvokeMethod.CallCase(packagename,functionname,getParameterValues,steps.get(i).getSteptype(),steps.get(i).getAction());
variable.put(ExpectedResultVariable, temptestnote); variable.put(ExpectedResultVariable, temptestnote);
GetServerAPI.cPostDebugLog(sign, executor, "INFO", "赋值变量【"+expectedresults.substring(2, expectedresults.length())+"】: "+temptestnote);
}else if(expectedresults.length()>2 && expectedresults.substring(0, 2).indexOf("%=")>-1){ //°ÑÔ¤ÆÚ½á¹ûÓë²âÊÔ½á¹û×öÄ£ºýÆ¥Åä }else if(expectedresults.length()>2 && expectedresults.substring(0, 2).indexOf("%=")>-1){ //°ÑÔ¤ÆÚ½á¹ûÓë²âÊÔ½á¹û×öÄ£ºýÆ¥Åä
testnote = InvokeMethod.CallCase(packagename,functionname,getParameterValues,steps.get(i).getSteptype(),steps.get(i).getAction()); testnote = InvokeMethod.CallCase(packagename,functionname,getParameterValues,steps.get(i).getSteptype(),steps.get(i).getAction());
if(testnote.indexOf(expectedresults.substring(2))>-1){ if(testnote.indexOf(expectedresults.substring(2))>-1){

View File

@ -439,6 +439,28 @@ public class LogOperation {
return Integer.parseInt(sqlresult); return Integer.parseInt(sqlresult);
} }
/*
* 查询任务中用例步骤日志预期结果
* 2017-09-16
*/
public static String getlogdetail_expectresult(int taskid,String caseno,int casestatus) {
String sqlresult="";
try {
sqlresult = dbt.executeQuery("select detail from test_logdetail where logid=(select MIN(logid) from test_logdetail "
+ "where loggrade='error' and taskid="+taskid+" and caseid=(select id from test_casedetail where taskid="+taskid
+ " and caseno='"+caseno+"' and casestatus='"+casestatus+"'))");
if(sqlresult.indexOf("预期结果:")<=0||sqlresult.indexOf("%")<=0){
return sqlresult;
}
sqlresult = sqlresult.substring(sqlresult.indexOf("预期结果:")+5,sqlresult.lastIndexOf("测试结果:")-1);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return sqlresult;
}
return sqlresult;
}
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }

View File

@ -416,6 +416,15 @@ public class TestCaseApi extends TestLinkBaseApi {
System.out.println(testplan+"中的用例已经全部生成完毕!"); System.out.println(testplan+"中的用例已经全部生成完毕!");
} }
/**
* 获取指定任务名称以及用例号报错日志中的执行预期结果
* casestatus说明 pass:0 fail:1 lock:2 unexcute:4
*/
public static String getLogdetail_Expectresult(String taskname,String caseno,int casestatus){
int taskid = LogOperation.gettaskexcute_taskid(taskname);
return LogOperation.getlogdetail_expectresult(taskid, caseno,casestatus);
}
public static void main(String[] args){ public static void main(String[] args){
// TODO Auto-generated method stub // TODO Auto-generated method stub
try { try {