61 lines
1.9 KiB
PHP
61 lines
1.9 KiB
PHP
<?php
|
|
include dirname(__FILE__, 5) . '/test/lib/ui.php';
|
|
class bugTester extends tester
|
|
{
|
|
/**
|
|
* 检查Tab标签下的数据。
|
|
* Check the data of Tab tag.
|
|
*
|
|
* @param string $tab allTab|unresolvedTab
|
|
* @param string $expectNum
|
|
* @access public
|
|
* @return object
|
|
*/
|
|
public function checkTab($tab, $expectNum)
|
|
{
|
|
$form = $this->initForm('project', 'bug', array('project' => 1), 'appIframe-project');
|
|
$form->dom->$tab->click();
|
|
$form->wait(1);
|
|
if($form->dom->bugNum->getText() == $expectNum) return $this->success($tab . '下显示条数正确');
|
|
return $this->failed($tab . '下显示条数不正确');
|
|
}
|
|
|
|
/**
|
|
* 切换产品查看数据。
|
|
* Switch product to view data.
|
|
*
|
|
* @param string $product firstProduct|secondProduct
|
|
* @param string $expectNum
|
|
* @access public
|
|
* @return object
|
|
*/
|
|
public function switchProduct($product, $expectNum)
|
|
{
|
|
$form = $this->initForm('project', 'bug', array('project' => 1), 'appIframe-project');
|
|
$form->dom->dropMenu->click();
|
|
$form->dom->$product->click();
|
|
$form->wait(1);
|
|
if($form->dom->bugNum->getText() == $expectNum) return $this->success('切换' . $product . '查看数据成功');
|
|
return $this->failed('切换' . $product . '查看数据失败');
|
|
}
|
|
|
|
/**
|
|
* 单个指派bug。
|
|
* Assign bug.
|
|
*
|
|
* @param string $user
|
|
* @access public
|
|
* @return object
|
|
*/
|
|
public function assignBug($user)
|
|
{
|
|
$form = $this->initForm('project', 'bug', array('project' => 1), 'appIframe-project');
|
|
$form->dom->firstAssign->click();
|
|
$form->dom->assignTo->picker($user);
|
|
$form->dom->submitBtn->click();
|
|
$form->wait(1);
|
|
if($form->dom->firstAssign->getText() == $user) return $this->success('单个指派Bug成功');
|
|
return $this->failed('单个指派Bug失败');
|
|
}
|
|
}
|