2021-06-24 12:30:01 +00: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 22:04:23 +00:00
|
|
|
include: "utils.goml"
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2021-06-24 12:30:01 +00:00
|
|
|
|
2024-06-26 22:04:23 +00:00
|
|
|
call-function: ("switch-theme", {"theme": "light"})
|
|
|
|
|
2021-06-24 12:30:01 +00:00
|
|
|
// Desktop view
|
2023-04-11 17:11:34 +00:00
|
|
|
set-window-size: (1080, 600)
|
2021-06-24 12:30:01 +00:00
|
|
|
assert: (".stab.deprecated")
|
|
|
|
assert: (".stab.portability")
|
|
|
|
|
2022-07-27 05:11:21 +00:00
|
|
|
// make sure that deprecated and portability have the right colors
|
2021-12-12 17:28:58 +00:00
|
|
|
assert-css: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-table .item-name .stab.deprecated",
|
2023-07-23 11:05:40 +00:00
|
|
|
{ "background-color": "#fff5d6" },
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
|
|
|
assert-css: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-table .item-name .stab.portability",
|
2023-07-23 11:05:40 +00:00
|
|
|
{ "background-color": "#fff5d6" },
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
2021-06-24 12:30:01 +00:00
|
|
|
|
|
|
|
// table like view
|
2023-02-08 02:00:18 +00:00
|
|
|
assert-css: (".desc.docblock-short", { "padding-left": "0px" })
|
2021-12-12 17:28:58 +00:00
|
|
|
compare-elements-position-near: (
|
2024-07-07 00:12:53 +00:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']",
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
2021-12-12 17:28:58 +00:00
|
|
|
{"y": 2},
|
|
|
|
)
|
2024-07-19 16:00:50 +00:00
|
|
|
// "Unix" part is on second line
|
|
|
|
compare-elements-position-false: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
|
|
|
".item-name .stab.portability",
|
2024-04-01 19:11:22 +00:00
|
|
|
["y"],
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
2021-06-24 12:30:01 +00:00
|
|
|
|
|
|
|
// Ensure no wrap
|
2021-12-12 17:28:58 +00:00
|
|
|
compare-elements-position: (
|
2024-07-07 00:12:53 +00:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']/..",
|
|
|
|
"//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
|
2024-04-01 19:11:22 +00:00
|
|
|
["y"],
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
2021-06-24 12:30:01 +00:00
|
|
|
|
|
|
|
// Mobile view
|
2023-04-11 17:11:34 +00:00
|
|
|
set-window-size: (600, 600)
|
2021-06-24 12:30:01 +00:00
|
|
|
// staggered layout with 2em spacing
|
2023-02-08 02:00:18 +00:00
|
|
|
assert-css: (".desc.docblock-short", { "padding-left": "32px" })
|
2021-12-12 17:28:58 +00:00
|
|
|
compare-elements-position-near: (
|
2024-07-07 00:12:53 +00:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']",
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
2022-07-27 05:11:21 +00:00
|
|
|
{"y": 2},
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
|
|
|
compare-elements-position: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
|
|
|
".item-name .stab.portability",
|
2024-04-01 19:11:22 +00:00
|
|
|
["y"],
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
2021-06-24 12:30:01 +00:00
|
|
|
|
|
|
|
// Ensure wrap
|
2021-12-12 17:28:58 +00:00
|
|
|
compare-elements-position-false: (
|
2024-07-07 00:12:53 +00:00
|
|
|
"//*[@class='item-name']//a[normalize-space()='replaced_function']/..",
|
|
|
|
"//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
|
2024-04-01 19:11:22 +00:00
|
|
|
["y"],
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
|
|
|
compare-elements-position-false: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
2024-07-07 00:12:53 +00:00
|
|
|
"//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
|
2024-04-01 19:11:22 +00:00
|
|
|
["y"],
|
2021-12-12 17:28:58 +00:00
|
|
|
)
|
2023-07-03 11:26:28 +00: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-07 00:12:53 +00:00
|
|
|
"//*[@class='stab portability']/code[normalize-space()='appservice-api-c']",
|
|
|
|
"//*[@class='stab portability']/code[normalize-space()='server']",
|
2024-04-01 19:11:22 +00:00
|
|
|
["y"],
|
2023-07-03 11:26:28 +00:00
|
|
|
)
|