From db5ce7a902ab241ce8c30d8a54c077e1539db877 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 4 Nov 2024 17:03:27 +0100 Subject: [PATCH] Add GUI tests for size popups --- gui-tests/crate-sizes.goml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gui-tests/crate-sizes.goml diff --git a/gui-tests/crate-sizes.goml b/gui-tests/crate-sizes.goml new file mode 100644 index 000000000..783a3790f --- /dev/null +++ b/gui-tests/crate-sizes.goml @@ -0,0 +1,37 @@ +// Checks that the size popup work as expected. +go-to: |DOC_PATH| + "/crate/sysinfo/latest" +// By default, they're hidden. +assert-css: ( + "div.package-page-container div.package-menu .documented-info .size .info", + {"display": "none"}, +) +// When we hover the parent element, it should make them appear. +move-cursor-to: "div.package-page-container div.package-menu .documented-info .size" +wait-for-css: ( + "div.package-page-container div.package-menu .documented-info .size .info", + {"display": "block"}, +) +// And when we move the mouse cursor away, it's hidden again. +move-cursor-to: "#clipboard" +assert-css: ( + "div.package-page-container div.package-menu .documented-info .size .info", + {"display": "none"}, +) + +// When clicked, the popup should remain visible. +click: "div.package-page-container div.package-menu .documented-info .size" +wait-for-css: ( + "div.package-page-container div.package-menu .documented-info .size .info", + {"display": "block"}, +) +move-cursor-to: "#clipboard" +assert-css: ( + "div.package-page-container div.package-menu .documented-info .size .info", + {"display": "block"}, +) +// Clicking somewhere else will change focus, making the popup disappear. +click: "#main" +wait-for-css: ( + "div.package-page-container div.package-menu .documented-info .size .info", + {"display": "none"}, +)