* [task#131194,done,2h] Modify function amd xpath.
This commit is contained in:
@@ -4,7 +4,7 @@ class grouptaskTester extends tester
|
||||
{
|
||||
/**
|
||||
* 检查全部展开时分组下数据。
|
||||
* Check the data of the group.、
|
||||
* Check the data of the group.
|
||||
*
|
||||
* @param string $groupData story|status|pri|assignedTo|finishedBy|closedBy|type
|
||||
* @param array $nums
|
||||
@@ -13,15 +13,16 @@ class grouptaskTester extends tester
|
||||
*/
|
||||
public function checkGroupData($groupData, $nums)
|
||||
{
|
||||
$form = $this->initForm('execution', 'grouptask', array('execution' => '2', 'groupBy' => $groupData ), 'appIframe-execution');
|
||||
if($form->dom->group->getText() != $this->lang->task->noStory) return $this->failed('研发需求分类错误');
|
||||
if(filter_var($form->dom->tasks->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['tasks']) return $this->failed('总任务数目错误');
|
||||
if(filter_var($form->dom->waiting->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['waiting']) return $this->failed('未开始任务数目错误');
|
||||
if(filter_var($form->dom->doing->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['doing']) return $this->failed('进行中任务数目错误');
|
||||
if(filter_var($form->dom->estimates->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['estimates']) return $this->failed('总预计工时错误');
|
||||
if(filter_var($form->dom->cost->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['cost']) return $this->failed('已消耗工时错误');
|
||||
if(filter_var($form->dom->left->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['left']) return $this->failed('剩余工时错误');
|
||||
$this->success('数据正确');
|
||||
$form = $this->initForm('execution', 'grouptask', array('execution' => '2', 'groupBy' => $groupData ), 'appIframe-execution');
|
||||
preg_match_all('/\d+(?:\.\d+)?/', $form->dom->task->getText(), $matches);
|
||||
if($matches[0][0] != $nums['tasks']) return $this->failed('总任务数目错误');
|
||||
if($matches[0][1] != $nums['waiting']) return $this->failed('未开始任务数目错误');
|
||||
if($matches[0][2] != $nums['doing']) return $this->failed('进行中任务数目错误');
|
||||
preg_match_all('/\d+(?:\.\d+)?/', $form->dom->time->getText(), $params);
|
||||
if($params[0][0] != $nums['estimates']) return $this->failed('总预计工时错误');
|
||||
if($params[0][1] != $nums['cost']) return $this->failed('已消耗工时错误');
|
||||
if($params[0][2] != $nums['left']) return $this->failed('剩余工时错误');
|
||||
return $this->success('数据正确');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,14 +38,15 @@ class grouptaskTester extends tester
|
||||
$form = $this->initForm('execution', 'grouptask', array('execution' => '2', 'groupBy' => 'story' ), 'appIframe-execution');
|
||||
$form->dom->taskLinkedStoryBtn->click();
|
||||
$form->wait(1);
|
||||
if(filter_var($form->dom->group->getText(), FILTER_SANITIZE_NUMBER_INT) != $this->lang->task->noStory) return $this->failed('研发需求分类错误');
|
||||
if(filter_var($form->dom->tasks->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['tasks']) return $this->failed('总任务数目错误');
|
||||
if(filter_var($form->dom->waiting->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['waiting']) return $this->failed('未开始任务数目错误');
|
||||
if(filter_var($form->dom->doing->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['doing']) return $this->failed('进行中任务数目错误');
|
||||
if(filter_var($form->dom->estimates->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['estimates']) return $this->failed('总预计工时错误');
|
||||
if(filter_var($form->dom->cost->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['cost']) return $this->failed('已消耗工时错误');
|
||||
if(filter_var($form->dom->left->getText(), FILTER_SANITIZE_NUMBER_INT) != $nums['left']) return $this->failed('剩余工时错误');
|
||||
$this->success('数据正确');
|
||||
preg_match_all('/\d+(?:\.\d+)?/', $form->dom->task->getText(), $matches);
|
||||
if($matches[0][0] != $nums['tasks']) return $this->failed('总任务数目错误');
|
||||
if($matches[0][1] != $nums['waiting']) return $this->failed('未开始任务数目错误');
|
||||
if($matches[0][2] != $nums['doing']) return $this->failed('进行中任务数目错误');
|
||||
preg_match_all('/\d+(?:\.\d+)?/', $form->dom->time->getText(), $params);
|
||||
if($params[0][0] != $nums['estimates']) return $this->failed('总预计工时错误');
|
||||
if($params[0][1] != $nums['cost']) return $this->failed('已消耗工时错误');
|
||||
if($params[0][2] != $nums['left']) return $this->failed('剩余工时错误');
|
||||
return $this->success('数据正确');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,14 +62,12 @@ class grouptaskTester extends tester
|
||||
$form = $this->initForm('execution', 'grouptask', array('execution' => '2', 'groupBy' => 'story' ), 'appIframe-execution');
|
||||
$form->dom->collapseBtn->click();
|
||||
$form->wait(1);
|
||||
if($form->dom->rtasks->getText() != $nums['tasks']) return $this->failed('总任务数目错误');
|
||||
var_dump($form->dom->rdoing->getText());
|
||||
var_dump($nums['doing']);
|
||||
if($form->dom->rdoing->getText() != $nums['doing']) return $this->failed('进行中任务数目错误');
|
||||
if($form->dom->rwaiting->getText() != $nums['waiting']) return $this->failed('未开始任务数目错误');
|
||||
if($form->dom->restimates->getText() != $nums['estimates']) return $this->failed('总预计工时错误');
|
||||
if($form->dom->rcost->getText() != $nums['cost']) return $this->failed('已消耗工时错误');
|
||||
if($form->dom->rleft->getText() != $nums['left']) return $this->failed('剩余工时错误');
|
||||
$this->success('数据正确');
|
||||
if($form->dom->rtask->getText() != $nums['tasks']) return $this->failed('总任务数目错误');
|
||||
if($form->dom->rdoing->getText() != $nums['doing']) return $this->failed('进行中任务数目错误');
|
||||
if($form->dom->rwaiting->getText() != $nums['waiting']) return $this->failed('未开始任务数目错误');
|
||||
if($form->dom->restimates->getText() != $nums['estimates']) return $this->failed('总预计工时错误');
|
||||
if($form->dom->rcost->getText() != $nums['cost']) return $this->failed('已消耗工时错误');
|
||||
if($form->dom->rleft->getText() != $nums['left']) return $this->failed('剩余工时错误');
|
||||
return $this->success('数据正确');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,18 +180,19 @@ $nums = array(
|
||||
'tasks' => '6',
|
||||
'waiting' => '0',
|
||||
'doing' => '1',
|
||||
'estimates' => '6',
|
||||
'cost' => '33',
|
||||
'left' => '2',
|
||||
'estimates' => '6h',
|
||||
'cost' => '33h',
|
||||
'left' => '2h',
|
||||
)
|
||||
);
|
||||
|
||||
#r($tester->checkGroupData('story',$nums['story'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkGroupData('status',$nums['status'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkGroupData('pri',$nums['pri'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkGroupData('assignedTo',$nums['assignedTo'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkGroupData('finishedBy',$nums['finishedBy'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkGroupData('closedBy',$nums['closedBy'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkGroupData('type',$nums['type'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
#r($tester->checkTaskLinkedStory($nums['linked'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkCollapse($nums['collapse'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('story',$nums['story'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('status',$nums['status'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('pri',$nums['pri'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('assignedTo',$nums['assignedTo'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('finishedBy',$nums['finishedBy'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('closedBy',$nums['closedBy'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkGroupData('type',$nums['type'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkTaskLinkedStory($nums['linked'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
r($tester->checkCollapse($nums['collapse'])) && p('status,message') && e('SUCCESS,数据正确');
|
||||
$tester->closeBrowser();
|
||||
|
||||
@@ -1,35 +1,31 @@
|
||||
<?php
|
||||
class managemembersPage extends page
|
||||
class grouptaskPage extends page
|
||||
{
|
||||
public function __construct($webdriver)
|
||||
{
|
||||
parent::__construct($webdriver);
|
||||
$xpath = array(
|
||||
'taskLinkedStoryBtn' => "//*[@id='featureBar']/menu/li[4]/a/span",
|
||||
'taskLinkedStoryBtn' => "//*[@id='featureBar']/menu/li[4]/a/span", //已关联研发需求的任务按钮
|
||||
'collapseBtn' => "//*[@id='featureBar']/menu/li[1]/a/span", //全部折叠按钮
|
||||
/* 分组 */
|
||||
'dropdownBtn' => "//*[@id='tasksTable']/table/thead/tr/th[1]/button",
|
||||
'story' => "//*[@data-id='execution-grouptask']/../div[3]//li[1]",
|
||||
'status' => "//*[@data-id='execution-grouptask']/../div[3]//li[2]",
|
||||
'priority' => "//*[@data-id='execution-grouptask']/../div[3]//li[3]",
|
||||
'assignedTo' => "//*[@data-id='execution-grouptask']/../div[3]//li[4]",
|
||||
'finishedBy' => "//*[@data-id='execution-grouptask']/../div[3]//li[5]",
|
||||
'closedBy' => "//*[@data-id='execution-grouptask']/../div[3]//li[6]",
|
||||
'type' => "//*[@data-id='execution-grouptask']/../div[3]//li[7]"
|
||||
'story' => "//*[@data-id='execution-grouptask']/../div[3]//li[1]/a",
|
||||
'status' => "//*[@data-id='execution-grouptask']/../div[3]//li[2]/a",
|
||||
'priority' => "//*[@data-id='execution-grouptask']/../div[3]//li[3]/a",
|
||||
'assignedTo' => "//*[@data-id='execution-grouptask']/../div[3]//li[4]/a",
|
||||
'finishedBy' => "//*[@data-id='execution-grouptask']/../div[3]//li[5]/a",
|
||||
'closedBy' => "//*[@data-id='execution-grouptask']/../div[3]//li[6]/a",
|
||||
'type' => "//*[@data-id='execution-grouptask']/../div[3]//li[7]/a",
|
||||
/* 全部展开时左侧区块统计 */
|
||||
'group' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/a",
|
||||
'tasks' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[1]/strong",
|
||||
'waiting' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[1]/text()[2]",
|
||||
'doing' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[1]/text()[3]",
|
||||
'estimates' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[2]/strong",
|
||||
'cost' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[1]/text()[2]",
|
||||
'left' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[2]/text()[3]"
|
||||
'task' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[1]",
|
||||
'time' => "//*[@id='tasksTable']/table/tbody/tr[1]/td[1]/div/div/div[2]",
|
||||
/* 全部收起时右侧区块统计 */
|
||||
'rtasks' => "//tr[@class='group-summary group-toggle']/td[2]/div[1]/div[1]/div[1]/div[1]/div[2]",
|
||||
'rdoing' => "//tr[@class='group-summary group-toggle']/td[2]/div[1]/div[1]/div[1]/div[2]/div[2]/span",
|
||||
'rwaiting' => "//tr[@class='group-summary group-toggle']/td[2]/div[1]/div[1]/div[1]/div[3]/div[2]/span",
|
||||
'restimates' => "//tr[@class='group-summary group-toggle']/td[2]/div[1]/div[2]/div[1]/div[1]/div[2]",
|
||||
'rcost' => "//tr[@class='group-summary group-toggle']/td[2]/div[1]/div[2]/div[1]/div[2]/div[2]",
|
||||
'rleft' => "//tr[@class='group-summary group-toggle']/td[2]/div[1]/div[2]/div[1]/div[3]/div[2]"
|
||||
'rtask' => "//*[@id='tasksTable']/table/tbody/tr[7]/td[2]/div/div[1]/div/div[1]/div[2]",
|
||||
'rdoing' => "//*[@id='tasksTable']/table/tbody/tr[7]/td[2]/div/div[1]/div/div[2]/div[2]",
|
||||
'rwaiting' => "//*[@id='tasksTable']/table/tbody/tr[7]/td[2]/div/div[1]/div/div[3]/div[2]",
|
||||
'restimates' => "//*[@id='tasksTable']/table/tbody/tr[7]/td[2]/div/div[2]/div/div[1]/div[2]",
|
||||
'rcost' => "//*[@id='tasksTable']/table/tbody/tr[7]/td[2]/div/div[2]/div/div[2]/div[2]",
|
||||
'rleft' => "//*[@id='tasksTable']/table/tbody/tr[7]/td[2]/div/div[2]/div/div[3]/div[2]"
|
||||
);
|
||||
$this->dom->xpath = array_merge($this->dom->xpath, $xpath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user