From 39b8d6bacc72daa94e517f8c678d556d4012e56c Mon Sep 17 00:00:00 2001 From: Matyas Strelec Date: Tue, 7 Nov 2023 15:26:50 +0100 Subject: [PATCH] Pagination test --- tests/foreman/ui/test_pagination.py | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/foreman/ui/test_pagination.py diff --git a/tests/foreman/ui/test_pagination.py b/tests/foreman/ui/test_pagination.py new file mode 100644 index 00000000000..bf538213913 --- /dev/null +++ b/tests/foreman/ui/test_pagination.py @@ -0,0 +1,49 @@ +"""Test class for Locations UI + +:Requirement: Location + +:CaseAutomation: Automated + +:CaseLevel: Acceptance + +:CaseComponent: OrganizationsandLocations + +:Team: Endeavour + +:TestType: Functional + +:CaseImportance: High + +:Upstream: No +""" +import pytest + + +@pytest.mark.tier2 +def test_pagination(session): + """Dummy test for pagination + + Args: + session (_type_): _description_ + """ + with session: + + # Pagination in SatTable + view = session.task.navigate_to(session.task, 'All') + assert view.table.pagination.is_enabled is True + assert view.table.pagination.current_page == 1 + view.table.pagination.next_page() + assert view.table.pagination.current_page == 2 + view.table.pagination.previous_page() + assert view.table.pagination.current_page == 1 + assert view.table.pagination.total_pages > 0 + + # Pagination in a view with Table + view = session.location.navigate_to(session.location, 'All') + assert view.pagination.is_enabled is True + assert view.pagination.current_page == 1 + view.pagination.next_page() + assert view.pagination.current_page == 2 + view.pagination.previous_page() + assert view.pagination.current_page == 1 + assert view.pagination.total_pages > 0