From 0bff49bc890d2f149fe33aa92da099164edf5796 Mon Sep 17 00:00:00 2001 From: Nikolay Beketov Date: Sat, 21 Sep 2024 09:00:37 +0800 Subject: [PATCH] Fix auto test --- tests/AdminCabinet/Lib/MikoPBXTestsBase.php | 24 +-------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/tests/AdminCabinet/Lib/MikoPBXTestsBase.php b/tests/AdminCabinet/Lib/MikoPBXTestsBase.php index bfb834ef5..0c78d0523 100644 --- a/tests/AdminCabinet/Lib/MikoPBXTestsBase.php +++ b/tests/AdminCabinet/Lib/MikoPBXTestsBase.php @@ -127,28 +127,6 @@ protected function waitForAjax(): void } } - /** - * Wait until datatable draw - * @param $datatableId - * @param $timeoutInSeconds - * @return void - * @throws Exception - */ - protected function waitForDataTableDraw(string $datatableId, int $timeoutInSeconds = 10) - { - $endTime = time() + $timeoutInSeconds; - while (time() < $endTime) { - $isDrawComplete = self::$driver->executeScript(" - var table = $('#$datatableId').DataTable(); - return table && table.draw && table.draw(false) !== undefined; - "); - if ($isDrawComplete) { - return; - } - usleep(500000); - } - throw new \Exception("Timeout waiting for DataTable draw to complete."); - } /** * Fails a test with the given message. @@ -763,7 +741,7 @@ protected function fillDataTableSearchInput(string $datatableId, string $name, s $this->waitForAjax(); // Wait for DataTableDraw - $this->waitForDataTableDraw($datatableId,10); + usleep(5000000); } /**