|
@@ -314,6 +314,7 @@ bool CSATExecutor::NotifyTaskStart(SATHTTP::STTask* pTask)
|
|
|
stNotifyJobStartReq.strSignalImageUrl.append(pTask->strTaskName+"\\\\");
|
|
|
stNotifyJobStartReq.strSignalImageUrl.append(pTask->Job.strUniqueId+"\\\\");
|
|
|
stNotifyJobStartReq.strSignalImageUrl.append(pTask->Job.strDeviceId);
|
|
|
+ stNotifyJobStartReq.strSignalImageUrl = CharEncoding::ASCII2UTF8(stNotifyJobStartReq.strSignalImageUrl.c_str());
|
|
|
|
|
|
if ( SetResult(url, stNotifyJobStartReq, stNotifyJobStartResp) )
|
|
|
{
|
|
@@ -408,8 +409,8 @@ bool CSATExecutor::ReportCaseItemFinish(SATHTTP::STTask* pTask, SATHTTP::STCase
|
|
|
SATHTTP::STJobProcessReq stJobProcessReq;
|
|
|
SATHTTP::STJobProcessResp stJobProcessResp;
|
|
|
|
|
|
- // 根据测试项结果决定测试项成功与否;
|
|
|
- stJobProcessReq.strResultState = caseItem.result ? "1" : "0";
|
|
|
+ // 0 表示测试项Pass, 1 表示测试项Fail;
|
|
|
+ stJobProcessReq.strResultState = caseItem.result ? "0" : "1";
|
|
|
// 如果测试项失败,标记用例和任务失败;
|
|
|
if ( !caseItem.result ) {
|
|
|
pCase->_nExecutionResult = SATHTTP::FAIL;
|
|
@@ -504,7 +505,7 @@ bool CSATExecutor::ReportCaseItemFinish(SATHTTP::STTask* pTask, SATHTTP::STCase
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-bool CSATExecutor::ReportCaseFinish(SATHTTP::STTask* pTask, SATHTTP::STCase *pCase)
|
|
|
+bool CSATExecutor::ReportCaseFinish(SATHTTP::STTask* pTask, SATHTTP::STCase *pCase, std::string strRunnedActionNameList)
|
|
|
{
|
|
|
TCHAR szValue[MAX_PATH] = {0};
|
|
|
std::string url = GLOBAL::g_stSATConfig.szExecuteServer;
|
|
@@ -544,7 +545,7 @@ bool CSATExecutor::ReportCaseFinish(SATHTTP::STTask* pTask, SATHTTP::STCase *pCa
|
|
|
_itoa_s(pTask->nExecuteId, szValue, 10);
|
|
|
stJobProcessReq.strRunnerId = szValue;
|
|
|
stJobProcessReq.strCPUInfo = "0";
|
|
|
- stJobProcessReq.strRunnedActionNameList = "";
|
|
|
+ stJobProcessReq.strRunnedActionNameList = strRunnedActionNameList;
|
|
|
stJobProcessReq.strArtificialResult = "";
|
|
|
stJobProcessReq.strArtificialModify = "";
|
|
|
stJobProcessReq.strRunnerName = "";
|
|
@@ -622,15 +623,19 @@ bool CSATExecutor::ReportCaseResult(SATHTTP::STTask* pTask, SATHTTP::STCase *pCa
|
|
|
SATHTTP::STJobProcessReq stJobProcessReq;
|
|
|
SATHTTP::STJobProcessResp stJobProcessResp;
|
|
|
// 遍历所有用例测试项;
|
|
|
+ std::string strRunnedActionNameList;
|
|
|
std::vector<STCaseItem>::iterator it = vtCaseItem.begin();
|
|
|
- for (; it != vtCaseItem.end(); it++ )
|
|
|
+ for (; it != vtCaseItem.end();)
|
|
|
{
|
|
|
// 上报测试项结果(包含相片);
|
|
|
ReportCaseItemFinish(pTask, pCase, *it);
|
|
|
+ strRunnedActionNameList.append(it->name);
|
|
|
+ if ( ++it != vtCaseItem.end() )
|
|
|
+ strRunnedActionNameList.append("&");
|
|
|
}
|
|
|
|
|
|
// 上报用例完成;
|
|
|
- ReportCaseFinish(pTask, pCase);
|
|
|
+ ReportCaseFinish(pTask, pCase, strRunnedActionNameList);
|
|
|
|
|
|
// 上传用例日志;
|
|
|
UploadCaseLog(pTask, pCase);
|
|
@@ -711,7 +716,7 @@ bool CSATExecutor::ReportTaskStart(SATHTTP::STTask* pTask)
|
|
|
// 进度(###需要修改此处###);
|
|
|
stJobProcessReq.strProgress = "0";
|
|
|
// 需要将utf-8转gbk;
|
|
|
- stJobProcessReq.strReusltMessage = "任务开始";
|
|
|
+ stJobProcessReq.strReusltMessage = CharEncoding::ASCII2UTF8("任务开始");
|
|
|
stJobProcessReq.strJobRepeat = "";
|
|
|
stJobProcessReq.strScreenShot = "";
|
|
|
stJobProcessReq.strStartTime = pTask->strStartTime;
|
|
@@ -793,7 +798,7 @@ bool CSATExecutor::ReportTaskFinish(SATHTTP::STTask* pTask)
|
|
|
// 进度(###需要修改此处###);
|
|
|
stJobProcessReq.strProgress = "100";
|
|
|
// 需要将utf-8转gbk;
|
|
|
- stJobProcessReq.strReusltMessage = "任务结束";
|
|
|
+ stJobProcessReq.strReusltMessage = CharEncoding::ASCII2UTF8("任务结束");
|
|
|
stJobProcessReq.strJobRepeat = "0";
|
|
|
stJobProcessReq.strScreenShot = "";
|
|
|
stJobProcessReq.strStartTime = pTask->strStartTime;
|
|
@@ -862,7 +867,10 @@ bool CSATExecutor::GetCaseXMLResult(std::string xmlpath, std::vector<STCaseItem>
|
|
|
}
|
|
|
else if (_tcsicmp(pItem->Value(), _T("result")) == 0)
|
|
|
{
|
|
|
- cItem.result = pItem->BoolText();
|
|
|
+ if ( _tcsicmp(pItem->GetText(), _T("Pass")) == 0 )
|
|
|
+ cItem.result = true;
|
|
|
+ else
|
|
|
+ cItem.result = false;
|
|
|
}
|
|
|
else if (_tcsicmp(pItem->Value(), _T("data")) == 0)
|
|
|
{
|