From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/rustdoc-gui/notable-trait.goml | 128 ++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 src/test/rustdoc-gui/notable-trait.goml (limited to 'src/test/rustdoc-gui/notable-trait.goml') diff --git a/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml new file mode 100644 index 000000000..efe0cb15f --- /dev/null +++ b/src/test/rustdoc-gui/notable-trait.goml @@ -0,0 +1,128 @@ +// This test checks the position of the `i` for the notable traits. +goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html" +show-text: true +// We start with a wide screen. +size: (1100, 600) +// Checking they have the same y position. +compare-elements-position: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("y"), +) +// Checking they don't have the same x position. +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("x"), +) +// The `i` should be *after* the type. +assert-position: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + {"x": 677}, +) +assert-position: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + {"x": 951}, +) +// The tooltip should be beside the `i` +click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']" +compare-elements-position-near: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']", + {"y": 2} +) +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']", + ("x") +) +// The docblock should be flush with the border. +assert-css: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']", + {"margin-left": "0px"} +) + +// Now only the `i` should be on the next line. +size: (1055, 600) +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("y", "x"), +) + +// Now both the `i` and the struct name should be on the next line. +size: (980, 600) +// Checking they have the same y position. +compare-elements-position: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("y"), +) +// Checking they don't have the same x position. +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("x"), +) +// The `i` should be *after* the type. +assert-position: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + {"x": 245}, +) +assert-position: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + {"x": 519}, +) + +// Checking on mobile now. +size: (650, 600) +// Checking they have the same y position. +compare-elements-position: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("y"), +) +// Checking they don't have the same x position. +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("x"), +) +// The `i` should be *after* the type. +assert-position: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + {"x": 15}, +) +assert-position: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + {"x": 289}, +) +// The tooltip should be below `i` +compare-elements-position-near-false: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']", + {"y": 2} +) +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']", + ("x") +) +compare-elements-position-near: ( + "//*[@id='method.create_an_iterator_from_read']/parent::*", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']", + {"x": 5} +) +// The docblock should be flush with the border. +assert-css: ( + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']", + {"margin-left": "0px"} +) + +// Checking on very small mobile. The `i` should be on its own line. +size: (365, 600) +compare-elements-position-false: ( + "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']", + "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']", + ("y", "x"), +) -- cgit v1.2.3