From f9d4f348b372d48bb11db10eb7c13dac87640653 Mon Sep 17 00:00:00 2001 From: yulujie Date: Thu, 12 Jun 2025 14:23:32 +0800 Subject: [PATCH] *[task#144987,doing,0.5h,1h] Add waittime. --- module/tree/test/lib/browse.ui.class.php | 7 ++++--- module/tree/test/lib/viewhistory.ui.class.php | 11 +++++++++-- module/tree/test/ui/browse.php | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/module/tree/test/lib/browse.ui.class.php b/module/tree/test/lib/browse.ui.class.php index c1d52350c0..277c697c3f 100755 --- a/module/tree/test/lib/browse.ui.class.php +++ b/module/tree/test/lib/browse.ui.class.php @@ -14,7 +14,7 @@ class browseTester extends tester public function createModule($moduleName, $checkRepeat = false) { $form = $this->initForm('tree', 'browse', array('product' => '1', 'view' => 'story'), 'appIframe-product'); - $form->wait(1); + $form->dom->waitElement($form->dom->xpath['firsrNullModule'], 10); if($checkRepeat) $moduleName = $form->dom->firstModule->getText(); $form->dom->firsrNullModule->setValue($moduleName); $form->dom->submitBtn->click(); @@ -86,7 +86,7 @@ class browseTester extends tester public function editModule($newName) { $form = $this->initForm('tree', 'browse', array('product' => '1', 'view' => 'story'), 'appIframe-product'); - $form->wait(1); + $form->dom->waitElement($form->dom->xpath['firstEditBtn'], 10); $form->dom->firstEditBtn->click(); $form->wait(1); $form->dom->name->setValue($newName); @@ -152,6 +152,7 @@ class browseTester extends tester $form = $this->initForm('tree', 'browse', array('product' => '3', 'view' => 'story'), 'appIframe-product'); $form->wait(1); $form->dom->btn($this->lang->tree->syncFromProduct)->click(); + $form->wait(1); $form->dom->allProduct->picker($product[0]); $form->dom->copyIcon->click(); $form->wait(1); @@ -164,7 +165,7 @@ class browseTester extends tester } $form->dom->submitBtn->click(); - $form->wait(1); + $form->dom->waitElement($form->dom->xpath['firstModule'], 10); if($form->dom->firstModule->getText() == $product[1] && $form->dom->lastModule->getText() == $product[2]) return $this->success('复制模块成功'); return $this->failed('复制模块失败'); } diff --git a/module/tree/test/lib/viewhistory.ui.class.php b/module/tree/test/lib/viewhistory.ui.class.php index d05b705c3f..b099e28925 100644 --- a/module/tree/test/lib/viewhistory.ui.class.php +++ b/module/tree/test/lib/viewhistory.ui.class.php @@ -14,12 +14,19 @@ class viewhistoryTester extends tester public function checkHistory($param, $action) { $form = $this->initForm('tree', 'browse', array('product' => '1', 'view' => 'story'), 'appIframe-product'); + $form->wait(1); $form->dom->btn($this->lang->history)->click(); $form->wait(); $content = explode(" ", $form->dom->{$param}->getText()); - $history = $this->lang->module->action->{$action}->main; - if($action == 'edited') $history = $this->lang->action->desc->{$action}; + if($action == 'edited') + { + $history = $this->lang->action->desc->{$action}; + } + else + { + $history = $this->lang->module->action->{$action}->main; + } $history = explode(" ", $history); if(trim($history[3]) == $content[4]) return $this->success('历史记录正确'); diff --git a/module/tree/test/ui/browse.php b/module/tree/test/ui/browse.php index dfc0219069..56d5df87d5 100755 --- a/module/tree/test/ui/browse.php +++ b/module/tree/test/ui/browse.php @@ -50,7 +50,7 @@ r($tester->createChildModule('模块2')) && p('status,message') && e('SU r($tester->createChildModule('子模块1', true)) && p('status,message') && e('SUCCESS,创建子模块时子模块已存在,提示正确'); r($tester->editModule('')) && p('status,message') && e('SUCCESS,编辑模块时模块为空,提示正确'); -r($tester->editModule('模块 2')) && p('status,message') && e('SUCCESS,编辑模块时模块名包含空格,提示正确'); +r($tester->editModule(' ')) && p('status,message') && e('SUCCESS,编辑模块时模块名包含空格,提示正确'); r($tester->editModule('模块2')) && p('status,message') && e('SUCCESS,编辑模块时模块已存在,提示正确'); r($tester->editModule('编辑模块1')) && p('status,message') && e('SUCCESS,编辑模块成功');