From e8b2344122c4ba928db758550e6e90c7237f2ad1 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 21 Oct 2021 13:06:02 +0800 Subject: [PATCH] * Adjust cases of testcase. --- test/api/testcases/getlist.php | 13 ++++++++----- test/data/project.yaml | 2 -- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/api/testcases/getlist.php b/test/api/testcases/getlist.php index 4ba8977926..798d71d6dc 100644 --- a/test/api/testcases/getlist.php +++ b/test/api/testcases/getlist.php @@ -18,14 +18,17 @@ pid=1 global $token; $header = array('Token' => $token->token); -$existProductCases = $rest->get('/products/2/testcases?page=1&limit=100&order=id_asc', $header); -$noProductCases = $rest->get('/products/1000/testcases?page=1&limit=10&order=id_asc', $header); +$existProductCases = $rest->get('/products/2/testcases?page=1&limit=100&order=id_asc', $header); +$notExistProductCases = $rest->get('/products/1000/testcases?page=1&limit=10&order=id_asc', $header); +$noProductCases = $rest->get('/products/0/testcases', $header); -r($existProductCases->status_code) && p() && e('200'); // 使用正确产品id查询用例列表的状态码 -r($noProductCases->status_code) && p() && e('200'); // 使用不存在的产品id查询用例列表的状态码 +r($existProductCases->status_code) && p() && e('200'); // 使用正确产品id查询用例列表的状态码 +r($notExistProductCases->status_code) && p() && e('200'); // 使用不存在的产品id查询用例列表的状态码 + +r($noProductCases) && c(400) && p('error') && e('"Need product or project or execution id.'); // 使用产品id为0查询用例列表的状态码 $existCases = $existProductCases->body->testcases; -$emptyCases = $noProductCases->body->testcases; +$emptyCases = $notExistProductCases->body->testcases; r(count($existCases)) && p() && e('50'); // 使用正确产品id获取用例列表的数量 r(count($emptyCases)) && p() && e('0'); // 使用不存在的产品id获取用例列表的数量 diff --git a/test/data/project.yaml b/test/data/project.yaml index 2925f265e3..cbe6402a19 100644 --- a/test/data/project.yaml +++ b/test/data/project.yaml @@ -10,8 +10,6 @@ fields: range: - field: type range: project - - field: product - range: single - field: lifetime range: - field: budget