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

[6.14.z] Pagination test #13084

Closed
wants to merge 1 commit into from
Closed
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
59 changes: 59 additions & 0 deletions tests/foreman/ui/test_pagination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""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, Pagination disabled
view = session.location.navigate_to(session.location, 'All')
assert view.pagination.is_enabled is False
assert view.pagination.current_page == 1
assert view.pagination.total_pages > 0

# Create dummy locations to fill table
for i in range(0, 21):
session.location.create({'name': f'location{i}'})

# Pagination in a view with Table, Pagination enabled
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
Loading