Rollup merge of #101693 - GuillaumeGomez:update-browser-ui-test-0-10, r=notriddle

Update browser UI test 0 10

The biggest change from this browser-ui-test update is the upgrade of the puppeteer version to `17.1.3` (the latest in short).

I also added the command `click-with-offset` to still allow us to click on the `[-]` part.

cc `@jsha`
r? `@notriddle`
This commit is contained in:
Dylan DPC 2022-09-12 15:21:34 +05:30 committed by GitHub
commit 8ef557d343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 13 deletions

View File

@ -6,7 +6,7 @@ size: (1100, 800)
compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"])
assert-property: (".top-doc .docblock", {"scrollWidth": "801"})
// However, since there is overflow in the <table>, its scroll width is bigger.
assert-property: (".top-doc .docblock table", {"scrollWidth": "1573"})
assert-property: (".top-doc .docblock table", {"scrollWidth": "1572"})
// Checking it works on other doc blocks as well...
@ -18,4 +18,4 @@ compare-elements-property: (
)
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "801"})
// However, since there is overflow in the <table>, its scroll width is bigger.
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1573"})
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"})

View File

@ -6,7 +6,7 @@ assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
// Scroll down.
scroll-to: "//h2[@id='blanket-implementations']"
assert-window-property: {"pageYOffset": "702"}
assert-window-property: {"pageYOffset": "643"}
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
@ -21,11 +21,11 @@ assert-window-property: {"pageYOffset": "0"}
// Close the sidebar menu. Make sure the scroll position gets restored.
click: ".sidebar-menu-toggle"
wait-for-css: (".sidebar", {"left": "-1000px"})
assert-window-property: {"pageYOffset": "702"}
assert-window-property: {"pageYOffset": "643"}
// Now test that scrollability returns when the browser window is just resized.
click: ".sidebar-menu-toggle"
wait-for-css: (".sidebar", {"left": "0px"})
assert-window-property: {"pageYOffset": "0"}
size: (900, 900)
assert-window-property: {"pageYOffset": "702"}
size: (900, 600)
assert-window-property: {"pageYOffset": "643"}

View File

@ -224,14 +224,14 @@ click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
// We scroll to line 117 to change the scroll position.
scroll-to: '//*[@id="117"]'
assert-window-property: {"pageYOffset": "2519"}
assert-window-property: {"pageYOffset": "2542"}
// Expanding the sidebar...
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "500px"})
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
// The "scrollTop" property should be the same.
assert-window-property: {"pageYOffset": "2519"}
assert-window-property: {"pageYOffset": "2542"}
// We now check that the scroll position is restored if the window is resized.
size: (500, 700)
@ -239,7 +239,7 @@ click: "#sidebar-toggle"
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
assert-window-property: {"pageYOffset": "0"}
size: (900, 900)
assert-window-property: {"pageYOffset": "2519"}
assert-window-property: {"pageYOffset": "2542"}
size: (500, 700)
click: "#sidebar-toggle"
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})

View File

@ -4,7 +4,10 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
click: "h4.code-header" // This is the position of "pub" in "pub fn a_method"
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
click: ".impl-items .rustdoc-toggle summary::before" // This is the position of "[-]" next to that pub fn.
click-with-offset: (
".impl-items .rustdoc-toggle summary",
{"x": -24, "y": 8}, // This is the position of "[-]" next to that pub fn.
)
assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""})
// Click the "Trait" part of "impl Trait" and verify it navigates.

View File

@ -32,6 +32,6 @@ assert-property: (".item-decl pre", {"scrollWidth": "950"})
size: (600, 600)
goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html
// It shouldn't have an overflow in the topbar either.
assert-property: (".mobile-topbar .location", {"scrollWidth": "502"})
assert-property: (".mobile-topbar .location", {"clientWidth": "502"})
assert-property: (".mobile-topbar .location", {"scrollWidth": "500"})
assert-property: (".mobile-topbar .location", {"clientWidth": "500"})
assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})