class SubscriptionListView(BaseLoggedInView, SubscriptionSearchableViewMixin): """List of all subscriptions.""" table = SatSubscriptionsViewTable( locator='//div[@id="subscriptions-table"]//table', column_widgets={ 'Select all rows': Checkbox(locator=".//input[@type='checkbox']"), 'Name': Text("./a"), }, ) add_button = Button(href='subscriptions/add') manage_manifest_button = Button('Manage Manifest') export_csv_button = Button('Export CSV') delete_button = Button('Delete') progressbar = ProgressBar('//div[contains(@class,"progress-bar-striped")]') confirm_deletion = DeleteSubscriptionConfirmationDialog() columns_filter_checkboxes = SubscriptionColumnsFilter( ".//form[div[contains(@class, 'filter')]]/div/i" ) @property def is_displayed(self): return ( self.browser.wait_for_element('div#subscriptions-table', timeout=10, exception=False) is not None ) def is_searchable(self): """Customized is_searchable""" # The search box is always displayed, but in case of no manifest subscription the # welcome message is always displayed and there is no table element. if self.welcome_message.is_displayed: return False return super().is_searchable()
class task(SatTab): name = TaskReadOnlyEntry(name='Name') result = TaskReadOnlyEntry(name='Result') triggered_by = TaskReadOnlyEntry(name='Triggered by') execution_type = TaskReadOnlyEntry(name='Execution type') start_at = TaskReadOnlyEntry(name='Start at') started_at = TaskReadOnlyEntry(name='Started at') ended_at = TaskReadOnlyEntry(name='Ended at') start_before = TaskReadOnlyEntry(name='Start before') state = Text("//div[contains(@class, 'progress-description')]") progressbar = ProgressBar() output = TaskReadOnlyEntry(name='Output') errors = TaskReadOnlyEntry(name='Errors')
class TaskDetailsView(BaseLoggedInView): """Common view for task details screen. Can be found for most of tasks for various entities like Products, Repositories, Errata etc. """ breadcrumb = BreadCrumb() action_type = ReadOnlyEntry(name='Action Type') user = ReadOnlyEntry(name='User') started_at = ReadOnlyEntry(name='Started At') finished_at = ReadOnlyEntry(name='Finished At') parameters = ReadOnlyEntry(name='Parameters') state = ReadOnlyEntry(name='State') result = ReadOnlyEntry(name='Result') progressbar = ProgressBar() details = ReadOnlyEntry(name='Details')
class ProductTaskDetailsView(BaseLoggedInView): breadcrumb = BreadCrumb() action_type = ReadOnlyEntry(name='Action Type') user = ReadOnlyEntry(name='User') started_at = ReadOnlyEntry(name='Started At') finished_at = ReadOnlyEntry(name='Finished At') parameters = ReadOnlyEntry(name='Parameters') state = ReadOnlyEntry(name='State') result = ReadOnlyEntry(name='Result') progressbar = ProgressBar() details = ReadOnlyEntry(name='Details') @property def is_displayed(self): breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False) return (breadcrumb_loaded and self.breadcrumb.locations[0] == 'Products' and self.breadcrumb.locations[2] == 'Tasks' and len(self.breadcrumb.locations) > 3)