Exemple #1
0
 def __init__(self, driver):
     super(BaseModal, self).__init__(driver)
     self.button_save_and_close = base.Button(driver,
                                              self._locator_button_save)
     self.ui_title = base.TextInputField(self._driver,
                                         self._locator_ui_title)
     self.ui_code = base.TextInputField(self._driver, self._locator_ui_code)
Exemple #2
0
 def __init__(self, driver):
   super(ProgramsModal, self).__init__(driver)
   # user input elements
   self.ui_description = base.Iframe(
       self._driver, self._locators.UI_DESCRIPTION)
   self.ui_notes = base.Iframe(self._driver, self._locators.UI_NOTES)
   self.ui_code = base.TextInputField(self._driver, self._locators.UI_CODE)
   self.ui_state = base.Dropdown(self._driver, self._locators.UI_STATE)
   self.ui_show_optional_fields = base.Toggle(
       self._driver, self._locators.BUTTON_SHOW_ALL_OPTIONAL_FIELDS)
   self.ui_primary_contact = base.TextFilterDropdown(
       self._driver, self._locators.UI_PRIMARY_CONTACT,
       self._locators.DROPDOWN_CONTACT)
   self.ui_secondary_contact = base.TextFilterDropdown(
       self._driver, self._locators.UI_SECONDARY_CONTACT,
       self._locators.DROPDOWN_CONTACT)
   self.ui_program_url = base.TextInputField(
       self._driver, self._locators.UI_PROGRAM_URL)
   self.ui_reference_url = base.TextInputField(
       self._driver, self._locators.UI_REFERENCE_URL)
   self.ui_effective_date = base.DatePicker(
       self._driver, self._locators.EFFECTIVE_DATE_DATEPICKER,
       self._locators.UI_EFFECTIVE_DATE)
   self.ui_stop_date = base.DatePicker(
       self._driver, self._locators.STOP_DATE_DATEPICKER,
       self._locators.UI_STOP_DATE)
   # static elements
   self.title = base.Label(self._driver, self._locators.TITLE)
   self.description = base.Label(self._driver, self._locators.DESCRIPTION)
   self.program_url = base.Label(self._driver, self._locators.PROGRAM_URL)
Exemple #3
0
 def __init__(self, driver):
     super(BaseModal, self).__init__(driver)
     self.modal_elem = selenium_utils.get_when_visible(
         self._driver, self._locators.MODAL_CSS)
     self.button_save_and_close = base.Button(self.modal_elem,
                                              self._locator_button_save)
     self.ui_title = base.TextInputField(self.modal_elem,
                                         self._locator_ui_title)
     self.ui_code = base.TextInputField(self.modal_elem,
                                        self._locator_ui_code)
Exemple #4
0
 def __init__(self, driver):
     super(ControlsModal, self).__init__(driver)
     # labels
     self.modal_title = base.Label(driver, self._locators.MODAL_TITLE)
     self.title = base.Label(driver, self._locators.TITLE)
     self.description = base.Label(driver, self._locators.DESCRIPTION)
     self.test_plan = base.Label(driver, self._locators.TEST_PLAN)
     self.notes = base.Label(driver, self._locators.NOTES)
     self.code = base.Label(driver, self._locators.CODE)
     self.kind_or_nature = base.Label(driver, self._locators.KIND_OR_NATURE)
     self.fraud_related = base.Label(driver, self._locators.FRAUD_RELATED)
     self.frequency = base.Label(driver, self._locators.FREQUENCY)
     self.assertions = base.Label(driver, self._locators.ASSERTIONS)
     self.admin = base.Label(driver, self._locators.ADMIN)
     self.control_url = base.Label(driver, self._locators.CONTROL_URL)
     self.reference_url = base.Label(driver, self._locators.REFERENCE_URL)
     self.significance = base.Label(driver, self._locators.SIGNIFICANCE)
     self.type_or_means = base.Label(driver, self._locators.TYPE_OR_MEANS)
     self.categories = base.Label(driver, self._locators.CATEGORIES)
     self.state = base.Label(driver, self._locators.STATE)
     self.ui_description = base.Iframe(driver,
                                       self._locators.UI_DESCRIPTION)
     self.ui_test_plan = base.Iframe(driver, self._locators.UI_TEST_PLAN)
     self.ui_notes = base.Iframe(driver, self._locators.UI_NOTES)
     self.ui_code = base.TextInputField(driver, self._locators.UI_CODE)
     self.ui_control_url = base.TextInputField(
         driver, self._locators.UI_CONTROL_URL)
     self.ui_reference_url = base.TextInputField(
         driver, self._locators.UI_REFERENCE_URL)
     # datepickers
     self.ui_effective_date = base.DatePicker(
         driver, self._locators.EFFECTIVE_DATE,
         self._locators.DATEPICKER_EFFECTIVE_DATE)
     self.ui_stop_date = base.DatePicker(
         driver, self._locators.STOP_DATE,
         self._locators.DATEPICKER_STOP_DATE)
     # dropdowns
     self.ui_kind_or_nature = base.Dropdown(
         driver, self._locators.DROPDOWN_KIND_OR_NATURE)
     self.ui_fraud_related = base.Dropdown(
         driver, self._locators.DROPDOWN_FRAUD_RELATED)
     self.ui_type_or_means = base.Dropdown(
         driver, self._locators.DROPDOWN_TYPE_OR_MEANS)
     self.ui_frequency = base.Dropdown(driver,
                                       self._locators.DROPDOWN_FREQUENCY)
     # selectable lists
     self.selectable_assertions = base.Selectable(
         driver, self._locators.SELECTABLE_ASSERTIONS)
     self.selectable_categories = base.Selectable(
         driver, self._locators.SELECTABLE_CATEGORIES)
     # buttons
     self.button_add_owner = base.Button(driver,
                                         self._locators.BUTTON_ADD_OWNER)
     self.button_hide_all_optional_fields = base.Button(
         driver, self._locators.BUTTON_HIDE_ALL_OPTIONAL_FIELDS)
Exemple #5
0
 def __init__(self, driver):
   super(CreateNewPersonModal, self).__init__(driver)
   self.modal_elem = selenium_utils.get_when_visible(
       self._driver, self._locators.MODAL_CSS)
   self.name_tf = base.TextInputField(
       self.modal_elem, self._locators.NAME)
   self.email_tf = base.TextInputField(
       self.modal_elem, self._locators.EMAIL)
   self.modal_type_lbl = base.Label(
       self.modal_elem, locator.ModalCommonConfirmAction.MODAL_TITLE)
   self.button_save_and_close = base.Button(
       self.modal_elem, self._locators.BUTTON_SAVE_AND_CLOSE)
   self.is_create_modal = "New Person" in self.modal_type_lbl.text
Exemple #6
0
 def __init__(self, driver):
     super(BaseModal, self).__init__(driver)
     self.modal_elem = selenium_utils.get_when_visible(
         self._driver, self._locators.MODAL_CSS)
     self.ui_title = base.TextInputField(self.modal_elem,
                                         self._locator_ui_title)
     self.modal_type_lbl = base.Label(
         self.modal_elem, locator.ModalCommonConfirmAction.MODAL_TITLE)
     self.button_save_and_close = base.Button(self.modal_elem,
                                              self._locator_button_save)
     self.is_create_modal = "New " in self.modal_type_lbl.text
     self.code = (base.TextInputField(self.modal_elem, self._locator_code)
                  if self.is_create_modal else base.Label(
                      self.modal_elem, self._locator_code))
Exemple #7
0
 def __init__(self, driver):
   super(CustomAttributeModal, self).__init__(driver)
   self.attribute_title = base.Label(
       self._driver, self._locator.ATTRIBUTE_TITLE)
   self.inline_help = base.Label(self._driver, self._locator.INLINE_HELP)
   self.attribute_type = base.Label(
       self._driver, self._locator.ATTRIBUTE_TYPE)
   self.placeholder = base.Label(self._driver, self._locator.PLACEHOLDER)
   self.mandatory = base.Label(self._driver, self._locator.MANDATORY)
   self.ui_inline_help = base.TextInputField(
       self._driver, self._locator.UI_INLINE_HELP)
   self.ui_placeholder = base.TextInputField(
       self._driver, self._locator.UI_PLACEHOLDER)
   self.checkbox_mandatory = base.Checkbox(
       self._driver, self._locator.CHECKBOX_MANDATORY)
Exemple #8
0
 def filter_by_name_email_company(self, str_to_filter_by):
     """Filter people via filter by name email company text field"""
     filter_tf = base.TextInputField(
         self._driver,
         self._locators.FILTER_BY_NAME_EMAIL_COM_FIELD_SELECTOR)
     filter_tf.enter_text(str_to_filter_by)
     filter_tf.send_enter_key()
Exemple #9
0
 def _get_latest_filter_elements(self):
     """Return elements of last filter parameter"""
     return {
         "name":
         base.DropdownStatic(
             self._driver,
             selenium_utils.get_when_all_visible(
                 self._driver, self._locators.FILTER_ATTRIBUTE_NAME)[-1]),
         "operator":
         base.DropdownStatic(
             self._driver,
             selenium_utils.get_when_all_visible(
                 self._driver, self._locators.FILTER_OPERATOR)[-1]),
         "compare":
         base.DropdownStatic(
             self._driver,
             selenium_utils.get_when_all_visible(
                 self._driver,
                 self._locators.FILTER_ATTRIBUTE_COMPARE)[-1]),
         "value":
         base.TextInputField(
             self._driver,
             selenium_utils.get_when_all_visible(
                 self._driver, self._locators.FILTER_ATTRIBUTE_VALUE)[-1])
     }
Exemple #10
0
 def set_dropdown_comment(self, comment):
   """Set comment via dropdown."""
   input_field = base.TextInputField(
       self._driver,
       locator.ModalSetValueForAsmtCA.INPUT_COMMENT)
   input_field.click()
   input_field.element.send_keys(comment)
Exemple #11
0
 def __init__(self, driver):
   super(_Modal, self).__init__(driver)
   self.modal_window = self._driver.find_element(*self._locators.MODAL_CSS)
   self.attr_title_ui = base.TextInputField(
       self.modal_window, self._locators.ATTR_TITLE_UI_CSS)
   self.submit_btn = base.Button(
       self.modal_window, self._locators.SAVE_AND_CLOSE_BTN_CSS)
Exemple #12
0
    def __init__(self, driver):
        super(_Modal, self).__init__(driver)

        self.ui_attribute_title = base.TextInputField(
            self._driver, self._locator.UI_ATTRIBUTE_TITLE)
        self.button_submit = base.Button(self._driver,
                                         self._locator.BUTTON_SAVE_AND_CLOSE)
Exemple #13
0
 def __init__(self, driver):
     super(_Modal, self).__init__(driver)
     self.modal_window = selenium_utils.get_when_visible(
         self._driver, self._locators.MODAL_CSS)
     self.attr_title_ui = base.TextInputField(
         self.modal_window, self._locators.ATTR_TITLE_UI_CSS)
     self.submit_btn = base.Button(self.modal_window,
                                   self._locators.SAVE_AND_CLOSE_BTN_CSS)
Exemple #14
0
 def __init__(self, driver):
     super(ProgramsModal, self).__init__(driver)
     # user input elements
     self.ui_description = base.TextInputField(
         self.modal_elem, self._locators.UI_DESCRIPTION)
     self.ui_notes = base.TextInputField(self.modal_elem,
                                         self._locators.UI_NOTES)
     self.ui_state = base.Dropdown(self.modal_elem, self._locators.UI_STATE)
     self.ui_show_optional_fields = base.Toggle(
         self.modal_elem, self._locators.BUTTON_SHOW_ALL_OPTIONAL_FIELDS)
     self.ui_effective_date = base.DatePicker(
         self.modal_elem, self._locators.EFFECTIVE_DATE_DATEPICKER,
         self._locators.UI_EFFECTIVE_DATE)
     # static elements
     self.title = base.Label(self.modal_elem, self._locators.TITLE)
     self.description = base.Label(self.modal_elem,
                                   self._locators.DESCRIPTION)
Exemple #15
0
 def set_dropdown_url(self, url):
   """Set evidence url via dropdown."""
   base.Button(
       self._driver,
       locator.ModalSetValueForAsmtCA.BUTTON_ADD_URL).click()
   base.TextInputField(
       self._driver,
       locator.ModalSetValueForAsmtCA.INPUT_EVIDENCE_URL).enter_text(
       url)
   base.Button(
       self._driver,
       locator.ModalSetValueForAsmtCA.BUTTON_CONFIRM_URL).click()
Exemple #16
0
 def __init__(self, driver):
     super(CommonUnifiedMapperModal, self).__init__(driver)
     # labels
     self.title_modal = base.Label(driver, self._locators.MODAL_TITLE)
     self.obj_type = base.Label(driver, self._locators.OBJ_TYPE)
     self.filter_by_expression = base.Label(
         driver, self._locators.FILTER_BY_EXPRESSION)
     # user input elements
     self.filter_via_expression_text_box = base.TextInputField(
         driver, self._locators.FILTER_VIA_EXPRESSION_TEXT_BOX)
     self.filter_by_state_text_box = base.DropdownStatic(
         driver, self._locators.FILTER_BY_STATE_DROPDOWN,
         self._locators.FILTER_BY_STATE_DROPDOWN_OPTIONS)
Exemple #17
0
 def _get_latest_filter_elements(self):
   """Return elements of last filter parameter"""
   latest_filter_elem = self._driver.find_elements(
       *self._locators.FILTER_ROW_CSS)
   latest_filter = {
       "name": base.DropdownAutocomplete(
           latest_filter_elem[-1], self._locators.FILTER_ATTRIBUTE_NAME),
       "compare_op": base.DropdownStatic(
           latest_filter_elem[-1], self._locators.FILTER_ATTRIBUTE_COMPARE),
       "value": base.TextInputField(
           latest_filter_elem[-1], self._locators.FILTER_ATTRIBUTE_VALUE),
       "operator": None}
   if len(latest_filter_elem) > 1:
     latest_filter["operator"] = base.DropdownStatic(
         self.modal_elem, selenium_utils.get_when_all_visible(
             self.modal_elem, self._locators.FILTER_OPERATOR)[-1])
   return latest_filter
Exemple #18
0
 def enter_placeholder(self, placeholder):
     """Fill the 'Placeholder' field."""
     self.ui_placeholder = base.TextInputField(self._driver,
                                               self._locator.UI_PLACEHOLDER)
     self.ui_placeholder.enter_text(placeholder)
Exemple #19
0
 def enter_possible_values(self, values_string):
     """Fill 'Possible values' field for 'Dropdown' type of CustomAttribute."""
     self.possible_values_ui = base.TextInputField(
         self.modal_window, self._locators.POSSIBLE_VALUES_UI_CSS)
     self.possible_values_ui.enter_text(values_string)
Exemple #20
0
 def enter_placeholder(self, placeholder):
     """Fill 'Placeholder' field."""
     self.placeholder_ui = base.TextInputField(
         self.modal_window, self._locators.PLACEHOLDER_UI_CSS)
     self.placeholder_ui.enter_text(placeholder)
Exemple #21
0
 def enter_inline_help(self, inline_help):
     """Fill 'Inline help' field."""
     self.inline_help_ui = base.TextInputField(
         self.modal_window, self._locators.INLINE_HELP_UI_CSS)
     self.inline_help_ui.enter_text(inline_help)
Exemple #22
0
 def enter_possible_values(self, values_string):
     """Fill 'Possible values' field for 'Dropdown' type of CustomAttribute."""
     self.ui_possible_values = base.TextInputField(
         self._driver, self._locator.UI_POSSIBLE_VALUES)
     self.ui_possible_values.enter_text(values_string)
Exemple #23
0
 def __init__(self, driver):
     super(RisksModal, self).__init__(driver)
     self.ui_description = base.TextInputField(
         self.modal_elem.parent, self._locators.UI_DESCRIPTION)
Exemple #24
0
 def enter_inline_help(self, inline_help):
     """Fill the 'Inline help' field."""
     self.ui_inline_help = base.TextInputField(self._driver,
                                               self._locator.UI_INLINE_HELP)
     self.ui_inline_help.enter_text(inline_help)