class CollectLogsCredsEntities(View): fill_strategy = WaitFillViewStrategy("5s") username = Input(name='log_userid') # TODO implement fill method (fill_strategy) to click 'change stored password' when updating password = Input(name='log_password') confirm_password = Input(name='log_verify') validate_button = Button('Validate')
class configure_analysis(View): # noqa configure_analysis = ProjectSteps("Configure the Analysis") transformation_path = TransformationPath() application_packages = Text( locator= ".//wu-select-packages/h3[normalize-space(.)='Application packages']" ) save_and_run = Button("Save & Run") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.configure_analysis.is_displayed def fill(self, values): """ Args: values: """ if values.get("transformation_path"): self.transformation_path.select_card( card_name=values.get("transformation_path")) wait_for(lambda: self.application_packages.is_displayed, delay=0.6, timeout=240) was_change = True self.after_fill(was_change) return was_change def after_fill(self, was_change): self.save_and_run.click()
class count_form_view(View): # noqa fill_strategy = WaitFillViewStrategy() type = BootstrapSelect("chosen_typ") count = BootstrapSelect("chosen_count") key = BootstrapSelect("chosen_key") value = Input(name="chosen_value") user_input = Checkbox(name="user_input")
class set_transformation_target(View): # noqa title = Text( locator= ".//h5[normalize-space(.)='Select transformation target']") transformation_path = TransformationPath() application_packages = Text( locator= ".//wu-select-packages/h3[normalize-space(.)='Application packages']" ) next_button = Button("Next") back_button = Button("Back") cancel_button = Button("Cancel") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.title.is_displayed and self.transformation_path.is_displayed def fill(self, values): """ Args: values: transformation path to be selected """ if values.get("transformation_path"): self.transformation_path.select_card( card_name=values.get("transformation_path")) was_change = True wait_for(lambda: self.next_button.is_enabled, delay=0.2, timeout=60) self.after_fill(was_change) return was_change def after_fill(self, was_change): self.next_button.click()
class custom_labels(View): # noqa title = Text(locator=".//h5[normalize-space(.)='Custom labels']") add_label_button = Button("Add label") upload_label = HiddenFileInput( locator='.//input[contains(@accept,".xml")]') enabled_button = Text( locator=".//label/span[contains(@class, 'pf-c-switch__toggle')]" ) close_button = Button("Close") next_button = Button("Next") back_button = Button("Back") cancel_button = Button("Cancel") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.title.is_displayed and self.add_label_button.is_displayed def fill(self, values): """ Args: values: custom label file to be uploaded """ if values.get("file_label"): self.expand_custom_labels.click() wait_for(lambda: self.next_button.is_enabled, delay=0.2, timeout=60) was_change = True self.after_fill(was_change) return was_change def after_fill(self, was_change): self.next_button.click()
class ControlSimulationView(BaseLoggedInPage): """Basic view for Control/Simulation tab.""" fill_strategy = WaitFillViewStrategy() event_type = Select(id="event_typ") event_value = Select(id="event_value") filter_type = Select(id="filter_typ") filter_value = Select(id="filter_value") submit_button = Button("Submit") reset_button = Button("Reset") @View.nested class options(View): # noqa out_of_scope = Checkbox(name="out_of_scope") show_successful = Checkbox(name="passed") show_failed = Checkbox(name="failed") @View.nested class simulation_results(View): # noqa squash_button = SquashButton() tree = ManageIQTree("rsop_treebox") @property def is_displayed(self): return (self.event_type.is_displayed and self.filter_type.is_displayed and self.submit_button.is_displayed and self.reset_button.is_displayed)
class add_applications(View): # noqa add_applications = ProjectSteps("Add Applications") delete_application = Text( locator=".//div[contains(@class, 'action-button')]/span/i") confirm_delete = Button("Yes") upload_file = FileInput(id="fileUpload") next_button = Button("Next") back_button = Button("Back") cancel_button = Button("Cancel") fill_strategy = WaitFillViewStrategy("20s") @property def is_displayed(self): return self.add_applications.is_displayed def fill(self, values): app_list = values.get("app_list") env = conf.get_config("env") fs = FTPClientWrapper(env.ftpserver.entities.rhamt) for app in app_list: # Download application file to analyze # This part has to be here as file is downloaded temporarily file_path = fs.download(app) self.upload_file.fill(file_path) wait_for(lambda: self.next_button.is_enabled, delay=0.2, timeout=60) was_change = True self.after_fill(was_change) return was_change def after_fill(self, was_change): self.next_button.click()
class technologies(Tab): # noqa fill_strategy = WaitFillViewStrategy("20s") TAB_NAME = "Technologies" title = Text('.//div[contains(@class, "page-header")]/h1/div') @property def is_displayed(self): return self.title.text == "Technologies"
class conversion_hosts(WaitTab): # noqa fill_strategy = WaitFillViewStrategy("20s") TAB_NAME = 'Conversion Hosts' title = Text('.//div[contains(@class, "pull-left")]//h3') including_entities = View.include(ConversionHostForm, use_parent=True) @property def is_displayed(self): return self.title.text == "Configured Conversion Host"
class migration_throttling(WaitTab): # noqa fill_strategy = WaitFillViewStrategy("15s") TAB_NAME = 'Migration Throttling' title = Text('.//div[contains(@class, "pull-left")]//h3') including_entities = View.include(MigrationThrottlingForm, use_parent=True) @property def is_displayed(self): return self.title.text == "Concurrent Migrations"
class select_packages(ParametrizedView): # noqa title = Text(locator=".//h5[normalize-space(.)='Select packages']") PARAMETERS = ("pkg", ) select_all_packages = Text( locator=".//input[@class='ant-checkbox-input']") packages = Text( ParametrizedLocator( ".//div[contains(@class, 'ant-tree-treenode-switcher-close') " "and not(contains(@class, 'ant-tree-treenode-disabled'))]" "/span/span/span[normalize-space(.)={pkg|quote}]")) included_packages = Text( ParametrizedLocator( ".//li[@class='ant-transfer-list-content-item']" "/span[normalize-space(.)={pkg|quote}]")) move_into_button = Button( locator=".//span[contains(@class, 'anticon anticon-right')]") move_from_button = Button( locator=".//span[contains(@class, 'anticon anticon-left')]") next_button = Button("Next") back_button = Button("Back") cancel_button = Button("Cancel") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.title.is_displayed and self.select_all_packages.is_displayed def fill_pkg(self): """Add packages""" self.packages.click() self.move_into_button.click() was_change = True return was_change def remove(self): """Remove packages""" self.included_packages.click() self.move_from_button.click() was_change = True return was_change def fill(self, values): """ Args: values: application packages to be selected """ if values.get("pkg"): self.fill_pkg() was_change = True self.after_fill(was_change) return was_change def after_fill(self, was_change): self.next_button.click()
class AddCatalogItemView(BasicInfoForm): """NonCloudInfraCatalogItem catalog items have this view.""" fill_strategy = WaitFillViewStrategy() add = Button('Add') cancel = Button('Cancel') @property def is_displayed(self): return (self.in_explorer and self.catalog_items.is_opened and self.title.text == 'Adding a new Service Catalog Item')
class MappingFillView(ParametrizedView): PARAMETERS = ("object_type", ) source = MultiSelectList(ParametrizedLocator("source_{object_type}")) target = MultiSelectList(ParametrizedLocator("target_{object_type}")) fill_strategy = WaitFillViewStrategy("15s") def after_fill(self, was_change): if not self.parent.add_mapping.disabled: self.parent.add_mapping.click()
class find_form_view(View): # noqa fill_strategy = WaitFillViewStrategy() type = BootstrapSelect("chosen_typ") field = BootstrapSelect("chosen_field") skey = BootstrapSelect("chosen_skey") value = Input(name="chosen_value") check = BootstrapSelect("chosen_check") cfield = BootstrapSelect("chosen_cfield") ckey = BootstrapSelect("chosen_ckey") cvalue = Input(name="chosen_cvalue")
class DeleteCustomLabelView(View): title = Text(locator=".//h1[contains(normalize-space(.), 'Delete')]") fill_strategy = WaitFillViewStrategy("35s") delete_button = Button("Delete") cancel_button = Button("Cancel") @property def is_displayed(self): return self.title.is_displayed and self.delete_button.is_displayed
class hosts(View): # noqa fill_strategy = WaitFillViewStrategy("15s") hostname = SearchBox(id='host-selection') @property def is_displayed(self): return self.hostname.is_displayed def after_fill(self, was_change): self.parent.next_btn.click()
class AddCustomRuleView(CustomRulesView): title = Text(locator=".//h1[contains(normalize-space(.), 'Add rules')]") upload_rule = HiddenFileInput(locator='.//input[contains(@accept,".xml")]') browse_button = Button("Browse") close_button = Button("Close") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.title.is_displayed and self.browse_button.is_displayed
class general(InfraMappingCommonButtons): # noqa name = TextInput(name="name") description = TextInput(name="description") plan_type = BootstrapSelect("targetProvider") name_help_text = Text(locator='.//div[contains(@id,"name")]/span') description_help_text = Text(locator='.//div[contains(@id,"description")]/span') fill_strategy = WaitFillViewStrategy() def after_fill(self, was_change): if was_change: self.next_btn.click()
class EditProjectView(AllProjectView): title = Text(locator=".//h1[normalize-space(.)='Project details']") name = Input(name="name") description = Input(name="description") save_button = Button("Save") cancel_button = Button("Cancel") fill_strategy = WaitFillViewStrategy("35s") @property def is_displayed(self): return self.save_button.is_displayed and self.title.is_displayed
class DeleteProjectView(AllProjectView): title = Text(locator=".//h1[normalize-space(.)='Project details']") delete_project_name = Input(id="matchText") fill_strategy = WaitFillViewStrategy("35s") delete_button = Button("Delete") cancel_button = Button("Cancel") @property def is_displayed(self): return self.delete_button.is_displayed and self.title.is_displayed
class AddOrchestrationCatalogItemView(AddCatalogItemView): fill_strategy = WaitFillViewStrategy() @property def widget_names(self): # there are several derived views, widgets in those views are displayed in different order # this property is just workaround in order to change widget bypass order return ['title', 'select_catalog', 'select_dialog', 'select_orch_template', 'select_config_template', 'select_provider', 'name', 'description', 'display', 'subtype', 'field_entry_point', 'retirement_entry_point', 'select_resource']
class AddCustomLabelView(View): title = Text(locator=".//h1[contains(normalize-space(.), 'Add labels')]") upload_label = HiddenFileInput( locator='.//input[contains(@accept,".xml")]') file_uploaded = './/div[contains(@class, "pf-m-success")]' browse_button = Button("Browse") close_button = Button("Close") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.title.is_displayed and self.browse_button.is_displayed
class location(View): # noqa fill_strategy = WaitFillViewStrategy("15s") provider_type = BootstrapSelect("providerType") provider_name = BootstrapSelect("provider") cluster = BootstrapSelect("cluster") @property def is_displayed(self): return self.provider_type.is_displayed def after_fill(self, was_change): self.parent.next_btn.click()
class general(View): # noqa infra_map = BootstrapSelect("infrastructure_mapping") name = TextInput(name="name") name_help_text = Text(locator='.//div[contains(@id,"name")]/span') description = TextInput(name="description") select_vm = RadioGroup('.//div[contains(@id,"vm_choice_radio")]') fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.infra_map.is_displayed and self.name.is_displayed def after_fill(self, was_change): self.parent.next_btn.click()
class create_project(View): # noqa create_project = ProjectSteps("Create Project") name = Input(name="projectTitle") description = Input(locator='.//textarea[@id="idDescription"]') next_button = Button("Next") cancel_button = Button("Cancel") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.name.is_displayed and self.create_project.is_displayed def after_fill(self, was_change): self.next_button.click()
class authentication(View): # noqa fill_strategy = WaitFillViewStrategy("15s") conv_host_key = HiddenFileInput(locator='.//div[@id="conversionHostSshKey"]/div/input') transformation_method = BootstrapSelect("transformationMethod") vddk_library_path = Input(id='vddk-library-path') vmware_ssh_key = TextInput(locator='.//textarea[@id="vmware-ssh-key-input"]') osp_cert_switch = V2VBootstrapSwitch(label='Verify TLS Certificates for OpenStack') osp_ca_cert = TextInput(locator='.//textarea[@id="openstack-ca-certs-input"]') @property def is_displayed(self): return self.conv_host_key.is_displayed def after_fill(self, was_change): self.parent.configure_btn.click()
class MappingFillView(ParametrizedView): PARAMETERS = ("object_type",) source = MultiSelectList(ParametrizedLocator("source_{object_type}")) target = MultiSelectList(ParametrizedLocator("target_{object_type}")) fill_strategy = WaitFillViewStrategy("15s") def after_fill(self, was_change): if not self.parent.add_mapping.disabled: self.parent.add_mapping.click() @property def is_displayed(self): return (self.source.is_displayed and (len(self.browser.elements(".//div[contains(@class,'spinner')]")) == 0))
class review(View): # noqa title = Text( locator=".//h5[normalize-space(.)='Review project details']") save = Button("Save") save_and_run = Button("Save and run") fill_strategy = WaitFillViewStrategy("15s") @property def is_displayed(self): return self.title.is_displayed and self.save_and_run.is_displayed def after_fill(self, was_change): wait_for(lambda: self.save_and_run.is_enabled, delay=5, timeout=150) self.save_and_run.click()
class create_project(View): # noqa title = Text(locator=".//h5[normalize-space(.)='Project details']") name = Input(name="name") description = Input(locator='.//textarea[@name="description"]') next_button = Button("Next") cancel_button = Button("Cancel") yes_button = Button("Yes") no_button = Button("No") fill_strategy = WaitFillViewStrategy("30s") @property def is_displayed(self): return self.name.is_displayed and self.title.is_displayed def after_fill(self, was_change): self.next_button.click()
class general(InfraMappingCommonButtons): # noqa name = TextInput(name="name") description = TextInput(name="description") plan_type = BootstrapSelect("targetProvider") name_help_text = Text(locator='.//div[contains(@id,"name")]/span') description_help_text = Text( locator='.//div[contains(@id,"description")]/span') @View.nested class flash(V2VFlashMessages): ROOT = './/div[@class="modal-wizard-alert"]' fill_strategy = WaitFillViewStrategy() def after_fill(self, was_change): if was_change: self.next_btn.click()