Ejemplo n.º 1
0
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pom import ui
from selenium.webdriver.common.by import By

from stepler.horizon.app import ui as _ui

from ..instances.page_instances import FormLaunchInstance


@ui.register_ui(field_name=ui.TextField(By.NAME, 'name'),
                field_description=ui.TextField(By.NAME, 'description'),
                field_size=ui.TextField(By.NAME, 'size'),
                combobox_image_source=ui.ComboBox(By.NAME, 'image_source'),
                combobox_volume_source=ui.ComboBox(By.NAME, 'volume_source'),
                combobox_source_type=ui.ComboBox(By.NAME,
                                                 'volume_source_type'),
                combobox_volume_type=ui.ComboBox(By.NAME, 'type'))
class FormCreateVolume(_ui.Form):
    """Form to create volume."""


@ui.register_ui(field_name=ui.TextField(By.NAME, 'name'))
class FormEditVolume(_ui.Form):
    """Form to edit volume."""


@ui.register_ui(
    item_change_volume_type=ui.UI(By.CSS_SELECTOR, '*[id$="action_retype"]'),
Ejemplo n.º 2
0
@ui.register_ui(
    link_next=ui.UI(By.CSS_SELECTOR, 'a[href^="?snapshot_marker="]'),
    link_prev=ui.UI(By.CSS_SELECTOR, 'a[href^="?prev_snapshot_marker="]'))
class TableSnapshots(_ui.Table):
    """Volume snapshots table."""

    columns = {'name': 2,
               'description': 3,
               'size': 4,
               'status': 5,
               'volume_name': 6}
    row_cls = RowSnapshot


@ui.register_ui(
    combobox_source=ui.ComboBox(By.NAME, 'snapshot_source'),
    combobox_type=ui.ComboBox(By.NAME, 'type'),
    field_description=ui.TextField(By.NAME, 'description'),
    field_name=ui.TextField(By.NAME, 'name'),
    field_size=ui.IntegerField(By.NAME, 'size'))
class FormCreateVolume(_ui.Form):
    """Form to create volume from snapshot."""


@ui.register_ui(
    button_delete_snapshots=ui.Button(By.ID,
                                      'volume_snapshots__action_delete'),
    form_create_volume=FormCreateVolume(By.CSS_SELECTOR,
                                        'form[action*="volumes/create"]'),
    form_edit_snapshot=FormCreateSnapshot(By.ID, 'update_snapshot_form'),
    table_snapshots=TableSnapshots(By.ID, 'volume_snapshots'))
Ejemplo n.º 3
0
                link_prev=ui.UI(By.CSS_SELECTOR,
                                'a[href^="?prev_snapshot_marker="]'))
class TableSnapshots(_ui.Table):
    """Volume snapshots table."""

    columns = {
        'name': 2,
        'description': 3,
        'size': 4,
        'status': 5,
        'volume_name': 6
    }
    row_cls = RowSnapshot


@ui.register_ui(combobox_source=ui.ComboBox(By.NAME, 'snapshot_source'),
                combobox_type=ui.ComboBox(By.NAME, 'type'),
                field_description=ui.TextField(By.NAME, 'description'),
                field_name=ui.TextField(By.NAME, 'name'),
                field_size=ui.IntegerField(By.NAME, 'size'))
class FormCreateVolume(_ui.Form):
    """Form to create volume from snapshot."""


@ui.register_ui(
    button_delete_snapshots=ui.Button(By.ID,
                                      'volume_snapshots__action_delete'),
    form_create_volume=FormCreateVolume(By.CSS_SELECTOR,
                                        'form[action*="volumes/create"]'),
    form_edit_snapshot=FormCreateSnapshot(By.ID, 'update_snapshot_form'),
    table_snapshots=TableSnapshots(By.ID, 'volume_snapshots'))
Ejemplo n.º 4
0
                                        'button.btn.btn-default'))
class RowAllocated(_ui.Row):
    """Row with allocated item."""

    cell_cls = CellAvailable


class TableAvailableSources(_ui.Table):
    """Available sources table."""

    columns = {'name': 2}
    row_cls = RowAvailable


@ui.register_ui(
    combobox_boot_source=ui.ComboBox(By.NAME, 'boot-source-type'),
    radio_volume_create=RadioVolumeCreate(
        By.XPATH,
        '//div[contains(@class, "btn-group") and label[@id="vol-create"]]'),
    table_available_sources=TableAvailableSources(By.CSS_SELECTOR,
                                                  'available table'))
class TabSource(ui.Block):
    """Source tab."""


class TableAvailableFlavors(_ui.Table):
    """Available flavors table."""

    columns = {'name': 2, 'ram': 4, 'root_disk': 6}
    row_cls = RowAvailable
    row_xpath = './/tr[@ng-repeat-start]'
Ejemplo n.º 5
0
@ui.register_ui(checkbox=_ui.CheckBox(By.CSS_SELECTOR,
                                      'input[type="checkbox"]'),
                dropdown_menu=_ui.DropdownMenu())
class RowNamespace(_ui.Row):
    """Row with namespace in namespaces table."""


class TableNamespaces(_ui.Table):
    """Namespaces table."""

    columns = {'name': 2}
    row_cls = RowNamespace


@ui.register_ui(field_namespace_json=ui.TextField(By.NAME, 'direct_input'),
                combobox_namespace_source=ui.ComboBox(By.NAME, 'source_type'))
class FormImportNamespace(_ui.Form):
    """Form to create namespace."""


@ui.register_ui(button_import_namespace=ui.Button(By.ID,
                                                  'namespaces__action_import'),
                form_import_namespace=FormImportNamespace(
                    By.ID, 'create_metadata_form'),
                table_namespaces=TableNamespaces(By.ID, 'namespaces'))
class PageMetadataDefinitions(PageBase):
    """Metadata definitions page."""

    url = "/admin/metadata_defs/"
    navigate_items = 'Admin', 'System', 'Metadata Definitions'
Ejemplo n.º 6
0
    button_remove=ui.Button(By.CSS_SELECTOR, 'button.btn.btn-default'))
class RowAllocated(_ui.Row):
    """Row with allocated item."""

    cell_cls = CellAvailable


class TableAvailableSources(_ui.Table):
    """Available sources table."""

    columns = {'name': 2}
    row_cls = RowAvailable


@ui.register_ui(
    combobox_boot_source=ui.ComboBox(By.NAME, 'boot-source-type'),
    radio_volume_create=RadioVolumeCreate(
        By.XPATH,
        '//div[contains(@class, "btn-group") and label[@id="vol-create"]]'),
    table_available_sources=TableAvailableSources(
        By.CSS_SELECTOR, 'available table'))
class TabSource(ui.Block):
    """Source tab."""


class TableAvailableFlavors(_ui.Table):
    """Available flavors table."""

    columns = {'name': 2, 'ram': 4, 'root_disk': 6}
    row_cls = RowAvailable
    row_xpath = './/tr[@ng-repeat-start]'
Ejemplo n.º 7
0

class TableImages(_ui.Table):
    """Images table."""

    columns = {'name': 2}
    row_cls = RowImage


@ui.register_ui(
    button_group_protected=_ui.button_group_by_label("Protected"),
    field_min_disk=ui.TextField(By.NAME, 'min_disk'),
    field_min_ram=ui.TextField(By.NAME, 'min_ram'),
    field_description=ui.TextField(By.NAME, 'description'),
    field_name=ui.TextField(By.NAME, 'name'),
    combobox_disk_format=ui.ComboBox(By.NAME, 'format'),
)
class FormImage(_ui.Form):
    """Base image form."""
    submit_locator = By.CSS_SELECTOR, '.modal-footer .btn.btn-primary'


@ui.register_ui(
    button_group_source_type=_ui.button_group_by_label("Source Type"),
    field_image_file=_ui.FileField(
        By.XPATH, './/*[contains(@class, "form-group") and '
        './label[contains(., "File")]]'
        '//*[contains(@class, "input-group")]'),
    field_image_url=ui.TextField(By.NAME, 'image_url'),
)
class FormCreateImage(FormImage):
Ejemplo n.º 8
0
    """Dropdown menu of floating IP."""


@ui.register_ui(checkbox=_ui.CheckBox(By.CSS_SELECTOR,
                                      'input[type="checkbox"]'),
                dropdown_menu=DropdownMenu())
class RowFloatingIP(_ui.Row):
    """Row with floating ip."""


class TableFloatingIPs(_ui.Table):
    """Table with floating IPs."""

    columns = {'ip_address': 2, 'mapped_fixed_ip_address': 3}
    row_cls = RowFloatingIP


@ui.register_ui(combobox_port=ui.ComboBox(By.NAME, 'instance_id'))
class FormAssociate(_ui.Form):
    """Form to associate."""


@ui.register_ui(
    button_allocate_ip=ui.Button(By.ID, 'floating_ips__action_allocate'),
    form_allocate_ip=FormAllocateIP(By.ID, 'associate_floating_ip_form'),
    form_associate=FormAssociate(By.CSS_SELECTOR,
                                 '[action*="floating_ips/associate"]'),
    table_floating_ips=TableFloatingIPs(By.ID, 'floating_ips'))
class TabFloatingIPs(_ui.Tab):
    """Floating IPs tab."""
Ejemplo n.º 9
0
                                      'input[type="checkbox"]'),
                dropdown_menu=DropdownMenu(),
                link_username=ui.UI(By.CSS_SELECTOR,
                                    'td[data-cell-name="name"] a'))
class RowUser(_ui.Row):
    """User row of users table."""


class TableUsers(_ui.Table):
    """Users table."""

    columns = {'name': 2, 'email': 4, 'enabled': 7}
    row_cls = RowUser


@ui.register_ui(combobox_project=ui.ComboBox(By.NAME, 'project'),
                combobox_role=ui.ComboBox(By.NAME, 'role_id'),
                field_confirm_password=ui.TextField(By.NAME,
                                                    'confirm_password'),
                field_name=ui.TextField(By.NAME, 'name'),
                field_password=ui.TextField(By.NAME, 'password'))
class FormCreateUser(_ui.Form):
    """Form to create new user."""


@ui.register_ui(field_confirm_password=ui.TextField(By.NAME,
                                                    'confirm_password'),
                field_password=ui.TextField(By.NAME, 'password'))
class FormChangePassword(_ui.Form):
    """Form to change user password."""
Ejemplo n.º 10
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pom import ui
from selenium.webdriver.common.by import By

from stepler.horizon.app import ui as _ui

from .base import PageBase


@ui.register_ui(
    combobox_lang=ui.ComboBox(By.NAME, 'language'),
    combobox_timezone=ui.ComboBox(By.NAME, 'timezone'),
    field_items_per_page=ui.IntegerField(By.NAME, 'pagesize'),
    field_instance_log_length=ui.IntegerField(By.NAME, 'instance_log_length'))
class FormSettings(_ui.Form):
    """Form of settings."""


@ui.register_ui(form_settings=FormSettings(By.ID, 'user_settings_modal'))
class PageSettings(PageBase):
    """Settings page."""

    url = "/settings/"


@ui.register_ui(
Ejemplo n.º 11
0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pom import ui
from selenium.webdriver.common.by import By

from horizon_autotests.app import ui as _ui

from .base import PageBase


@ui.register_ui(combobox_admin_state=ui.ComboBox(By.NAME, 'admin_state_up'),
                combobox_external_network=ui.ComboBox(By.NAME,
                                                      'external_network'),
                field_name=ui.TextField(By.NAME, 'name'))
class FormCreateRouter(_ui.Form):
    """Form to create router."""


@ui.register_ui(dropdown_menu=_ui.DropdownMenu())
class RowRouter(_ui.Row):
    """Router row."""


class TableRouters(_ui.Table):
    """Routers table."""
Ejemplo n.º 12
0
    checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[type="checkbox"]'),
    dropdown_menu=DropdownMenu())
class RowUser(_ui.Row):
    """User row of users table."""


class TableUsers(_ui.Table):
    """Users table."""

    columns = {'name': 2, 'email': 4, 'enabled': 6}
    row_cls = RowUser


@ui.register_ui(
    combobox_project=_ui.combobox_by_label("Primary Project"),
    combobox_role=ui.ComboBox(By.NAME, 'role_id'),
    field_confirm_password=ui.TextField(By.NAME, 'confirm_password'),
    field_name=ui.TextField(By.NAME, 'name'),
    field_password=ui.TextField(By.NAME, 'password'))
class FormCreateUser(_ui.Form):
    """Form to create new user."""


@ui.register_ui(
    field_confirm_password=ui.TextField(By.NAME, 'confirm_password'),
    field_password=ui.TextField(By.NAME, 'password'))
class FormChangePassword(_ui.Form):
    """Form to change user password."""


@ui.register_ui(
Ejemplo n.º 13
0
class TableVolumes(_ui.Table):
    """Admin volumes table."""

    columns = {
        'project': 2,
        'host': 3,
        'name': 4,
        'size': 5,
        'status': 6,
        'type': 7
    }
    row_cls = RowVolume


@ui.register_ui(combobox_status=ui.ComboBox(By.NAME, 'status'))
class FormUpdateVolumeStatus(_ui.Form):
    """Form to update volume status."""


@ui.register_ui(combobox_destination_host=ui.ComboBox(By.NAME, 'host'),
                field_current_host=ui.TextField(By.NAME, 'current_host'))
class FormMigrateVolume(_ui.Form):
    """Form to migrate volume."""


@ui.register_ui(table_volumes=TableVolumes(By.CSS_SELECTOR,
                                           'table[id="volumes"]'),
                form_update_volume_status=FormUpdateVolumeStatus(
                    By.CSS_SELECTOR, 'form[action*="/update_status"]'),
                form_migrate_volume=FormMigrateVolume(By.ID,
Ejemplo n.º 14
0
                link_image=ui.Link(By.CSS_SELECTOR, 'td > a'))
class RowImage(_ui.Row):
    """Row with image in images table."""

    transit_statuses = ('Queued', 'Saving')


class TableImages(_ui.Table):
    """Images table."""

    columns = {'name': 2, 'type': 3, 'status': 4, 'format': 7}
    row_cls = RowImage


@ui.register_ui(checkbox_protected=_ui.CheckBox(By.NAME, 'protected'),
                combobox_disk_format=ui.ComboBox(By.NAME, 'disk_format'),
                combobox_source_type=ui.ComboBox(By.NAME, 'source_type'),
                field_image_file=ui.TextField(By.NAME, 'image_file'),
                field_image_url=ui.TextField(By.NAME, 'image_url'),
                field_min_disk=ui.TextField(By.NAME, 'minimum_disk'),
                field_min_ram=ui.TextField(By.NAME, 'minimum_ram'),
                field_name=ui.TextField(By.NAME, 'name'))
class FormCreateImage(_ui.Form):
    """Form to create image."""


@ui.register_ui(field_metadata_name=ui.UI(By.CSS_SELECTOR,
                                          '[ng-bind$="item.leaf.name"]'),
                field_metadata_value=ui.TextField(
                    By.CSS_SELECTOR, '[ng-model$="item.leaf.value"]'))
class RowMetadata(_ui.Row):
Ejemplo n.º 15
0
                                      'input[type="checkbox"]'),
                dropdown_menu=DropdownMenu(),
                link_instance=ui.Link(By.CSS_SELECTOR, 'td > a'))
class RowInstance(_ui.Row):
    """Row with instance."""

    transit_statuses = ('Build', )


class TableInstances(_ui.Table):
    """Instances table."""

    columns = {'name': 4, 'status': 8}
    row_cls = RowInstance


@ui.register_ui(button_delete_instances=ui.Button(By.ID,
                                                  'instances__action_delete'),
                button_filter_instances=ui.Button(
                    By.ID, 'instances__action_filter_admin_instances'),
                field_filter_instances=ui.TextField(
                    By.NAME, 'instances__filter_admin_instances__q'),
                combobox_filter_target=ui.ComboBox(
                    By.NAME, 'instances__filter_admin_instances__q_field'),
                table_instances=TableInstances(By.ID, 'instances'))
class PageAdminInstances(PageBase):
    """Admin instances page."""

    url = "/admin/instances/"
    navigate_items = 'Admin', 'System', "Instances"
Ejemplo n.º 16
0
    """Row with movie."""

    cell_cls = CellMovie


class TableMovies(ui.Table):
    """Table of movies."""

    row_cls = RowMovie
    columns = {
        'poster': 1,
        'title': 2,
        'imdb_rating': 3,
        'your_rating': 4,
        'watch_list': 5
    }


@ui.register_ui(button_share=ui.Button(By.CSS_SELECTOR,
                                       'button[title="Share"]'),
                combobox_sort_type=ui.ComboBox(By.NAME, 'sort'),
                button_sort_order=ui.Button(By.CLASS_NAME,
                                            'lister-sort-reverse'),
                table_movies=TableMovies(By.CSS_SELECTOR, 'table.chart'),
                list_social_share=ListSocial(By.CSS_SELECTOR,
                                             '.dropdown-menu.menu-right'))
class PageTopMovies(PageBase):
    """Page with top 250 IMDB movies list."""

    url = '/chart/top?ref_=nv_mv_250_6'
Ejemplo n.º 17
0
    button_remove=ui.Button(By.CSS_SELECTOR, 'button.btn.btn-default'))
class RowAllocated(_ui.Row):
    """Row with allocated item."""

    cell_cls = CellAvailable


class TableAvailableSources(_ui.Table):
    """Available sources table."""

    columns = {'name': 2}
    row_cls = RowAvailable


@ui.register_ui(
    combobox_boot_source=ui.ComboBox(By.NAME, 'boot-source-type'),
    radio_volume_create=RadioVolumeCreate(
        By.XPATH,
        '//div[contains(@class, "btn-group") and label[@id="vol-create"]]'),
    table_available_sources=TableAvailableSources(
        By.CSS_SELECTOR, 'available table'))
class TabSource(ui.Block):
    """Source tab."""


class TableAvailableFlavors(_ui.Table):
    """Available flavors table."""

    columns = {'name': 2, 'ram': 4, 'root_disk': 6}
    row_cls = RowAvailable
    row_xpath = './/tr[@ng-repeat-start]'
Ejemplo n.º 18
0
    row_cls = RowVolumeType


@ui.register_ui(dropdown_menu=_ui.DropdownMenu())
class RowQosSpec(_ui.Row):
    """QoS Spec row of QoS Specs table."""


class TableQosSpecs(_ui.Table):
    """QoS Specs table."""

    columns = {'name': 2}
    row_cls = RowQosSpec


@ui.register_ui(field_consumer=ui.ComboBox(By.NAME, 'consumer'),
                field_name=ui.TextField(By.NAME, 'name'))
class FormCreateQosSpec(_ui.Form):
    """Form to create QoS Spec."""


@ui.register_ui(
    button_create_qos_spec=ui.Button(By.ID, 'qos_specs__action_create'),
    button_create_volume_type=ui.Button(By.ID, 'volume_types__action_create'),
    form_create_qos_spec=FormCreateQosSpec(
        By.CSS_SELECTOR, 'form[action*="volume_types/create_qos_spec"]'),
    form_create_volume_type=FormCreateVolumeType(
        By.CSS_SELECTOR, 'form[action*="volume_types/create_type"]'),
    table_qos_specs=TableQosSpecs(By.ID, 'qos_specs'),
    table_volume_types=TableVolumeTypes(By.ID, 'volume_types'))
class TabVolumeTypes(_ui.Tab):
Ejemplo n.º 19
0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pom import ui
from selenium.webdriver.common.by import By

from horizon_autotests.app import ui as _ui

from .base import PageBase


@ui.register_ui(combobox_lang=ui.ComboBox(By.NAME, 'language'),
                combobox_timezone=ui.ComboBox(By.NAME, 'timezone'),
                field_items_per_page=ui.IntegerField(By.NAME, 'pagesize'),
                field_instance_log_length=ui.IntegerField(
                    By.NAME, 'instance_log_length'))
class FormSettings(_ui.Form):
    """Form of settings."""


@ui.register_ui(form_settings=FormSettings(By.ID, 'user_settings_modal'))
class PageSettings(PageBase):
    """Settings page."""

    url = "/settings/"