Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GUI test to check topbar resize #2330

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions gui-tests/topbar-resize.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Checks that the topbar is correctly displayed, whatever the screen width.

store-value: (window_height, 1000)

define-function: (
"check-topbar",
(width, text_display, search_display, search_max_width),
block {
set-window-size: (|width|, |window_height|)
wait-for-css: (".nav-container > .container a > .title", {"display": |text_display|})
assert-css: ("#search-input-nav", {"display": |search_display|, "max-width": |search_max_width|})
assert-size: ("body > .nav-container", {"height": |top_navbar_height|})

// And finally we check that the top navbar height didn't change.
store-size: ("body > .nav-container", {"height": tmp_top_navbar_height})
assert: |tmp_top_navbar_height| == |top_navbar_height|
}
)

go-to: |DOC_PATH| + "/sysinfo"

set-window-size: (1100, |window_height|)
store-size: ("body > .nav-container", {"height": top_navbar_height})

call-function: ("check-topbar", {
"width": 1000,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 900,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 872,
"text_display": "inline",
"search_display": "block",
"search_max_width": "200px",
})
// From this point, text should not be displayed anymore.
call-function: ("check-topbar", {
"width": 871,
"text_display": "none",
"search_display": "block",
"search_max_width": "200px",
})
call-function: ("check-topbar", {
"width": 768,
"text_display": "none",
"search_display": "block",
"search_max_width": "200px",
})
// From this point, search input should be smaller.
call-function: ("check-topbar", {
"width": 767,
"text_display": "none",
"search_display": "block",
"search_max_width": "150px",
})
call-function: ("check-topbar", {
"width": 568,
"text_display": "none",
"search_display": "block",
"search_max_width": "150px",
})
// From this point, search input should not be displayed anymore.
call-function: ("check-topbar", {
"width": 567,
"text_display": "none",
"search_display": "none",
"search_max_width": "150px",
})
// Even at very small width, we maintain the height of the topbar, but such cases will very likely
// never happen "in real life".
call-function: ("check-topbar", {
"width": 272,
"text_display": "none",
"search_display": "none",
"search_max_width": "150px",
})
Loading