fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// Checks that the setting "auto hide trait implementations" is working as expected. 2 3define-function: ( 4 "check-setting", 5 (storage_value, setting_attribute_value, toggle_attribute_value), 6 block { 7 assert-local-storage: {"rustdoc-auto-hide-trait-implementations": |storage_value|} 8 click: "#settings-menu" 9 wait-for: "#settings" 10 assert-property: ("#auto-hide-trait-implementations", {"checked": |setting_attribute_value|}) 11 assert-attribute: ("#trait-implementations-list > details", {"open": |toggle_attribute_value|}, ALL) 12 } 13) 14 15go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html" 16 17// By default, the trait implementations are not collapsed. 18call-function: ("check-setting", { 19 "storage_value": null, 20 "setting_attribute_value": "false", 21 "toggle_attribute_value": "", 22}) 23 24// Now we change its value. 25click: "#auto-hide-trait-implementations" 26assert-local-storage: {"rustdoc-auto-hide-trait-implementations": "true"} 27 28// We check that the changes were applied as expected. 29reload: 30 31call-function: ("check-setting", { 32 "storage_value": "true", 33 "setting_attribute_value": "true", 34 "toggle_attribute_value": null, 35}) 36 37// And now we re-disable the setting. 38click: "#auto-hide-trait-implementations" 39assert-local-storage: {"rustdoc-auto-hide-trait-implementations": "false"} 40 41// And we check everything is back the way it was before. 42reload: 43call-function: ("check-setting", { 44 "storage_value": "false", 45 "setting_attribute_value": "false", 46 "toggle_attribute_value": "", 47})