diff --git a/airgun/views/acs.py b/airgun/views/acs.py index 5f9001dd7..b17f5fc4d 100644 --- a/airgun/views/acs.py +++ b/airgun/views/acs.py @@ -4,7 +4,7 @@ Drawer, Dropdown, FormSelect, - Pagination, + Pagination as PF4Pagination, Radio, Switch, ) @@ -364,7 +364,7 @@ class acs_drawer(Drawer): ) clear_search = OUIAButton('empty-state-secondary-action-router-link') - pagination = Pagination() + pagination = PF4Pagination() @property def is_displayed(self): diff --git a/airgun/views/ansible_role.py b/airgun/views/ansible_role.py index fcb524db9..8f6729196 100644 --- a/airgun/views/ansible_role.py +++ b/airgun/views/ansible_role.py @@ -1,14 +1,14 @@ from widgetastic.widget import Checkbox, Table, Text from widgetastic_patternfly import BreadCrumb -from widgetastic_patternfly4 import Button, PatternflyTable +from widgetastic_patternfly4 import ( + Button, + CompactPagination, + Pagination as PF4Pagination, + PatternflyTable, +) from airgun.views.common import BaseLoggedInView, SearchableViewMixin -from airgun.widgets import ActionsDropdown, Pagination - - -class ImportPagination(Pagination): - PER_PAGE_BUTTON_DROPDOWN = ".//div[button[@id='pagination-options-menu-toggle-2']]" - total_items = Text("//span[@class='pf-c-optionsmenu__toggle-text']/b[2]") +from airgun.widgets import ActionsDropdown class AnsibleRolesView(BaseLoggedInView, SearchableViewMixin): @@ -26,7 +26,7 @@ class AnsibleRolesView(BaseLoggedInView, SearchableViewMixin): 'Actions': ActionsDropdown("./div[contains(@class, 'btn-group')]"), }, ) - pagination = Pagination() + pagination = PF4Pagination() @property def is_displayed(self): @@ -45,7 +45,7 @@ class AnsibleRolesImportView(BaseLoggedInView): 0: Checkbox(locator='.//input[@type="checkbox"]'), }, ) - pagination = ImportPagination() + pagination = CompactPagination() submit = Button('Submit') cancel = Button('Cancel') diff --git a/airgun/views/ansible_variable.py b/airgun/views/ansible_variable.py index 2b23f0afe..7a24d8f3e 100644 --- a/airgun/views/ansible_variable.py +++ b/airgun/views/ansible_variable.py @@ -2,7 +2,7 @@ from widgetastic_patternfly import BreadCrumb from airgun.views.common import BaseLoggedInView, SatTable, SearchableViewMixinPF4 -from airgun.widgets import CustomParameter, FilteredDropdown, Pagination, SatSelect +from airgun.widgets import CustomParameter, FilteredDropdown, SatSelect class AnsibleVariablesView(BaseLoggedInView, SearchableViewMixinPF4): @@ -17,7 +17,6 @@ class AnsibleVariablesView(BaseLoggedInView, SearchableViewMixinPF4): 'Actions': Text(".//a[@data-method='delete']"), }, ) - pagination = Pagination() @property def is_displayed(self): diff --git a/airgun/views/cloud_insights.py b/airgun/views/cloud_insights.py index 88d66c8eb..71fb3db51 100644 --- a/airgun/views/cloud_insights.py +++ b/airgun/views/cloud_insights.py @@ -1,5 +1,5 @@ from widgetastic.widget import Checkbox, Text, TextInput, View -from widgetastic_patternfly4 import Button, Pagination +from widgetastic_patternfly4 import Button, Pagination as PF4Pagination from widgetastic_patternfly4.dropdown import Dropdown from widgetastic_patternfly4.ouia import Modal, PatternflyTable, Switch @@ -58,7 +58,7 @@ class CloudInsightsView(BaseLoggedInView, SearchableViewMixinPF4): ) select_all_hits = Button('Select recommendations from all pages') clear_hits_selection = Button('Clear Selection') - pagination = Pagination() + pagination = PF4Pagination() remediation_window = View.nested(RemediationView) @property diff --git a/airgun/views/filter.py b/airgun/views/filter.py index 61e0b766c..486e6c872 100644 --- a/airgun/views/filter.py +++ b/airgun/views/filter.py @@ -7,12 +7,12 @@ View, ) from widgetastic_patternfly import BreadCrumb +from widgetastic_patternfly4 import Pagination as PF4Pagination from airgun.views.common import BaseLoggedInView, SatTab from airgun.widgets import ( ActionsDropdown, MultiSelect, - Pagination, PF4FilteredDropdown, PF4MultiSelect, Search, @@ -29,7 +29,7 @@ class FiltersView(BaseLoggedInView): 'Actions': ActionsDropdown("./div[contains(@class, 'btn-group')]"), }, ) - pagination = Pagination() + pagination = PF4Pagination() @property def is_displayed(self): diff --git a/airgun/views/host_new.py b/airgun/views/host_new.py index 3bac5c8fc..4bffe90b2 100644 --- a/airgun/views/host_new.py +++ b/airgun/views/host_new.py @@ -2,7 +2,13 @@ from widgetastic.widget import Checkbox, Text, TextInput, View, Widget from widgetastic.widget.table import Table -from widgetastic_patternfly4 import Button, Dropdown, Pagination, Select, Tab +from widgetastic_patternfly4 import ( + Button, + Dropdown, + Pagination as PF4Pagination, + Select, + Tab, +) from widgetastic_patternfly4.ouia import ( BreadCrumb, Button as OUIAButton, @@ -360,7 +366,7 @@ class packages(Tab): 5: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class errata(Tab): @@ -387,7 +393,7 @@ class errata(Tab): 8: Dropdown(locator='./div'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class module_streams(Tab): @@ -413,7 +419,7 @@ class module_streams(Tab): 5: DropdownWithDescripton(locator='.//div[contains(@class, "pf-c-dropdown")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class repository_sets(Tab): @@ -447,7 +453,7 @@ class repository_sets(Tab): 6: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class parameters(Tab): @@ -482,7 +488,7 @@ class parameters(Tab): 5: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class traces(Tab): @@ -505,7 +511,7 @@ class traces(Tab): 4: Button(locator='.//button[contains(@aria-label, "Actions")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class ansible(Tab): @@ -524,7 +530,7 @@ class roles(Tab): locator='.//table[contains(@class, "pf-c-table")]', column_widgets={'Name': Text('.//a')}, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class variables(Tab): @@ -546,7 +552,7 @@ class variables(Tab): 7: Button(locator='.//button[@aria-label="Edit override button"]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class inventory(Tab): @@ -590,7 +596,7 @@ class jobs(Tab): 4: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @property def is_displayed(self): @@ -610,7 +616,7 @@ class previous(Tab): 'Schedule': Text('./span'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @property def is_displayed(self): @@ -634,7 +640,7 @@ class puppet(Tab): 7: Button(locator='.//button[contains(@aria-label, "Actions")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class enc_preview(Tab): @@ -675,7 +681,7 @@ class reports(Tab): }, ) - pagination = Pagination() + pagination = PF4Pagination() @View.nested class insights(Tab): @@ -700,7 +706,7 @@ class insights(Tab): 4: Button(locator='.//button[contains(@aria-label, "Actions")]'), }, ) - pagination = Pagination() + pagination = PF4Pagination() class InstallPackagesView(View): @@ -719,7 +725,7 @@ class InstallPackagesView(View): 'Version': Text('./parent::td'), }, ) - pagination = Pagination() + pagination = PF4Pagination() install = Button(locator='.//button[(normalize-space(.)="Install")]') cancel = Button('Cancel') @@ -734,7 +740,7 @@ class AllAssignedRolesView(View): locator='.//table[contains(@class, "pf-c-table")]', column_widgets={'Name': Text('.//a'), 'Source': Text('.//a')}, ) - pagination = Pagination() + pagination = PF4Pagination() class EnableTracerView(View): @@ -773,7 +779,7 @@ class ManageHostCollectionModal(View): }, ) - pagination = Pagination() + pagination = PF4Pagination() add = OUIAButton('add-button') remove = OUIAButton('add-button') diff --git a/airgun/views/location.py b/airgun/views/location.py index 0dc241bbd..b862e2440 100644 --- a/airgun/views/location.py +++ b/airgun/views/location.py @@ -1,5 +1,6 @@ from widgetastic.widget import Checkbox, Table, Text, TextInput, View from widgetastic_patternfly import BreadCrumb +from widgetastic_patternfly4 import Pagination as PF4Pagination from airgun.views.common import BaseLoggedInView, SatVerticalTab, SearchableViewMixinPF4 from airgun.widgets import ( @@ -20,6 +21,7 @@ class LocationsView(BaseLoggedInView, SearchableViewMixinPF4): 'Actions': ActionsDropdown("./div[contains(@class, 'btn-group')]"), }, ) + pagination = PF4Pagination() @property def is_displayed(self): diff --git a/airgun/views/task.py b/airgun/views/task.py index 25bd7be15..f7931b0cb 100644 --- a/airgun/views/task.py +++ b/airgun/views/task.py @@ -1,7 +1,6 @@ from wait_for import wait_for from widgetastic.widget import Table, Text, View from widgetastic_patternfly import BreadCrumb -from widgetastic_patternfly4 import Pagination from airgun.views.common import BaseLoggedInView, SatTab, SearchableViewMixinPF4 from airgun.widgets import ( @@ -33,7 +32,6 @@ class TasksView(BaseLoggedInView, SearchableViewMixinPF4): 'Action': Text('./a'), }, ) - pagination = Pagination() @property def is_displayed(self): diff --git a/airgun/widgets.py b/airgun/widgets.py index ef4e309b2..3ee8ff191 100644 --- a/airgun/widgets.py +++ b/airgun/widgets.py @@ -26,6 +26,7 @@ Kebab, VerticalNavigation, ) +from widgetastic_patternfly4 import Pagination as PF4Pagination from widgetastic_patternfly4.ouia import BaseSelect, Button as PF4Button, Dropdown from airgun.exceptions import DisabledWidgetError, ReadOnlyWidgetError @@ -1744,12 +1745,6 @@ def fill(self, values): widget.fill(value) -class SatTablePagination(Pagination): - """Paginator widget for use within SatTable.""" - - ROOT = "//form[contains(@class, 'content-view-pf-pagination')]" - - class SatTable(Table): """Satellite version of table. @@ -1790,7 +1785,9 @@ class SatTable(Table): "contains(@data-block, 'no-search-results-message')]" ) tbody_row = Text('./tbody/tr') - pagination = SatTablePagination() + pagination = PF4Pagination( + locator="//div[contains(@class, 'pf-c-pagination') and not(contains(@class, 'pf-m-compact'))]" + ) @property def has_rows(self):