From 4bacdf7b8b9046507ef5ae3bcb349d54fb827b0d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 14 Jan 2026 22:47:53 +0100 Subject: [PATCH] Reduce rustdoc GUI flakyness, take 2 --- tests/rustdoc-gui/utils.goml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/rustdoc-gui/utils.goml b/tests/rustdoc-gui/utils.goml index c0625ead2f1aa..c5c8ab3b1af81 100644 --- a/tests/rustdoc-gui/utils.goml +++ b/tests/rustdoc-gui/utils.goml @@ -29,9 +29,18 @@ define-function: ( "open-settings-menu", [], block { - call-function: ("click-settings-button", {}) - // Wait for the popover to appear... - wait-for-css: ("#settings", {"display": "block"}) + store-count: ("#settings", nb_settings_menu) + if: (|nb_settings_menu| != 0, block { + store-css: ("#settings", {"display": settings_display}) + }) + else: block { + store-value: (settings_display, "none") + } + if: (|settings_display| != "block", block { + call-function: ("click-settings-button", {}) + // Wait for the popover to appear... + wait-for-css: ("#settings", {"display": "block"}) + }) } ) @@ -39,9 +48,18 @@ define-function: ( "close-settings-menu", [], block { - call-function: ("click-settings-button", {}) - // Wait for the popover to disappear... - wait-for-css-false: ("#settings", {"display": "block"}) + store-count: ("#settings", nb_settings_menu) + if: (|nb_settings_menu| != 0, block { + store-css: ("#settings", {"display": settings_display}) + }) + else: block { + store-value: (settings_display, "block") + } + if: (|settings_display| == "block", block { + call-function: ("click-settings-button", {}) + // Wait for the popover to disappear... + wait-for-css-false: ("#settings", {"display": "block"}) + }) } )