Skip to content

Commit ab4c6e6

Browse files
committed
Add test steps to dashboard tests docstrings
CMK-24926 Change-Id: I8c0cefd409b3a6d42162c8ede5c297f0a647a3ac
1 parent 97137ad commit ab4c6e6

1 file changed

Lines changed: 46 additions & 1 deletion

File tree

tests/gui_e2e/test_dashboard.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@
2222

2323

2424
def test_dashboard_sanity_check(dashboard_page: Dashboard) -> None:
25+
"""Sanity check for the dashboard page.
26+
27+
Check that all default dashlets, dropdown buttons and icons are visible on the dashboard page.
28+
29+
Steps:
30+
1. Navigate to the 'Main dashboard' page.
31+
2. Check that the page title is correct.
32+
3. Check that all default dashlets are visible.
33+
4. Check that all dropdown buttons are visible.
34+
5. Check that all icons are visible.
35+
6. Check that the SVGs for 'Host statistics' and 'Service statistics' dashlets are visible.
36+
"""
2537
for dashlet_title in dashboard_page.default_dashlets_list:
2638
expect(dashboard_page.dashlet(dashlet_title)).to_be_visible()
2739

@@ -79,6 +91,14 @@ def test_host_dashboard(
7991
8092
Test that when agent data is available, the dashlets on the 'Linux Hosts'
8193
and 'Windows Hosts' pages have no errors and contain data.
94+
95+
Steps:
96+
1. Navigate to the 'Linux Hosts' or 'Windows Hosts' dashboard page.
97+
2. Check that there are no errors on the page.
98+
3. Check that scatterplots are visible on dashlets.
99+
4. Check that all expected dashlets are presented on the page.
100+
5. Check that dashlets with tables are not empty.
101+
6. Check that dashlets with charts contain data.
82102
"""
83103
hosts_count = len(request.getfixturevalue(hosts))
84104
not_empty_dashboards = dashlets_expected_row_count.keys()
@@ -143,6 +163,13 @@ def test_top_list_dashlets_settings(
143163
144164
Check that 'Service (exact match)' and 'Metric' fields contain expected values
145165
for some of the 'Top list' dashlets.
166+
167+
Steps:
168+
1. Navigate to the 'Linux Hosts' dashboard page.
169+
2. Enter layout mode.
170+
3. Open settings of the 'Top 10: Memory utilization' or 'Top 10: Disk utilization' dashlet.
171+
4. Check that 'Service (exact match)' field contains expected service name.
172+
5. Check that 'Metric' field contains expected metric name.
146173
"""
147174
hosts_dashboard_page = LinuxHostsDashboard(dashboard_page.page)
148175
hosts_dashboard_page.enter_layout_mode()
@@ -163,6 +190,17 @@ def test_dashlet_filters(dashboard_page: Dashboard, linux_hosts: list[str]) -> N
163190
164191
Test that after applying 'Site', 'Host label' and both filters together in dashlet settings,
165192
the dashlet table contains all expected hosts.
193+
194+
Steps:
195+
1. Navigate to the 'Linux Hosts' dashboard page.
196+
2. Enter layout mode.
197+
3. Apply 'Site' filter for 'Top 10: CPU utilization' dashlet.
198+
4. Check that dashlet contains all expected hosts.
199+
5. Apply 'label' filter for 'Top 10: CPU utilization'
200+
6. Check that dashlet contains all expected hosts.
201+
7. Delete 'Site' filter.
202+
8. Check that dashlet contains all expected hosts.
203+
9. Delete 'Label' filter.
166204
"""
167205
hosts_count = len(linux_hosts)
168206
dashlet_title = "Top 10: CPU utilization"
@@ -197,7 +235,7 @@ def test_dashlet_filters(dashboard_page: Dashboard, linux_hosts: list[str]) -> N
197235
logger.info("Check that filtered '%s' dashlet contains all expected hosts", dashlet_title)
198236
expect(linux_hosts_dashboard_page.dashlet_table_rows(dashlet_title)).to_have_count(hosts_count)
199237

200-
logger.info("Delete 'label' filter")
238+
logger.info("Delete 'Label' filter")
201239
linux_hosts_dashboard_page.edit_properties_button(dashlet_title).click()
202240
edit_element_top_list_page.remove_host_filter_button("Host labels").click()
203241
edit_element_top_list_page.save_button.click()
@@ -208,6 +246,13 @@ def test_add_top_list_dashlet(dashboard_page: Dashboard, linux_hosts: list[str])
208246
209247
Add 'Top list' dashlet for 'Total execution time' metric to the 'Linux Hosts' dashboard. Check
210248
that the dashlet is visible and not empty.
249+
250+
Steps:
251+
1. Navigate to the 'Linux Hosts' dashboard page.
252+
2. Enter layout mode.
253+
3. Add 'Top list' dashlet for 'Total execution time' metric.
254+
4. Check that the dashlet is visible and not empty.
255+
5. Delete the dashlet.
211256
"""
212257
hosts_count = len(linux_hosts)
213258
metric = "Total execution time"

0 commit comments

Comments
 (0)