From c618aaefad82b82ab326a2ad113a7be22b85e210 Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 30 Apr 2025 12:43:41 +0800 Subject: [PATCH] + [uitest] remove link check. --- test/checklink.php | 39 --------------------------------------- test/lib/ui.php | 33 --------------------------------- 2 files changed, 72 deletions(-) delete mode 100644 test/checklink.php diff --git a/test/checklink.php b/test/checklink.php deleted file mode 100644 index 1659ac8092..0000000000 --- a/test/checklink.php +++ /dev/null @@ -1,39 +0,0 @@ -project)) -{ - echo '没有要检查的链接'; - exit(1); -} - -$urlList = array(); -foreach($link as $module => $LinkList) -{ - if(in_array($module, array('tutorial', 'misc'))) continue; - foreach($LinkList as $url) - { - $params = parse_url($url); - if(isset($params['query']) && in_array($module, array('company', 'project', 'product', 'execution', 'bug', 'feedback', 'ticket'))) - { - parse_str($params['query'], $params); - if($params['f'] == 'browse' && isset($params['dept']) && $params['dept'] != 1) continue; - if($params['f'] == 'browse' && isset($params['programID']) && $params['programID'] != 1) continue; - if($params['f'] == 'index' && isset($params['id']) && $params['id'] != 1001) continue; - if($params['f'] == 'browse' && isset($params['productID']) && $params['productID'] != 1) continue; - if($params['f'] == 'task' && isset($params['executionID']) && $params['executionID'] != 12000) continue; - if($params['f'] == 'admin' && isset($params['browseType']) && $params['browseType'] == 'byProduct' && isset($params['param']) && $params['param'] != 1) continue; - if($params['f'] == 'manageProduct' && isset($params['product']) && $params['product'] != 1) continue; - } - $urlList[] = $url; - } -} - -$tester = new tester(); -$tester->login(); -sleep(2); - -$result = $tester->checkLink($urlList); -$tester->closeBrowser(); -if(!empty($result)) file_put_contents('checkresult', json_encode($result)); diff --git a/test/lib/ui.php b/test/lib/ui.php index a36345d5c4..f8cde9c806 100644 --- a/test/lib/ui.php +++ b/test/lib/ui.php @@ -492,39 +492,6 @@ class tester extends result return true; } - /** - * URL检查。 - * Check URL. - * - * @param array $urlList - * @param int $wait - * @access public - * @return void - */ - public function checkLink($urlList, $wait = 5) - { - if(empty($urlList)) return false; - $webRoot = $this->getWebRoot(); - $result = array(); - foreach($urlList as $url) - { - $this->page->openURL($webRoot . $url); - sleep($wait); - - $errors = $this->page->dom->getErrorsInPage('', true); - if(!empty($errors)) - { - $checked = new stdclass(); - $checked->url = $url; - $checked->errors = $errors; - - $result[] = $checked; - } - } - - return $result; - } - /** * Close the Browser. *