2023-01-14 18:30:33 +01: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 19:11:34 +02:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
|
2022-11-26 23:27:10 -06:00
|
|
|
|
2022-12-05 23:34:02 -08:00
|
|
|
// The next/prev buttons vertically scroll the code viewport between examples
|
2024-08-31 00:12:10 +02:00
|
|
|
move-cursor-to: ".scraped-example-list > .scraped-example"
|
2024-09-02 15:59:00 +02:00
|
|
|
store-property: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
|
|
|
"scrollTop": initialScrollTop,
|
|
|
|
})
|
|
|
|
assert-property: (".scraped-example-list > .scraped-example .rust", {
|
|
|
|
"scrollTop": |initialScrollTop|,
|
|
|
|
})
|
2022-11-26 23:27:10 -06:00
|
|
|
focus: ".scraped-example-list > .scraped-example .next"
|
|
|
|
press-key: "Enter"
|
2024-09-02 15:59:00 +02:00
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
|
|
|
"scrollTop": |initialScrollTop|
|
|
|
|
}, NEAR)
|
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example .rust", {
|
2023-01-08 21:29:57 +01:00
|
|
|
"scrollTop": |initialScrollTop|
|
2023-01-16 10:57:56 -07:00
|
|
|
}, NEAR)
|
2022-11-26 23:27:10 -06:00
|
|
|
focus: ".scraped-example-list > .scraped-example .prev"
|
|
|
|
press-key: "Enter"
|
2024-09-02 15:59:00 +02:00
|
|
|
assert-property: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
|
|
|
"scrollTop": |initialScrollTop|
|
|
|
|
}, NEAR)
|
|
|
|
assert-property: (".scraped-example-list > .scraped-example .rust", {
|
2023-01-08 21:29:57 +01:00
|
|
|
"scrollTop": |initialScrollTop|
|
2023-01-16 10:57:56 -07:00
|
|
|
}, NEAR)
|
2022-11-26 23:27:10 -06:00
|
|
|
|
2022-12-05 23:34:02 -08:00
|
|
|
// The expand button increases the scrollHeight of the minimized code viewport
|
2023-05-10 10:56:59 +02:00
|
|
|
store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": smallOffsetHeight})
|
2024-09-03 00:42:13 +02:00
|
|
|
assert-property: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
2024-09-02 15:59:00 +02:00
|
|
|
"scrollHeight": |smallOffsetHeight|
|
|
|
|
}, NEAR)
|
2024-09-03 00:42:13 +02:00
|
|
|
assert-property: (".scraped-example-list > .scraped-example .rust", {
|
2023-01-08 21:29:57 +01:00
|
|
|
"scrollHeight": |smallOffsetHeight|
|
2023-01-16 10:57:56 -07:00
|
|
|
}, NEAR)
|
2022-11-19 17:42:07 -07:00
|
|
|
focus: ".scraped-example-list > .scraped-example .expand"
|
|
|
|
press-key: "Enter"
|
2024-09-02 15:59:00 +02:00
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
|
|
|
"offsetHeight": |smallOffsetHeight|
|
|
|
|
}, NEAR)
|
|
|
|
assert-property-false: (".scraped-example-list > .scraped-example .rust", {
|
2023-01-08 21:29:57 +01:00
|
|
|
"offsetHeight": |smallOffsetHeight|
|
2023-01-16 10:57:56 -07:00
|
|
|
}, NEAR)
|
2024-09-02 15:59:00 +02:00
|
|
|
store-property: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
|
|
|
"offsetHeight": fullOffsetHeight,
|
|
|
|
})
|
|
|
|
assert-property: (".scraped-example-list > .scraped-example .rust", {
|
|
|
|
"offsetHeight": |fullOffsetHeight|,
|
|
|
|
"scrollHeight": |fullOffsetHeight|,
|
|
|
|
})
|
|
|
|
assert-property: (".scraped-example-list > .scraped-example .src-line-numbers", {
|
2023-01-08 21:29:57 +01:00
|
|
|
"scrollHeight": |fullOffsetHeight|
|
2023-01-16 10:57:56 -07:00
|
|
|
}, NEAR)
|