class InlineTastePage(ModelAdminPage): """ Page class for a Fitting admin page. """ bottle = SelectElement('bottle') label = SelectElement('label') def __init__(self, *args, **kwargs): """ """ super(InlineTastePage, self).__init__(*args, **kwargs) self.datetime = AutocompleteElement(self.driver, 'taste-0-datetime') self.location = AutocompleteElement(self.driver, 'taste-0-location') self.content = AutocompleteElement(self.driver, 'taste-0-content') self.title = AutocompleteElement(self.driver, 'taste-0-title') self.author = AutocompleteElement(self.driver, 'taste-0-author')
class CondenserPage(ConfigToolPage): """ Page class for a Condenser admin page. """ name = TextInputElement('name') bottle = SelectElement('bottle') content_type_0 = SelectElement('fittings-0-content_type') object_id_0 = TextInputElement('fittings-0-object_id') lookup_0 = LinkElement('lookup_id_fittings-0-object_id') content_type_1 = SelectElement('fittings-1-content_type') object_id_1 = TextInputElement('fittings-1-object_id') lookup_1 = LinkElement('lookup_id_fittings-1-object_id') def __init__(self, driver): super(CondenserPage, self).__init__(driver) self.target_field_0 = AutocompleteElement(self.driver, 'fittings-0-target_field') self.target_field_1 = AutocompleteElement(self.driver, 'fittings-1-target_field') def add_fitting(self): """ Clicks the 'add fitting' button. """ element = self.driver.find_element(*CondenserPageLocators.ADD_FITTING) element.click() def remove_fitting(self): """ Clicks the 'remove fitting' button. """ self.scroll_to_bottom() element = self.driver.find_element( *CondenserPageLocators.REMOVE_FITTING) element.click() def delete_fitting(self): """ Deletes the first inline fitting. """ element = self.driver.find_element( *CondenserPageLocators.DELETE_FITTING_0) element.click()
class ContextPage(ModelAdminPage): """ Page class for a Context admin page. """ name = TextInputElement('name') primary_distillery = SelectElement('primary_distillery') related_distillery = SelectElement('related_distillery') def __init__(self, driver): super(ContextPage, self).__init__(driver) self.search_field_0 = AutocompleteElement(self.driver, 'filters-0-search_field') self.operator_0 = AutocompleteElement(self.driver, 'filters-0-operator') self.value_field_0 = AutocompleteElement(self.driver, 'filters-0-value_field') self.search_field_1 = AutocompleteElement(self.driver, 'filters-1-search_field') self.operator_1 = AutocompleteElement(self.driver, 'filters-1-operator') self.value_field_1 = AutocompleteElement(self.driver, 'filters-1-value_field') def add_filter(self): """ Clicks the 'add filter' button. """ element = self.driver.find_element(*ContextPageLocators.ADD_FILTER) element.click() def remove_fitting(self): """ Clicks the 'remove filter' button. """ element = self.driver.find_element(*ContextPageLocators.REMOVE_FILTER) element.click() def delete_fitting(self): """ Deletes the first inline filter. """ element = self.driver.find_element( *ContextPageLocators.DELETE_FILTER_0) element.click()
class FittingPage(ModelAdminPage, GenericRelationMixin): """ Page class for a Fitting admin page. """ condenser = SelectElement('condenser') def __init__(self, *args, **kwargs): super(FittingPage, self).__init__(*args, **kwargs) self.target_field = AutocompleteElement(self.driver, 'target_field')
class ContextFilterPage(ModelAdminPage): """ Page class for a ContextFilter admin page. """ context = SelectElement('context') def __init__(self, *args, **kwargs): super(ContextFilterPage, self).__init__(*args, **kwargs) self.search_field = AutocompleteElement(self.driver, 'search_field') self.operator = AutocompleteElement(self.driver, 'operator') self.value_field = AutocompleteElement(self.driver, 'value_field')
class TastePage(ModelAdminPage): """ Page class for a Taste admin page. """ container = SelectElement('container') def __init__(self, *args, **kwargs): """ """ super(TastePage, self).__init__(*args, **kwargs) self.datetime = AutocompleteElement(self.driver, 'datetime') self.location = AutocompleteElement(self.driver, 'location') self.content = AutocompleteElement(self.driver, 'content') self.title = AutocompleteElement(self.driver, 'title') self.author = AutocompleteElement(self.driver, 'author')