*[task#126265,done,4h,0h] Add ui test files of close product
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/ui.php';
|
||||
|
||||
class changeStatus extends tester
|
||||
{
|
||||
/**
|
||||
* 关闭产品
|
||||
* close product
|
||||
*
|
||||
* @param $producrID 产品ID
|
||||
* @return mixed
|
||||
*/
|
||||
public function closeProduct($productID)
|
||||
{
|
||||
$form = $this->initForm('product', 'view', $productID, 'appIframe-product');
|
||||
$form->dom->btn($this->lang->product->close)->click();//产品详情页中点击关闭
|
||||
$form->wait(2);
|
||||
$form->dom->closeBtn->click();//弹窗中点击关闭产品
|
||||
$viewPage = $this->initForm('product', 'view', $productID, 'appIframe-product');
|
||||
$form->wait(2);
|
||||
$closed = $this->lang->product->statusList->closed;//产品详情页中关闭状态的语言项
|
||||
//判断详情页中的状态是否为[关闭]
|
||||
if($viewPage->dom->status->getText() == $closed)
|
||||
{
|
||||
return $this->success('关闭产品成功');
|
||||
}
|
||||
return $this->failed('关闭产品失败');
|
||||
}
|
||||
}
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
chdir(__DIR__);
|
||||
include '../lib/changestatus.ui.class.php';
|
||||
|
||||
zendata('product')->loadYaml('product', false, 2)->gen(10);
|
||||
$tester = new changeStatus();
|
||||
$tester->login();
|
||||
|
||||
$productID['productID'] = 1;
|
||||
r($tester->closeProduct($productID)) && p('message,status') && e('关闭产品成功,SUCCESS');
|
||||
|
||||
$tester->closeBrowser();
|
||||
@@ -5,10 +5,12 @@ class viewPage extends page
|
||||
{
|
||||
parent::__construct($webdriver);
|
||||
$xpath = array(
|
||||
'productName' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/div",
|
||||
'type' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/span[2]",
|
||||
'acl' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/span[3]",
|
||||
'productName' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/div",
|
||||
'type' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/span[2]",
|
||||
'acl' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/span[3]",
|
||||
'branchProductACL' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/span[4]",
|
||||
'closeBtn' => "/html/body/div[2]/div/div/div[3]/div[1]/div/form/div[2]/div/button",
|
||||
'status' => "//*[@id='mainContent']/div[1]/div[1]/div[1]/div[2]/div[1]/span[2]",
|
||||
);
|
||||
$this->dom->xpath = array_merge($this->dom->xpath, $xpath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user