+ [task#148342,done,0.2h] Modify code.
This commit is contained in:
@@ -13,12 +13,10 @@ class assignToTester extends tester
|
||||
public function assignTo(array $todo)
|
||||
{
|
||||
$form = $this->initForm('my', 'todo', array('type' => 'all', 'userID' => '', 'status' => 'all'), 'appIframe-my');
|
||||
$form->wait(2);
|
||||
$form->dom->assignBtn->click();
|
||||
$form = $this->loadPage('todo', 'assignTo');
|
||||
$form->wait(1);
|
||||
if(isset($todo['assignTo'])) $form->dom->assignedTo->picker($todo['assignTo']);
|
||||
if(isset($todo['assignDate'])) $form->dom->date->datePicker($todo['assignDate']);
|
||||
|
||||
if(isset($todo['assignDate'])) $form->dom->assignDate->datePicker($todo['assignDate']);
|
||||
$form->wait(2);
|
||||
$form->dom->submitBtn->click();
|
||||
$form->wait(1);
|
||||
@@ -28,8 +26,8 @@ class assignToTester extends tester
|
||||
$todoPage->dom->more->click();
|
||||
$todoPage->dom->assignedToOther->click();
|
||||
$todoPage->wait(2);
|
||||
if($todoPage->dom->assignedTo->getText() != $todo['assignTo']) return $this->failed('指派人不正确');
|
||||
if($todoPage->dom->date->getText() != $todo['assignDate']) return $this->failed('日期不正确');
|
||||
if($todoPage->dom->assignedToA->getText() != $todo['assignTo']) return $this->failed('指派人不正确');
|
||||
if($todoPage->dom->date->getText() != $todo['assignDate']) return $this->failed('日期不正确');
|
||||
return $this->success('指派他人待办成功');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ $user->gen(5);
|
||||
$todo = zendata('todo');
|
||||
$todo->id->range('1');
|
||||
$todo->account->range('admin');
|
||||
$todo->date->range('(-2M)-(-M):1D')->type('timestamp')->format('YY/MM/DD');
|
||||
$todo->date->range('(-1M)-(-M):1D')->type('timestamp')->format('YY/MM/DD');
|
||||
$todo->type->range('custom');
|
||||
$todo->name->range('待办1');
|
||||
$todo->status->range('wait');
|
||||
|
||||
@@ -28,10 +28,11 @@ class todoPage extends page
|
||||
'date' => '//*[@id="table-my-todo"]/div[2]/div[2]/div/div[2]/div',
|
||||
'more' => '//*[@id="featureBar"]/menu/li[7]/a/span[1]',
|
||||
'assignedToOther' => '//*[@id="more"]/menu/menu/li[2]/a/div/div',
|
||||
'assignedTo' => '//*[@id="table-my-todo"]/div[2]/div[2]/div/div[7]/div',
|
||||
'assignedToA' => '//*[@id="table-my-todo"]/div[2]/div[2]/div/div[7]/div',
|
||||
/* 指派给页面 */
|
||||
'assignDate' => "//*[@name='date']",
|
||||
'submitBtn' => "//*[@class='form load-indicator form-ajax no-morph form-horz']/div[4]/div/button",
|
||||
'assignedTo' => '//*[@name="assignedTo"]',
|
||||
'assignDate' => '//*[@name="date"]',
|
||||
'submitBtn' => '//*[@class="form load-indicator form-ajax no-morph form-horz"]/div[4]/div/button',
|
||||
);
|
||||
$this->dom->xpath = array_merge($this->dom->xpath, $xpath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user