Exemple #1
0
 def create(self):
     sel.force_navigate('new_button_group', context={"buttongroup": self})
     fill(button_group_form, {'btn_group_text': self.text,
                              'btn_group_hvr_text': self.hover})
     select = DHTMLSelect("div#button_div")
     select.select_by_value(1)
     sel.click(button_group_form.add_button)
     flash.assert_success_message('Buttons Group "{}" was added'.format(self.hover))
Exemple #2
0
 def create(self):
     sel.force_navigate('new_button_group', context={"buttongroup": self})
     fill(button_group_form, {'btn_group_text': self.text,
                              'btn_group_hvr_text': self.hover})
     select = DHTMLSelect("div#button_div")
     select.select_by_value(1)
     sel.click(button_group_form.add_button)
     flash.assert_success_message('Buttons Group "{}" was added'.format(self.hover))
Exemple #3
0
 def create(self):
     sel.force_navigate('new_button_group')
     fill(button_group_form, {'btn_group_text': self.group_text,
                              'btn_group_hvr_text': self.group_hover_text})
     select = DHTMLSelect("div#button_div")
     select.select_by_value(1)
     sel.click(button_group_form.add_button)
     flash.assert_success_message('Buttons Group "%s" was added'
                                  % self.group_hover_text)
Exemple #4
0
        def get_form(self, blank=False):
            """Gets a form for a field that already exists (by its name). Or if
               blank=True, get the form for a new field.  Must be on
               the correct page before calling this.
            """
            idx = ""
            if blank:
                row_id = ""  # for new entries, id attribute has no trailing '_x'
            else:
                idx = sel.get_attribute(
                    "//input[starts-with(@id, 'fields_name') and @value='%s']"
                    % self.name, 'id').split("_")[-1]
                row_id = "_" + idx

            def loc(fmt, underscore=True):
                if blank:
                    plural = ""
                else:
                    plural = "s"
                return fmt % (plural,
                              row_id if underscore else row_id.lstrip("_"))

            def remove(loc):
                """Return a callable that clicks but still allows popup dismissal"""
                return lambda _: sel.click(loc, wait_ajax=False)

            return Form(fields=[
                ('name_text', Input(loc('field%s_name%s'))),
                ('type_select', {
                    version.LOWEST:
                    DHTMLSelect(loc("//div[@id='field%s_aetype_id%s']")),
                    "5.5":
                    AngularSelect(loc("field%s_aetype%s", underscore=False))
                }),
                ('data_type_select', {
                    version.LOWEST:
                    DHTMLSelect(loc("//div[@id='field%s_datatype_id%s']")),
                    "5.5":
                    AngularSelect(loc("field%s_datatype%s", underscore=False))
                }),
                ('default_value_text', Input(loc('field%s_default_value%s'))),
                ('display_name_text', Input(loc('field%s_display_name%s'))
                 ), ('description_text', Input(loc('field%s_description%s'))
                     ), ('sub_cb', Input(loc('field%s_substitution%s'))
                         ), ('collect_text', Input(loc('field%s_collect%s'))),
                ('message_text', Input(loc('field%s_message%s'))
                 ), ('on_entry_text', Input(loc('field%s_on_entry%s'))
                     ), ('on_exit_text', Input(loc('field%s_on_exit%s'))),
                ('max_retries_text', Input(loc('field%s_max_retries%s'))
                 ), ('max_time_text', Input(loc('field%s_max_time%s'))
                     ), ('add_entry_button', "//img[@alt='Add this entry']"),
                ('remove_entry_button',
                 remove("//a[(contains(@title, 'delete this') or "
                        "contains(@confirm, 'delete field')) and "
                        "contains(@href, 'arr_id=%s')]/img" % idx))
            ])
Exemple #5
0
 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"})
     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')
Exemple #6
0
 def create(self):
     sel.force_navigate('new_button', context={'buttongroup': self.group})
     fill(button_form, {'btn_text': self.text,
                        'btn_hvr_text': self.hover})
     select = DHTMLSelect("div#button_div")
     select.select_by_value(2)
     fill(button_form, {'select_dialog': self.dialog.label if self.dialog is not None else None,
                        'system_process': self.system,
                        'request': self.request})
     sel.click(button_form.add_button)
     flash.assert_success_message('Button "{}" was added'.format(self.hover))
Exemple #7
0
 def create(self):
     sel.force_navigate('new_button', context={'buttongroup': self.group})
     fill(button_form, {'btn_text': self.text,
                        'btn_hvr_text': self.hover})
     select = DHTMLSelect("div#button_div")
     select.select_by_value(2)
     fill(button_form, {'select_dialog': self.dialog.label if self.dialog is not None else None,
                        'system_process': self.system,
                        'request': self.request})
     sel.click(button_form.add_button)
     flash.assert_success_message('Button "{}" was added'.format(self.hover))
Exemple #8
0
 def create(self):
     sel.force_navigate('new_button', context={'buttongroup': self.btngrp})
     fill(button_form, {'btn_text': self.btn_text,
                        'btn_hvr_text': self.btn_hvr_text})
     select = DHTMLSelect("div#button_div")
     select.select_by_value(2)
     fill(button_form, {'select_dialog': self.dialog,
                        'system_process': self.system,
                        'request': self.request})
     sel.click(button_form.add_button)
     flash.assert_success_message('Button "%s" was added'
                                  % self.btn_hvr_text)
Exemple #9
0
    def create(self):
        navigate_to(self, 'Add')

        fill(button_group_form, {'btn_group_text': self.text,
                                 'btn_group_hvr_text': self.hover})
        if version.current_version() < "5.5":
            select = DHTMLSelect("div#button_div")
        else:
            select = AngularSelect("button_image")
        select.select_by_value(1)
        sel.click(button_group_form.add_button)
        flash.assert_success_message('Buttons Group "{}" was added'.format(self.hover))
Exemple #10
0
 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"})
     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')
Exemple #11
0
 def create(self):
     navigate_to(self, 'Add')
     fill(button_form, {'btn_text': self.text,
                        'btn_hvr_text': self.hover})
     if version.current_version() < "5.5":
         select = DHTMLSelect("div#button_div")
     else:
         select = AngularSelect("button_image")
     select.select_by_value(2)
     fill(button_form, {'select_dialog': self.dialog.label if self.dialog is not None else None,
                        'system_process': self.system,
                        'request': self.request})
     sel.click(button_form.add_button)
     flash.assert_success_message('Button "{}" was added'.format(self.hover))
Exemple #12
0
 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')
Exemple #13
0
 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"
     })
     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')