From 660210c4af12ebcf9e76f897c2542339fe7ce110 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 20 Sep 2024 15:34:45 +0200 Subject: [PATCH] Add GUI test to check size of additional scraped examples --- tests/rustdoc-gui/scrape-examples-layout.goml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/rustdoc-gui/scrape-examples-layout.goml b/tests/rustdoc-gui/scrape-examples-layout.goml index 6bea352bce4..be14e202b37 100644 --- a/tests/rustdoc-gui/scrape-examples-layout.goml +++ b/tests/rustdoc-gui/scrape-examples-layout.goml @@ -37,6 +37,7 @@ assert-property: ( // The "title" should be located at the right bottom corner of the code example. store-position: (".scraped-example .example-wrap", {"x": x, "y": y}) +assert-size: (".scraped-example .example-wrap", {"height": 130}) store-size: (".scraped-example .example-wrap", {"width": width, "height": height}) store-size: (".scraped-example .scraped-example-title", { "width": title_width, @@ -47,6 +48,13 @@ assert-position: (".scraped-example .scraped-example-title", { "y": |y| + |height| - |title_height| - 8, }) +store-size: (".more-scraped-examples .scraped-example .example-wrap", {"height": more_height}) +assert: |more_height| > |height| +assert-size: (".more-scraped-examples .scraped-example .example-wrap", { + "height": 250, + "width": |width|, +}) + // Check that the expand button works and also that line number aligns with code. move-cursor-to: ".scraped-example .rust" click: ".scraped-example .button-holder .expand"