Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     ParametrizedView.__init__(self, *args, **kwargs)
     self.download.click()
     self.link.click()
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     ParametrizedView.__init__(self, *args, **kwargs)
     self.download.click()
     self.link.click()
 class TestView(View):
     ROOT = ".//div[@id='ws-react-c-chip-group-single']"
     chips = ParametrizedView.nested(Chip)
Ejemplo n.º 4
0
class DatastoreTileIconEntity(BaseTileIconEntity):
    quad_icon = ParametrizedView.nested(DatastoreQuadIconEntity)
Ejemplo n.º 5
0
class HostTileIconEntity(BaseTileIconEntity):
    quad_icon = ParametrizedView.nested(HostQuadIconEntity)
Ejemplo n.º 6
0
 class entities(View):  # noqa
     summary = ParametrizedView.nested(ParametrizedSummaryTable)
Ejemplo n.º 7
0
class InstanceTileIconEntity(BaseTileIconEntity):
    """ Provider child of Tile Icon entity

    """
    quad_icon = ParametrizedView.nested(InstanceQuadIconEntity)
Ejemplo n.º 8
0
class VolumeTileIconEntity(BaseTileIconEntity):
    quad_icon = ParametrizedView.nested(VolumeQuadIconEntity)
Ejemplo n.º 9
0
class HostDetailsEntities(View):
    """Represents Details page."""
    summary = ParametrizedView.nested(ParametrizedSummaryTable)
Ejemplo n.º 10
0
class DepRoleTileIconEntity(BaseTileIconEntity):
    quad_icon = ParametrizedView.nested(DepRoleQuadIconEntity)
class PhysicalServerTileIconEntity(BaseTileIconEntity):
    quad_icon = ParametrizedView.nested(PhysicalServerQuadIconEntity)
Ejemplo n.º 12
0
 def __init__(self, *args, **kwargs):
     ParametrizedView.__init__(self, *args, **kwargs)
Ejemplo n.º 13
0
class StandAloneChipGroup(View):
    """
    Represents a chip group that is "on its own", i.e. not a part of a chip group toolbar
    """

    ROOT = ParametrizedLocator("{@locator}")

    overflow = OverflowChip()
    chips = ParametrizedView.nested(Chip)

    def __init__(self, parent, locator=None, logger=None):
        super().__init__(parent, logger=logger)
        self.locator = locator or GROUP_ROOT

    @property
    def label(self):
        # It's unlikely we'll have a labelled chip group that is not in a toolbar
        # ... but just in case
        elements = self.browser.elements(STANDALONE_GROUP_LABEL)
        return self.browser.text(elements[0]) if elements else None

    def show_more(self):
        """Expands a chip group"""
        self.overflow.show_more()

    def show_less(self):
        """Collapses a chip group"""
        self.overflow.show_less()

    @property
    def is_multiselect(self):
        return self.overflow.is_displayed

    def get_chips(self, show_more=True):
        """
        A helper to expand the chip group before reading its chips
        """
        if self.is_multiselect and show_more:
            self.show_more()
        return self.chips

    def __iter__(self):
        for chip in self.get_chips():
            yield chip

    def remove_chip_by_name(self, name):
        """Removes a chip from the group by name"""
        for chip in self:
            if chip.text.lower() == name.lower():
                chip.remove()
                break
        else:
            raise ValueError(f"Could not find chip with name '{name}'")

    def remove_all_chips(self):
        """Removes all chips from the group"""
        for chip in self:
            chip.remove()

    def read(self):
        return [chip.text for chip in self]
Ejemplo n.º 14
0
class StandAloneChipGroup(ChipGroup):
    chips = ParametrizedView.nested(OldChip)
    overflow = ParametrizedView.nested(OldOverflowChip)
class Cards(CardGroup):
    def __init__(self, parent, locator=None, logger=None, **kwargs):
        View.__init__(self, parent, logger=logger, **kwargs)
        self.locator = locator or './/section[@class="pf-c-page__main-section"]/div'

    cards = ParametrizedView.nested(PageCard)
Ejemplo n.º 16
0
class Cards(CardGroup):
    def __init__(self, parent, locator=None, logger=None, **kwargs):
        View.__init__(self, parent, logger=logger, **kwargs)
        self.locator = locator or './/div[contains(@class, "pf-l-gallery")]'

    cards = ParametrizedView.nested(PageCard)