Skip to content

Commit

Permalink
Add saas status menu item
Browse files Browse the repository at this point in the history
Change-Id: Ibf9933dc6d66df825b1d53a4f0c47b93c68fa5ed
  • Loading branch information
jorangetree committed Dec 30, 2024
1 parent 450adc6 commit 14fa63c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
50 changes: 34 additions & 16 deletions cmk/gui/main_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,7 @@ def _help_menu_topics() -> list[TopicMenuTopic]:
name="about_checkmk",
title=_("About Checkmk"),
icon="about_checkmk",
items=[
TopicMenuItem(
name="info",
title=_("Info"),
url="info.py",
sort_index=10,
icon="checkmk_logo_min",
),
TopicMenuItem(
name="change_log",
title=_("Change log (Werks)"),
url="change_log.py",
sort_index=20,
icon="checkmk_logo_min",
),
],
items=get_about_checkmk_items(),
),
]

Expand Down Expand Up @@ -247,3 +232,36 @@ def license_status() -> HTML | str:
target="main",
)
return HTMLWriter.render_br() + status_message


def get_about_checkmk_items() -> list[TopicMenuItem]:
items = [
TopicMenuItem(
name="info",
title=_("Information"),
url="info.py",
sort_index=20,
icon="about_checkmk",
),
TopicMenuItem(
name="change_log",
title=_("Change log (Werks)"),
url="change_log.py",
sort_index=30,
icon="checkmk_logo_min",
),
]

if edition() == Edition.CSE:
items.insert(
0,
TopicMenuItem(
name="saas_status_page",
title=_("Status page"),
url="https://status.checkmk.cloud",
target="_blank",
sort_index=10,
icon="status",
),
)
return items
7 changes: 7 additions & 0 deletions tests/gui_e2e/test_menu_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# conditions defined in the file COPYING, which is part of this source code package.

from tests.testlib.playwright.pom.login import LoginPage
from tests.testlib.pytest_helpers.marks import skip_if_not_saas_edition


def test_help_beginners_guide(logged_in_page: LoginPage) -> None:
Expand Down Expand Up @@ -69,3 +70,9 @@ def test_help_info(logged_in_page: LoginPage) -> None:
def test_help_werks(logged_in_page: LoginPage) -> None:
response = logged_in_page.go(logged_in_page.main_menu.help_werks.get_attribute("href"))
assert response and response.ok


@skip_if_not_saas_edition
def test_saas_status_page(logged_in_page: LoginPage) -> None:
href = logged_in_page.main_menu.help_saas_status_page.get_attribute("href")
assert href is not None and "status.checkmk.com" in href
4 changes: 4 additions & 0 deletions tests/testlib/playwright/pom/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ def help_rest_api_gui(self) -> Locator:
def help_info(self) -> Locator:
return self.help_menu("Info")

@property
def help_saas_status_page(self) -> Locator:
return self.help_menu("Status page")

@property
def help_werks(self) -> Locator:
return self.help_menu("Change log (Werks)")
Expand Down

0 comments on commit 14fa63c

Please sign in to comment.