By.XPATH, './/button[contains(@class, "btn-primary") and ' 'contains(text(), "View")]'), button_delete_config=ui.Button(By.CSS_SELECTOR, 'button.btn.btn-danger')) class RowConfiguration(ui.Row): """Row of configuration.""" class ListConfigurations(ui.List): """List of configurations.""" row_cls = RowConfiguration row_xpath = './/div[contains(@class, "box")]' @ui.register_ui(field_name=ui.TextField(By.ID, 'configuration_name'), combobox_cluster=_ui.ComboBox(By.ID, 'configuration_cluster')) class FormCreateConfiguration(_ui.FormNext): """Form to create configuration.""" @ui.register_ui(radiobutton=ui.Button(By.XPATH, './/input[@type="radio"]')) class RowPlaybook(ui.Row): """Row of playbook.""" class ListPlaybooks(ui.List): """List of playbooks.""" row_cls = RowPlaybook row_xpath = './/div[contains(@class, "grid-line")]'
# http://www.apache.org/licenses/LICENSE-2.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 @ui.register_ui(field_description=ui.TextField(By.NAME, 'vol_type_description'), field_name=ui.TextField(By.NAME, 'name')) class FormCreateVolumeType(_ui.Form): """Form to create volume type.""" @ui.register_ui(dropdown_menu=_ui.DropdownMenu()) class RowVolumeType(_ui.Row): """Volume type row of volume types table.""" class TableVolumeTypes(_ui.Table): """Volume types table.""" columns = {'name': 2} row_cls = RowVolumeType
@ui.register_ui(checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[type="checkbox"]'), dropdown_menu=DropdownMenu()) class RowFlavor(_ui.Row): """Row with flavor in flavors table.""" class TableFlavors(_ui.Table): """Flavors table.""" columns = {'name': 2} row_cls = RowFlavor @ui.register_ui(field_name=ui.TextField(By.NAME, 'name'), field_ram=ui.IntegerField(By.NAME, 'memory_mb'), field_root_disk=ui.IntegerField(By.NAME, 'disk_gb'), field_vcpus=ui.IntegerField(By.NAME, 'vcpus')) class FormCreateFlavor(_ui.Form): """Form to create flavor.""" submit_locator = By.CSS_SELECTOR, '[type="submit"]' @ui.register_ui(button_add=ui.Button(By.CSS_SELECTOR, '.btn.btn-primary')) class RowProject(_ui.Row): """Row with project.""" class ListProjects(ui.List):
"""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): """Row of added metadata."""
# # http://www.apache.org/licenses/LICENSE-2.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(field_name=ui.TextField(By.NAME, 'name'), field_transfer_id=ui.TextField(By.NAME, 'id'), field_transfer_key=ui.TextField(By.NAME, 'auth_key')) class FormTransferInfo(_ui.Form): """Form with info about transfer.""" @ui.register_ui(form_transfer_info=FormTransferInfo(By.CSS_SELECTOR, 'form')) class PageVolumeTransfer(PageBase): """Volume transfer info page.""" url = "/project/volumes/{}/"
"""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_description=ui.TextField(By.NAME, 'description'), 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): """Row of added metadata."""
# http://www.apache.org/licenses/LICENSE-2.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. import pom from pom import ui from selenium.webdriver.common.by import By from stepler.horizon.app import ui as _ui @ui.register_ui(field_username=ui.TextField(By.NAME, 'username'), field_password=ui.TextField(By.NAME, 'password')) class FormLogin(_ui.Form): """Form to login user.""" @ui.register_ui(form_login=FormLogin(By.CSS_SELECTOR, 'form'), label_alert_message=ui.UI(By.CSS_SELECTOR, 'div.alert-danger'), label_error_message=ui.UI(By.CSS_SELECTOR, 'div.error'), modal=_ui.initiated_ui.Modal(By.CLASS_NAME, 'modal-backdrop')) class PageLogin(pom.Page): """Page to login user.""" url = "/auth/login"
@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( field_confirm_password=ui.TextField(By.NAME, 'confirm_password'), field_current_password=ui.TextField(By.NAME, 'current_password'), field_new_password=ui.TextField(By.NAME, 'new_password')) class FormChangePassword(_ui.Form): """Form to change user password.""" @ui.register_ui( form_change_password=FormChangePassword(By.ID, 'change_password_modal')) class PagePassword(PageBase): """Page to change user password.""" url = "/settings/password/"
@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_label( "Namespace Definition Source")) class FormImportNamespace(_ui.Form): """Form to create namespace.""" class FormConfirmDeleteNamespace(_ui.Form): """Form delete metadata confirmation.""" submit_locator = By.CSS_SELECTOR, '.btn.btn-danger' @ui.register_ui( button_import_namespace=ui.Button(By.ID, 'namespaces__action_import'), button_filter_namespaces=ui.Button(By.ID, 'namespaces__action_filter'),
# 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.""" columns = {'name': 2} row_cls = RowRouter
link_stack=ui.Link(By.CSS_SELECTOR, 'td > hz-cell > hz-field > a')) class RowStack(_ui.Row): """Row with stack in stacks table.""" class TableStacks(_ui.Table): """Stacks table.""" columns = {'name': 2, 'status': 6} row_cls = RowStack @ui.register_ui( combobox_template_source=_ui.combobox_by_label('Template Source'), combobox_env_source=_ui.combobox_by_label('Environment Source'), field_template_data=ui.TextField(By.NAME, 'template_data'), field_env_data=ui.TextField(By.NAME, 'environment_data')) class FormCreateStack(_ui.Form): """Form to create stack.""" @ui.register_ui(field_name=ui.TextField(By.NAME, 'stack_name'), field_timeout=ui.TextField(By.NAME, 'timeout_mins'), field_admin_password=ui.TextField(By.NAME, 'password'), field_flavor=ui.TextField(By.NAME, '__param_flavor'), field_image=ui.TextField(By.NAME, '__param_image'), field_key=ui.TextField(By.NAME, '__param_key_name'), checkbox_rollback=_ui.CheckBox(By.NAME, 'enable_rollback')) class FormLaunchStack(_ui.Form): """Form to lauch stack."""
'input[type="checkbox"]'), dropdown_menu=_ui.DropdownMenu(), link_network=ui.UI(By.CSS_SELECTOR, 'td.anchor > a')) class RowNetwork(_ui.Row): """Row with network in networks table.""" class TableNetworks(_ui.Table): """Networks table.""" columns = {'name': 3} row_cls = RowNetwork @ui.register_ui(checkbox_shared=_ui.CheckBox(By.NAME, 'shared'), field_name=ui.TextField(By.NAME, 'name')) class FormUpdateNetwork(_ui.Form): """Form to update network as admin.""" @ui.register_ui(button_delete_networks=ui.Button(By.ID, 'networks__action_delete'), button_filter_networks=ui.Button(By.CLASS_NAME, 'fa-search'), field_filter_networks=ui.TextField(By.NAME, 'networks__filter__q'), form_update_network=FormUpdateNetwork(By.ID, 'update_network_form'), table_networks=TableNetworks(By.ID, 'networks')) class PageAdminNetworks(PageBase): """Admin networks page."""
class RowImage(_ui.Row): """Row with image in images table.""" transit_statuses = ('Queued', 'Saving') class TableImages(_ui.Table): """Images table.""" columns = {'name': 4, 'status': 6} 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")]'),
@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'
@ui.register_ui( checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[type="checkbox"]'), dropdown_menu=DropdownMenu(), link_project=ui.UI(By.CSS_SELECTOR, 'td[data-cell-name="name"] a')) class RowProject(_ui.Row): """Project row of projects table.""" class TableProjects(_ui.Table): """Projects table.""" columns = {'name': 2, 'enabled': 6} row_cls = RowProject @ui.register_ui(field_name=ui.TextField(By.NAME, 'name')) class FormCreateProject(_ui.Form): """Form to create new project.""" submit_locator = By.CSS_SELECTOR, 'input.btn.btn-primary' @ui.register_ui( field_name=ui.TextField(By.NAME, 'name'), checkbox_enable=_ui.CheckBox(By.NAME, 'enabled')) class FormEditProject(_ui.Form): """Form to edit project.""" submit_locator = By.CSS_SELECTOR, 'input.btn.btn-primary'
@ui.register_ui(checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[type="checkbox"]'), dropdown_menu=_ui.DropdownMenu()) class RowRules(_ui.Row): """User row of rules table.""" class TableManageRules(_ui.Table): """Manage rules table.""" columns = {'port_range': 5} row_cls = RowRules @ui.register_ui(field_port=ui.TextField(By.NAME, 'port')) class FormAddRules(_ui.Form): """Form to add rules.""" @ui.register_ui(button_add_rule=ui.Button(By.ID, 'rules__action_add_rule'), button_delete_rules=ui.Button(By.ID, 'rules__action_delete'), form_add_rule=FormAddRules(By.ID, 'create_security_group_rule_form'), table_rules=TableManageRules(By.ID, 'rules')) class PageManageRules(PageBase): """Manage rules page.""" url = "/project/security_groups/{id}/"
from pom import ui from selenium.webdriver.common.by import By from stepler.horizon.app import ui as _ui @ui.register_ui( checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[type="checkbox"]'), dropdown_menu=_ui.DropdownMenu()) class RowSnapshot(_ui.Row): """Volume snapshot row of volume snapshots table.""" transit_statuses = ('Creating',) @ui.register_ui( field_description=ui.TextField(By.NAME, 'description'), field_name=ui.TextField(By.NAME, 'name')) class FormCreateSnapshot(_ui.Form): """Form create volume snapshot.""" @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,
'.//span[@class="glyphicon glyphicon-triangle-right"]'), minimize_icon=ui.UI( By.XPATH, './/span[@class="glyphicon glyphicon-triangle-bottom"]')) class RowUser(ui.Row): """Row of user.""" class ListUsers(ui.List): """List of users.""" row_cls = RowUser row_xpath = './/div[contains(@class, "box")]' @ui.register_ui(field_login=ui.TextField(By.ID, 'user_login'), field_full_name=ui.TextField(By.ID, 'user_name'), field_email=ui.TextField(By.ID, 'user_email'), combobox_role=_ui.ComboBox(By.ID, 'user_role')) class FormCreateUser(_ui.Form): """Form to create user.""" class FormUserDetails(FormCreateUser): """Form to change user details.""" submit_locator = By.CSS_SELECTOR, 'button.btn.btn-primary.pull-right' cancel_locator = By.CSS_SELECTOR, 'button.btn.btn-danger' @ui.register_ui(
# http://www.apache.org/licenses/LICENSE-2.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 @ui.register_ui(field_name=ui.TextField(By.NAME, 'name')) class FormCreateKeypair(_ui.Form): """Form to create keypair.""" @ui.register_ui( button_delete_keypair=ui.Button(By.CSS_SELECTOR, '[id*="action_delete"]'), checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[type="checkbox"]')) class RowKeypair(_ui.Row): """Row of keypair in keypairs table.""" class TableKeypairs(_ui.Table): """Keypairs table.""" columns = {'name': 2}
# # 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 @ui.register_ui( field_username=ui.TextField( By.CSS_SELECTOR, '.form-group:nth-of-type(1) > input[type="text"]'), field_project_name=ui.TextField( By.CSS_SELECTOR, '.form-group:nth-of-type(2) > input[type="text"]'), field_project_id=ui.TextField( By.CSS_SELECTOR, '.form-group:nth-of-type(3) > input[type="text"]'), field_auth_url=ui.TextField( By.CSS_SELECTOR, '.form-group:nth-of-type(4) > input[type="text"]')) class FormUserCredentials(_ui.Form): """Form with user credentials.""" @ui.register_ui( button_download_v2_file=ui.Button( By.ID, 'endpoints__action_download_openrc_v2'), button_download_v3_file=ui.Button( By.ID, 'endpoints__action_download_openrc'),
dropdown_menu=DropdownMenu()) class RowNetwork(_ui.Row): """Row with network in networks table.""" class TableNetworks(_ui.Table): """Networks table.""" columns = {'name': 2, 'shared': 4} row_cls = RowNetwork @ui.register_ui(button_next=ui.Button(By.CSS_SELECTOR, '.button-next'), checkbox_create_subnet=_ui.CheckBox(By.NAME, 'with_subnet'), checkbox_shared=_ui.CheckBox(By.NAME, 'shared'), field_gateway_ip=ui.TextField(By.NAME, 'gateway_ip'), field_name=ui.TextField(By.NAME, 'net_name'), field_network_address=ui.TextField(By.NAME, 'cidr'), field_subnet_name=ui.TextField(By.NAME, 'subnet_name')) class FormCreateNetwork(_ui.Form): """Form to create network.""" submit_locator = By.CSS_SELECTOR, '.btn.btn-primary.button-final' cancel_locator = By.CSS_SELECTOR, '.btn.btn-default.cancel' @ui.register_ui(button_next=ui.Button(By.CSS_SELECTOR, '.button-next'), field_name=ui.TextField(By.NAME, 'subnet_name'), field_network_address=ui.TextField(By.NAME, 'cidr')) class FormAddSubnet(_ui.Form): """Form to add subnet."""
'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"
# 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(checkbox_public=_ui.CheckBox(By.NAME, 'public'), field_name=ui.TextField(By.NAME, 'name')) class FormCreateContainer(_ui.Form): """Form to create container.""" @ui.register_ui( button_delete_container=ui.Button(By.CSS_SELECTOR, '[ng-click*="deleteContainer"]'), label_created_date=ui.UI(By.CSS_SELECTOR, '.hz-object-timestamp .hz-object-val'), label_objects_count=ui.UI(By.CSS_SELECTOR, '.hz-object-count .hz-object-val'), label_size=ui.UI(By.CSS_SELECTOR, '.hz-object-size .hz-object-val'), link_public_url=ui.Link(By.CSS_SELECTOR, '.hz-object-link a[ng-show*="public_url"]')) class RowContainer(_ui.Row):
@ui.register_ui( label_name=ui.UI(By.CSS_SELECTOR, "div.name"), edit_icon=ui.UI(By.XPATH, './/span[@class="glyphicon edit-icon"]')) class RowCluster(ui.Row): """Row of cluster.""" class ListClusters(ui.List): """List of clusters.""" row_cls = RowCluster row_xpath = './/div[contains(@class, "box")]' @ui.register_ui( field_name=ui.TextField(By.NAME, 'cluster_name')) class FormCreateCluster(_ui.Form): """Form to create cluster.""" @ui.register_ui( button_create_cluster=ui.Button( By.CSS_SELECTOR, "div.main-button > button.btn-primary"), form_create_cluster=FormCreateCluster( By.CSS_SELECTOR, "div.modal-content"), list_clusters=ListClusters(By.CSS_SELECTOR, "div.clusters.row")) class PageClusters(base.PageBase): """Page to management clusters.""" url = "/clusters" page_header_value = "Cluster"
# 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 ..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_source_type=_ui.combobox_by_label("Volume Source"), combobox_image_source=_ui.combobox_by_label("Use image as a source"), combobox_volume_source=_ui.combobox_by_label("Use a volume as source"), combobox_volume_type=_ui.combobox_by_label("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."""
# 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 selenium.webdriver.support import expected_conditions as ec from selenium.webdriver.support.ui import WebDriverWait from stepler import config from stepler.horizon.app import ui as _ui from ..base import PageBase @ui.register_ui(field_count=ui.TextField(By.NAME, 'count'), field_name=ui.TextField(By.NAME, 'name')) class TabDetails(ui.Block): """Details tab.""" class RadioVolumeCreate(ui.UI): """Radio buttons group to create volume or no.""" @property @ui.wait_for_presence def value(self): """Value of radio buttons group.""" return self.webelement.find_element( By.XPATH, 'label[contains(@class, "active")]').text @value.setter
@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_label( "Namespace Definition Source")) 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'
@ui.register_ui(checkbox=_ui.CheckBox(By.CSS_SELECTOR, 'input[name="object_ids"]'), 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(field_name=ui.TextField(By.NAME, 'name'), field_password=ui.TextField(By.NAME, 'password'), field_confirm_password=ui.TextField(By.NAME, 'confirm_password'), combobox_project=_ui.combobox_by_label("Primary Project"), combobox_role=_ui.combobox_by_label('Role')) 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."""
"""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_label("Status")) class FormUpdateVolumeStatus(_ui.Form): """Form to update volume status.""" @ui.register_ui( combobox_destination_host=_ui.combobox_by_label("Destination 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, 'migrate_volume_modal')) class TabAdminVolumes(_ui.Tab): """Admin volumes tab."""
"""Row with existing roles.""" class RolesHeader(_ui.Header): """Roles header""" cell_cls = RolesRow cell_xpath = './/div[@class="col-xs-2 name"]' @ui.register_ui(header=RolesHeader(By.CSS_SELECTOR, 'div.grid-header')) class RolesTable(ui.Table): """Table with roles""" @ui.register_ui(field_role_name=ui.TextField(By.ID, 'role_name')) class FormCreateRole(_ui.FormNext): """Form to create role.""" class ListPermissionsGroups(_ui.ListField): """List of permissions groups.""" row_xpath = './/input[@type="checkbox"]' @ui.register_ui(checkbox_permissions_groups=ListPermissionsGroups( By.CSS_SELECTOR, 'div.permissions.long-content.grid')) class FormRolePermissions(_ui.FormNext): """Form to change role permissions."""