From fef84b76cff10dc3bbb6da0781c8ca1a3a633abd Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 29 Apr 2025 17:33:54 +0800 Subject: [PATCH] + [uitest] adjust ui test check. --- test/lib/ui.php | 2 +- test/lib/webdriver/webdriver.class.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/lib/ui.php b/test/lib/ui.php index f2f0ecd6c3..a36345d5c4 100644 --- a/test/lib/ui.php +++ b/test/lib/ui.php @@ -511,7 +511,7 @@ class tester extends result $this->page->openURL($webRoot . $url); sleep($wait); - $errors = $this->page->dom->getErrorsInPage(); + $errors = $this->page->dom->getErrorsInPage('', true); if(!empty($errors)) { $checked = new stdclass(); diff --git a/test/lib/webdriver/webdriver.class.php b/test/lib/webdriver/webdriver.class.php index b3c5f3e832..0ae8b42a6e 100644 --- a/test/lib/webdriver/webdriver.class.php +++ b/test/lib/webdriver/webdriver.class.php @@ -706,7 +706,7 @@ class dom * @access public * @return array */ - public function getErrorsInPage($iframe = '') + public function getErrorsInPage($iframe = '', $showPerf = false) { $errors = array(); @@ -729,7 +729,7 @@ class dom if($hasException == false) { if(!empty($this->getErrorsInAlert())) $errors[] = $this->getErrorsInAlert(); - if(!empty($this->getErrorsInZinBar())) $errors[] = $this->getErrorsInZinBar(); + if(!empty($this->getErrorsInZinBar())) $errors[] = $this->getErrorsInZinBar($showPerf); } } @@ -745,14 +745,17 @@ class dom * @access public * @return array */ - public function getErrorsInZinBar() + public function getErrorsInZinBar($showPerf = false) { $errors = array(); try { - $perfMsg = $this->driver->executeScript("return $('.page-app body').attr('z-perf-message');"); - if(!empty($perfMsg)) $errors[] = $perfMsg; + if($showPerf) + { + $perfMsg = $this->driver->executeScript("return $('.page-app body').attr('z-perf-message');"); + if(!empty($perfMsg)) $errors[] = $perfMsg; + } $parentDiv = $this->driver->findElement(WebDriverBy::xpath('//*[@id="zinbar"]/div/div[3]')); $errorDivs = $parentDiv->findElements(WebDriverBy::tagName('div'));