*[task#146066,doing,1.5h,2h] Add uitest of delete execution.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/ui.php';
|
||||
class deleteExecutionTester extends tester
|
||||
{
|
||||
/**
|
||||
* 删除执行。
|
||||
* Delete execution.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$viewForm = $this->initForm('execution', 'view', array('execution' => '2'), 'appIframe-execution');
|
||||
$viewForm->wait(1);
|
||||
$executionName = $viewForm->dom->executionName->getText();
|
||||
$viewForm->dom->deleteBtn->click();
|
||||
$viewForm->wait(1);
|
||||
$viewForm->dom->alertModal();
|
||||
|
||||
$form = $this->initForm('execution', 'all', 'appIframe-execution');
|
||||
$form->wait(1);
|
||||
$form->dom->search(array(",=,{$executionName}"));
|
||||
$form->wait(1);
|
||||
if(is_object($form->dom->tips) && $form->dom->tips->getText() == $this->lang->execution->noExecutions) return $this->success('删除执行成功');
|
||||
return $this->failed('删除执行失败');
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class editExecutionTester extends tester
|
||||
*
|
||||
* @param string $type sprint|stage|kanban
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return object
|
||||
*/
|
||||
public function checkRepeatInfo($type = 'sprint')
|
||||
{
|
||||
@@ -57,7 +57,7 @@ class editExecutionTester extends tester
|
||||
*
|
||||
* @param string $dateType begin|end
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return object
|
||||
*/
|
||||
public function checkDateInfo($dateType = 'end')
|
||||
{
|
||||
@@ -92,7 +92,7 @@ class editExecutionTester extends tester
|
||||
* Get error info of manage products.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return object
|
||||
*/
|
||||
public function checkManageProductsInfo()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
title=删除执行
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 执行tester模块的delete方法▫
|
||||
- 最终测试状态 @SUCCESS
|
||||
- 测试结果 @删除执行成功
|
||||
|
||||
*/
|
||||
|
||||
chdir(__DIR__);
|
||||
include '../lib/delete.ui.class.php';
|
||||
|
||||
$project = zenData('project');
|
||||
$project->id->range('1-100');
|
||||
$project->project->range('0, 1{2}');
|
||||
$project->model->range('scrum, []{2}');
|
||||
$project->type->range('project, sprint{2}');
|
||||
$project->auth->range('extend, []{2}');
|
||||
$project->storyType->range('story, []{2}');
|
||||
$project->parent->range('0, 1{2}');
|
||||
$project->path->range('`,1,`, `,1,2,`, `,1,3,`');
|
||||
$project->grade->range('1');
|
||||
$project->name->range('项目, 执行1, 执行2');
|
||||
$project->begin->range('(-2M)-(-M):1D')->type('timestamp')->format('YY/MM/DD');
|
||||
$project->end->range('(+2M)-(+3M):1D')->type('timestamp')->format('YY/MM/DD');
|
||||
$project->openedBy->range('user1');
|
||||
$project->acl->range('open');
|
||||
$project->status->range('wait');
|
||||
$project->gen(3);
|
||||
|
||||
$tester = new deleteExecutionTester();
|
||||
$tester->login();
|
||||
|
||||
r($tester->delete()) && p('status,message') && e('SUCCESS,删除执行成功');
|
||||
$tester->closeBrowser();
|
||||
@@ -19,6 +19,8 @@ class allPage extends page
|
||||
'suspendedTab' => "//*[@id='featureBar']/menu/li[5]/a",
|
||||
'delayedTab' => "//*[@id='featureBar']/menu/li[6]/a",
|
||||
'closedTab' => "//*[@id='featureBar']/menu/li[7]/a",
|
||||
/* 搜索不到执行数据的提示信息 */
|
||||
'tips' => "//*[@id='table-execution-all']/div/div/div",
|
||||
/* 批量编辑状态 */
|
||||
'statusBtn' => "//*[@id='table-execution-all']/div[3]/nav[1]/button",
|
||||
'wait' => "//*[@data-page='execution-all']/div[2]/menu/menu/li[1]/a",
|
||||
|
||||
@@ -18,7 +18,8 @@ class viewPage extends page
|
||||
'plannedEnd' => "//*[@id='mainContent']/div[2]/div[1]/div/table[3]/tbody/tr/td/div/div[2]/span[2]",
|
||||
'realBeganView' => "//*[@id='mainContent']/div[2]/div[1]/div/table[3]/tbody/tr/td/div/div[3]/span[2]",
|
||||
'realEndView' => "//*[@id='mainContent']/div[2]/div[1]/div/table[3]/tbody/tr/td/div/div[4]/span[2]",
|
||||
'edit' => "//*[@id='mainContent']/div[3]/div/a[last()-1]",
|
||||
'editBtn' => "//*[@id='mainContent']/div[3]/div/a[last()-1]",
|
||||
'deleteBtn' => "//*[@id='mainContent']/div[3]/div/a[last()]",
|
||||
'linckedProducta' => "//*[@id='mainContent']/div[2]/div[1]/div/table[1]/tbody/tr[1]/td[1]",
|
||||
'linckedProductb' => "//*[@id='mainContent']/div[2]/div[1]/div/table[1]/tbody/tr[2]/td[1]",
|
||||
'productsNev' => "//*[@data-id='products']",
|
||||
|
||||
Reference in New Issue
Block a user