コード例 #1
0
ファイル: info_widget.py プロジェクト: hcyg/ggrc-core
 def has_ca_inline_edit(self, attr_title):
   """Tries to open edit form for CA by its title
   and returns bool if edit exists."""
   ca_manager = page_elements.CustomAttributeManager(
       self._browser,
       obj_type=self.child_cls_name.lower(),
       is_global=True,
       is_inline=True)
   return ca_manager.find_ca_elem_by_title(
       attr_title).open_edit().is_inline_edit_opened
コード例 #2
0
ファイル: info_widget.py プロジェクト: hcyg/ggrc-core
 def fill_ca_values(self, custom_attributes, is_global, is_inline):
   """Fills custom attributes with values."""
   ca_manager = page_elements.CustomAttributeManager(
       self._browser,
       obj_type=self.child_cls_name.lower(),
       is_global=is_global,
       is_inline=is_inline)
   for attr_title, attr_value in custom_attributes.iteritems():
     elem_class = ca_manager.find_ca_elem_by_title(attr_title)
     elem_class.set_value(attr_value)
     if is_inline:
       self.wait_save()
   if not is_inline:
     self.edit_popup.save_and_close()
コード例 #3
0
ファイル: info_widget.py プロジェクト: hcyg/ggrc-core
 def get_custom_attributes(self, is_gcas_not_lcas=True):
   """Get text of all CAs headers and values and convert it to dictionary.
   If 'is_gcas_not_lcas' then get GCAs, if not 'is_gcas_not_lcas'
   then get LCAs.
   Example:
   :return {'ca_header1': 'ca_value1', 'ca_header2': 'ca_value2', ...}
   """
   custom_attributes = {}
   ca_manager = page_elements.CustomAttributeManager(
       self._root,
       obj_type=self.child_cls_name.lower(),
       is_global=is_gcas_not_lcas,
       is_inline=True)
   all_ca_titles = ca_manager.all_ca_titles()
   for ca_title in all_ca_titles:
     ca_elem = ca_manager.find_ca_elem_by_title(ca_title)
     custom_attributes[ca_title] = ca_elem.get_value()
   return custom_attributes