From a86b17f9e50d909229edf53703fe8f5a5da7507c Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Mon, 17 Feb 2025 12:28:58 -0500 Subject: [PATCH] Revert "Bottom button tests: fallback with Javascript. (#4253)" This reverts commit a038f3064f00cf7d3dae6f14d2f0bae20195f4d8. --- .../src/VuFindTest/Mink/BulkTest.php | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BulkTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BulkTest.php index 73e55f04ae8..0ff3f15b726 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BulkTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BulkTest.php @@ -312,21 +312,6 @@ protected function retryClickWithResizedWindow(Session $session, Element $page, $session->resizeWindow(1280, 768, 'current'); } - /** - * After a failed button click has been detected, try again with Javascript - * - * @param Session $session Mink session - * @param string $selector Selector to click - * - * @return void - */ - protected function retryClickWithJavascript(Session $session, string $selector): void - { - // If retryClickWithResizedWindow() failed, we can force a click with Javascript. - echo "\n\nMink click failed; retrying with Javascript!\n"; - $session->evaluateScript('$("' . $selector . '").click()'); - } - /** * Test that the export control works. * @@ -353,21 +338,11 @@ public function testBulkExport(string $idPrefix): void $this->clickCss($page, $buttonSelector); // Select EndNote option - $error = false; try { $select = $this->findCss($page, '#format', 100); } catch (\Exception $e) { - $error = true; - } - // Fallback logic in case of unexpected (but occasionally encountered) random failures: - if ($error) { - try { - $this->retryClickWithResizedWindow($session, $page, $buttonSelector); - $select = $this->findCss($page, '#format'); - } catch (\Exception $e) { - $this->retryClickWithJavascript($session, $buttonSelector); - $select = $this->findCss($page, '#format'); - } + $this->retryClickWithResizedWindow($session, $page, $buttonSelector); + $select = $this->findCss($page, '#format'); } $select->selectOption('EndNote'); @@ -403,15 +378,10 @@ public function testBulkPrint(string $idPrefix): void $this->waitStatement('$("input.checkbox-select-item:checked").length === 2'); $this->clickCss($page, $buttonSelector); [, $params] = explode('?', $session->getCurrentUrl()); - // Fallback logic in case of unexpected (but occasionally encountered) random failures: if (str_starts_with($params, 'lookfor')) { $this->retryClickWithResizedWindow($session, $page, $buttonSelector); [, $params] = explode('?', $session->getCurrentUrl()); } - if (str_starts_with($params, 'lookfor')) { - $this->retryClickWithJavascript($session, $buttonSelector); - [, $params] = explode('?', $session->getCurrentUrl()); - } $this->assertEquals( 'print=true&id[]=Solr|testsample1&id[]=Solr|testsample2', str_replace(['%5B', '%5D', '%7C'], ['[', ']', '|'], $params)