def add_button(self): sel.force_navigate('catalog_item', context={ 'catalog': self.catalog, 'catalog_item': self }) cfg_btn('Add a new Button', invokes_alert=True) sel.wait_for_element(button_form.btn_text) fill(button_form, { 'btn_text': "btn_text", 'btn_hvr_text': "btn_descr" }) if current_version() > "5.5": select = AngularSelect("button_image") select.select_by_visible_text("Button Image 1") else: select = DHTMLSelect("div#button_div") select.select_by_value(2) fill( button_form, { 'select_dialog': self.dialog, 'system_process': "Request", 'request': "InspectMe" }) sel.click(button_form.add_button) flash.assert_success_message('Button "btn_descr" was added')
def add_button_group(self): navigate_to(self, 'Details') cfg_btn("Add a new Button Group", invokes_alert=True) sel.wait_for_element(button_group_form.btn_group_text) fill(button_group_form, {'btn_group_text': "group_text", 'btn_group_hvr_text': "descr"}) if current_version() > "5.5": select = AngularSelect("button_image") select.select_by_visible_text("Button Image 1") else: select = DHTMLSelect("div#button_div") select.select_by_value(1) sel.click(button_group_form.add_button) flash.assert_success_message('Buttons Group "descr" was added')
def add_button_group(self): sel.force_navigate('catalog_item', context={'catalog': self.catalog, 'catalog_item': self}) cfg_btn("Add a new Button Group", invokes_alert=True) sel.wait_for_element(button_group_form.btn_group_text) fill(button_group_form, {'btn_group_text': "group_text", 'btn_group_hvr_text': "descr"}) if current_version() > "5.5": select = AngularSelect("button_image") select.select_by_visible_text("Button Image 1") else: select = DHTMLSelect("div#button_div") select.select_by_value(1) sel.click(button_group_form.add_button) flash.assert_success_message('Buttons Group "descr" was added')
def add_button(self): navigate_to(self, 'Details') cfg_btn('Add a new Button', invokes_alert=True) sel.wait_for_element(button_form.btn_text) fill(button_form, {'btn_text': "btn_text", 'btn_hvr_text': "btn_descr"}) if current_version() > "5.5": select = AngularSelect("button_image") select.select_by_visible_text("Button Image 1") else: select = DHTMLSelect("div#button_div") select.select_by_value(2) fill(button_form, {'select_dialog': self.dialog, 'system_process': "Request", 'request': "InspectMe"}) sel.click(button_form.add_button) flash.assert_success_message('Button "btn_descr" was added')
def set_random_tag(instance): navigate_to(instance, 'Details') toolbar.select('Policy', 'Edit Tags') # select random tag category cat_selector = AngularSelect("tag_cat") random_cat = random.choice(cat_selector.all_options) cat_selector.select_by_value(random_cat.value) # select random tag tag tag_selector = AngularSelect("tag_add") random_tag = random.choice([op for op in tag_selector.all_options if op.value != "select"]) tag_selector.select_by_value(random_tag.value) # Save tag conig form_buttons.save() return Tag(display_name=random_tag.text, category=random_cat.text)
def set_random_tag(instance): navigate_to(instance, 'Details') toolbar.select('Policy', 'Edit Tags') # select random tag category cat_selector = AngularSelect("tag_cat") random_cat = random.choice(cat_selector.all_options) cat_selector.select_by_value(random_cat.value) # select random tag tag tag_selector = AngularSelect("tag_add") random_tag = random.choice([op for op in tag_selector.all_options if op.value != "select"]) tag_selector.select_by_value(random_tag.value) # Save tag conig form_buttons.save() return Tag(display_name=random_tag.text, category=random_cat.text)
def set_random_tag(instance): logger.debug("Setting random tag") navigate_to(instance, 'Details') toolbar.select('Policy', 'Edit Tags') # select random tag category cat_selector = AngularSelect("tag_cat") random_cat = random.choice(cat_selector.all_options) logger.debug("Selected category {cat}".format(cat=random_cat)) cat_selector.select_by_value(random_cat.value) # select random tag tag tag_selector = AngularSelect("tag_add") random_tag = random.choice([op for op in tag_selector.all_options if op.value != "select"]) logger.debug("Selected value {tag}".format(tag=random_tag)) tag_selector.select_by_value(random_tag.value) # Save tag conig form_buttons.save() logger.debug("Tag configuration was saved") return Tag(display_name=random_tag.text, category=random_cat.text)