2021-06-24 07:30:01 -05:00
|
|
|
// These tests verify that labels like "UNIX" and "Deprecated" stay on the same line as their symbol.
|
|
|
|
// It also verifies the staggered layout on mobile.
|
2024-06-26 17:04:23 -05:00
|
|
|
include: "utils.goml"
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2021-06-24 07:30:01 -05:00
|
|
|
|
2024-06-26 17:04:23 -05:00
|
|
|
call-function: ("switch-theme", {"theme": "light"})
|
|
|
|
|
2021-06-24 07:30:01 -05:00
|
|
|
// Desktop view
|
2023-04-11 12:11:34 -05:00
|
|
|
set-window-size: (1080, 600)
|
2021-06-24 07:30:01 -05:00
|
|
|
assert: (".stab.deprecated")
|
|
|
|
assert: (".stab.portability")
|
|
|
|
|
2022-07-27 00:11:21 -05:00
|
|
|
// make sure that deprecated and portability have the right colors
|
2021-12-12 11:28:58 -06:00
|
|
|
assert-css: (
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-table .item-name .stab.deprecated",
|
2023-07-23 06:05:40 -05:00
|
|
|
{ "background-color": "#fff5d6" },
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
|
|
|
assert-css: (
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-table .item-name .stab.portability",
|
2023-07-23 06:05:40 -05:00
|
|
|
{ "background-color": "#fff5d6" },
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
2021-06-24 07:30:01 -05:00
|
|
|
|
|
|
|
// table like view
|
2023-02-07 20:00:18 -06:00
|
|
|
assert-css: (".desc.docblock-short", { "padding-left": "0px" })
|
2021-12-12 11:28:58 -06:00
|
|
|
compare-elements-position-near: (
|
2024-07-06 19:12:53 -05:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']",
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-name .stab.deprecated",
|
2021-12-12 11:28:58 -06:00
|
|
|
{"y": 2},
|
|
|
|
)
|
2024-07-19 11:00:50 -05:00
|
|
|
// "Unix" part is on second line
|
|
|
|
compare-elements-position-false: (
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-name .stab.deprecated",
|
|
|
|
".item-name .stab.portability",
|
2024-04-01 14:11:22 -05:00
|
|
|
["y"],
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
2021-06-24 07:30:01 -05:00
|
|
|
|
|
|
|
// Ensure no wrap
|
2021-12-12 11:28:58 -06:00
|
|
|
compare-elements-position: (
|
2024-07-06 19:12:53 -05:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']/..",
|
|
|
|
"//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
|
2024-04-01 14:11:22 -05:00
|
|
|
["y"],
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
2021-06-24 07:30:01 -05:00
|
|
|
|
|
|
|
// Mobile view
|
2023-04-11 12:11:34 -05:00
|
|
|
set-window-size: (600, 600)
|
2021-06-24 07:30:01 -05:00
|
|
|
// staggered layout with 2em spacing
|
2023-02-07 20:00:18 -06:00
|
|
|
assert-css: (".desc.docblock-short", { "padding-left": "32px" })
|
2021-12-12 11:28:58 -06:00
|
|
|
compare-elements-position-near: (
|
2024-07-06 19:12:53 -05:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']",
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-name .stab.deprecated",
|
2022-07-27 00:11:21 -05:00
|
|
|
{"y": 2},
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
|
|
|
compare-elements-position: (
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-name .stab.deprecated",
|
|
|
|
".item-name .stab.portability",
|
2024-04-01 14:11:22 -05:00
|
|
|
["y"],
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
2021-06-24 07:30:01 -05:00
|
|
|
|
|
|
|
// Ensure wrap
|
2021-12-12 11:28:58 -06:00
|
|
|
compare-elements-position-false: (
|
2024-07-06 19:12:53 -05:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']/..",
|
|
|
|
"//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
|
2024-04-01 14:11:22 -05:00
|
|
|
["y"],
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
|
|
|
compare-elements-position-false: (
|
2023-02-07 20:00:18 -06:00
|
|
|
".item-name .stab.deprecated",
|
2024-07-06 19:12:53 -05:00
|
|
|
"//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
|
2024-04-01 14:11:22 -05:00
|
|
|
["y"],
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
2023-07-03 06:26:28 -05:00
|
|
|
|
|
|
|
// Ensure it doesn't expand.
|
|
|
|
set-window-size: (800, 800)
|
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
|
|
|
|
// This part of the tags should not be on the same line as the beginning since the width
|
|
|
|
// is too small for that.
|
|
|
|
compare-elements-position-false: (
|
2024-07-06 19:12:53 -05:00
|
|
|
"//*[@class='stab portability']/code[normalize-space()='appservice-api-c']",
|
|
|
|
"//*[@class='stab portability']/code[normalize-space()='server']",
|
2024-04-01 14:11:22 -05:00
|
|
|
["y"],
|
2023-07-03 06:26:28 -05:00
|
|
|
)
|