2023-01-14 17:30:33 +00:00
|
|
|
// This test ensures that the scraped examples buttons are working as expecting
|
|
|
|
// when 'Enter' key is pressed when they're focused.
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
|
2022-11-27 05:27:10 +00:00
|
|
|
|
2022-12-06 07:34:02 +00:00
|
|
|
// The next/prev buttons vertically scroll the code viewport between examples
|
2023-05-10 08:56:59 +00:00
|
|
|
store-property: (".scraped-example-list > .scraped-example pre", {"scrollTop": initialScrollTop})
|
2022-11-27 05:27:10 +00:00
|
|
|
focus: ".scraped-example-list > .scraped-example .next"
|
|
|
|
press-key: "Enter"
|
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example pre", {
|
2023-01-08 20:29:57 +00:00
|
|
|
"scrollTop": |initialScrollTop|
|
2023-01-16 17:57:56 +00:00
|
|
|
}, NEAR)
|
2022-11-27 05:27:10 +00:00
|
|
|
focus: ".scraped-example-list > .scraped-example .prev"
|
|
|
|
press-key: "Enter"
|
|
|
|
assert-property: (".scraped-example-list > .scraped-example pre", {
|
2023-01-08 20:29:57 +00:00
|
|
|
"scrollTop": |initialScrollTop|
|
2023-01-16 17:57:56 +00:00
|
|
|
}, NEAR)
|
2022-11-27 05:27:10 +00:00
|
|
|
|
2022-12-06 07:34:02 +00:00
|
|
|
// The expand button increases the scrollHeight of the minimized code viewport
|
2023-05-10 08:56:59 +00:00
|
|
|
store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": smallOffsetHeight})
|
2022-11-20 00:42:07 +00:00
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example pre", {
|
2023-01-08 20:29:57 +00:00
|
|
|
"scrollHeight": |smallOffsetHeight|
|
2023-01-16 17:57:56 +00:00
|
|
|
}, NEAR)
|
2022-11-20 00:42:07 +00:00
|
|
|
focus: ".scraped-example-list > .scraped-example .expand"
|
|
|
|
press-key: "Enter"
|
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example pre", {
|
2023-01-08 20:29:57 +00:00
|
|
|
"offsetHeight": |smallOffsetHeight|
|
2023-01-16 17:57:56 +00:00
|
|
|
}, NEAR)
|
2023-05-10 08:56:59 +00:00
|
|
|
store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": fullOffsetHeight})
|
2022-11-20 00:42:07 +00:00
|
|
|
assert-property: (".scraped-example-list > .scraped-example pre", {
|
2023-01-08 20:29:57 +00:00
|
|
|
"scrollHeight": |fullOffsetHeight|
|
2023-01-16 17:57:56 +00:00
|
|
|
}, NEAR)
|