class ConditionFormCommon(ControlExplorerView): title = Text("#explorer_title_text") description = Input(name="description") scope = ExpressionEditor("//img[@alt='Edit this Scope']") expression = ExpressionEditor("//img[@alt='Edit this Expression']") notes = TextInput(name="notes") cancel_button = Button("Cancel")
class ConditionFormCommon(ControlExplorerView): title = Text("#explorer_title_text") description = Input(name="description") scope = ExpressionEditor("//button[normalize-space(.)='Define Scope']") expression = ExpressionEditor("//button[normalize-space(.)='Define Expression']") notes = TextInput(name="notes") cancel_button = Button("Cancel")
class filter(Tab): # noqa filter_show_costs = BootstrapSelect("cb_show_typ") filter_owner = BootstrapSelect("cb_owner_id") filter_provider = BootstrapSelect("cb_provider_id") filter_project = BootstrapSelect("cb_entity_id") filter_tag_cat = BootstrapSelect("cb_tag_cat") filter_tag_value = BootstrapSelect("cb_tag_value") interval = BootstrapSelect("cb_interval") interval_size = BootstrapSelect("cb_interval_size") interval_end = BootstrapSelect("cb_end_interval_offset") primary_filter = ExpressionEditor() secondary_filter = ExpressionEditor()
class PolicyFormCommon(ControlExplorerView): description = Input(name="description") active = Checkbox("active") scope = ExpressionEditor() notes = TextInput(name="notes") cancel_button = Button("Cancel")
class evaluate(View): # noqa type = BootstrapSelect("exp_name") # Real Time Performance Parameters performance_field = BootstrapSelect("perf_column") performance_field_operator = BootstrapSelect("select_operator") performance_field_value = Input(name="value_threshold") performance_trend = BootstrapSelect("trend_direction") performance_time_threshold = BootstrapSelect("rt_time_threshold") # Hardware Reconfigured Parameters hardware_attribute = BootstrapSelect("select_hdw_attr") operator = BootstrapSelect("select_operator") # Expression Parameters expression = ExpressionEditor("//button[normalize-space(.)='Define Expression']") def fill(self, values): if isinstance(values, six.string_types): new_values = dict(type=values) elif isinstance(values, (list, tuple)): new_values = dict(type=values[0], **values[1]) else: raise TypeError("Evaluate part should be a string or tuple.") return View.fill(self, new_values)
class visibility(View): # noqa title = Text('//*[@id="ab_form"]/h3[2]') define_exp = Text(locator='//*[@id="form_visibility_expression_div"]//a/button') expression = ExpressionEditor()
class enablement(View): # noqa title = Text('//*[@id="ab_form"]/div[1]/h3') define_exp = Text(locator='//*[@id="form_enablement_expression_div"]//a/button') expression = ExpressionEditor() disabled_text = Input(id="disabled_text")