mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
d4dce3e200
Use NEAR check to allow one pixel difference between scroll positions.
32 lines
1.4 KiB
Plaintext
32 lines
1.4 KiB
Plaintext
// This test ensures that the scraped examples buttons are working as expecting
|
|
// when 'Enter' key is pressed when they're focused.
|
|
goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
|
|
|
|
// The next/prev buttons vertically scroll the code viewport between examples
|
|
store-property: (initialScrollTop, ".scraped-example-list > .scraped-example pre", "scrollTop")
|
|
focus: ".scraped-example-list > .scraped-example .next"
|
|
press-key: "Enter"
|
|
assert-property-false: (".scraped-example-list > .scraped-example pre", {
|
|
"scrollTop": |initialScrollTop|
|
|
}, NEAR)
|
|
focus: ".scraped-example-list > .scraped-example .prev"
|
|
press-key: "Enter"
|
|
assert-property: (".scraped-example-list > .scraped-example pre", {
|
|
"scrollTop": |initialScrollTop|
|
|
}, NEAR)
|
|
|
|
// The expand button increases the scrollHeight of the minimized code viewport
|
|
store-property: (smallOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight")
|
|
assert-property-false: (".scraped-example-list > .scraped-example pre", {
|
|
"scrollHeight": |smallOffsetHeight|
|
|
}, NEAR)
|
|
focus: ".scraped-example-list > .scraped-example .expand"
|
|
press-key: "Enter"
|
|
assert-property-false: (".scraped-example-list > .scraped-example pre", {
|
|
"offsetHeight": |smallOffsetHeight|
|
|
}, NEAR)
|
|
store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight")
|
|
assert-property: (".scraped-example-list > .scraped-example pre", {
|
|
"scrollHeight": |fullOffsetHeight|
|
|
}, NEAR)
|