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.
|
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
|
|
|
|
|
|
|
// 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: (
|
2023-02-08 02:00:18 +00:00
|
|
|
"//*[@class='item-name']//a[text()='replaced_function']",
|
|
|
|
".item-name .stab.deprecated",
|
2021-12-12 17:28:58 +00:00
|
|
|
{"y": 2},
|
|
|
|
)
|
|
|
|
compare-elements-position: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
|
|
|
".item-name .stab.portability",
|
2021-12-12 17:28:58 +00:00
|
|
|
("y"),
|
|
|
|
)
|
2021-06-24 12:30:01 +00:00
|
|
|
|
|
|
|
// Ensure no wrap
|
2021-12-12 17:28:58 +00:00
|
|
|
compare-elements-position: (
|
2023-02-08 02:00:18 +00:00
|
|
|
"//*[@class='item-name']//a[text()='replaced_function']/..",
|
|
|
|
"//*[@class='desc docblock-short'][text()='a thing with a label']",
|
2021-12-12 17:28:58 +00:00
|
|
|
("y"),
|
|
|
|
)
|
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: (
|
2023-02-08 02:00:18 +00:00
|
|
|
"//*[@class='item-name']//a[text()='replaced_function']",
|
|
|
|
".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",
|
2021-12-12 17:28:58 +00:00
|
|
|
("y"),
|
|
|
|
)
|
2021-06-24 12:30:01 +00:00
|
|
|
|
|
|
|
// Ensure wrap
|
2021-12-12 17:28:58 +00:00
|
|
|
compare-elements-position-false: (
|
2023-02-08 02:00:18 +00:00
|
|
|
"//*[@class='item-name']//a[text()='replaced_function']/..",
|
|
|
|
"//*[@class='desc docblock-short'][text()='a thing with a label']",
|
2021-12-12 17:28:58 +00:00
|
|
|
("y"),
|
|
|
|
)
|
|
|
|
compare-elements-position-false: (
|
2023-02-08 02:00:18 +00:00
|
|
|
".item-name .stab.deprecated",
|
|
|
|
"//*[@class='desc docblock-short'][text()='a thing with a label']",
|
2021-12-12 17:28:58 +00:00
|
|
|
("y"),
|
|
|
|
)
|
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: (
|
|
|
|
"//*[@class='stab portability']/code[text()='appservice-api-c']",
|
|
|
|
"//*[@class='stab portability']/code[text()='server']",
|
|
|
|
("y"),
|
|
|
|
)
|