diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index 53e1b9e36b..a22a1f8911 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -220,7 +220,8 @@ $lang->testcase->resultList['blocked'] = 'Blocked'; $lang->testcase->buttonToList = 'Back'; -$lang->testcase->stepsEmpty = 'Case step %s cannot be empty.'; +$lang->testcase->whichLine = 'Line No.%s : '; +$lang->testcase->stepsEmpty = 'Step %s cannot be empty.'; $lang->testcase->errorEncode = 'No data. Please select right encoding and upload again!'; $lang->testcase->noFunction = 'Iconv and mb_convert_encoding are not found. You cannot convert the data to the encoding you want!'; $lang->testcase->noRequire = "Row %s has“%s ”which is a required field and it should not be blank."; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 6bc7ae8827..49ee34858f 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -220,7 +220,8 @@ $lang->testcase->resultList['blocked'] = '阻塞'; $lang->testcase->buttonToList = '返回'; -$lang->testcase->stepsEmpty = '用例步骤%s不能为空'; +$lang->testcase->whichLine = '第%s行'; +$lang->testcase->stepsEmpty = '步骤%s不能为空'; $lang->testcase->errorEncode = '无数据,请选择正确的编码重新上传!'; $lang->testcase->noFunction = '不存在iconv和mb_convert_encoding转码方法,不能将数据转成想要的编码!'; $lang->testcase->noRequire = "%s行的“%s”是必填字段,不能为空"; diff --git a/module/testcase/model.php b/module/testcase/model.php index 95432a43ab..51504e3f0a 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1225,6 +1225,19 @@ class testcaseModel extends model $branch = (int)$branch; $data = fixer::input('post')->get(); + $steps = $data->desc; + foreach($data->expect as $key => $expects) + { + foreach($expects as $exportID => $value) + { + if(!empty($value) and (!isset($steps[$key][$exportID]) or empty($steps[$key][$exportID]))) + { + dao::$errors = sprintf($this->lang->testcase->whichLine, $key) . sprintf($this->lang->testcase->stepsEmpty, $exportID); + return false; + } + } + } + if(!empty($_POST['id'])) { $oldSteps = $this->dao->select('t2.*')->from(TABLE_CASE)->alias('t1')