From 53374f61d2efc2539d195794da0c7a22e872e196 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 26 Nov 2023 16:06:47 +0100 Subject: [PATCH] Browser Tests: Flaky mobile menus, another attempt --- tests/Browser/Components/Popupmenu.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Browser/Components/Popupmenu.php b/tests/Browser/Components/Popupmenu.php index 4af56e26604..a412c9f5dbe 100644 --- a/tests/Browser/Components/Popupmenu.php +++ b/tests/Browser/Components/Popupmenu.php @@ -87,6 +87,11 @@ public function closeMenu($browser) $browser->withinBody(function ($browser) { $browser->script("window.UI.menu_hide('{$this->id}')"); $browser->waitUntilMissingOrStale($this->selector()); + // FIXME: For some reason sometimes .popover-overlay does not close, + // we have to remove it manually + $browser->script( + "Array.from(document.getElementsByClassName('popover-overlay')).forEach(function(elem) { elem.parentNode.removeChild(elem); })" + ); }); }