Exemple #1
0
def new_data_asset_ui(selenium):
    """Create a new Data Asset object via UI (LHN).
  Return: lib.page.widget.DataAssetInfo
  """
    data_asset_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.DATA_ASSETS)
    yield data_asset_page
Exemple #2
0
def new_system_ui(selenium):
  """Create a new System object via UI (LHN).
  Return: lib.page.widget.IssueInfo
  """
  system_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.SYSTEMS)
  yield system_page
Exemple #3
0
def new_control_ui(selenium):
    """Create a new Control object via UI (LHN).
  Return: lib.page.widget.Controls
  """
    control_info_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.CONTROLS)
    yield control_info_page
Exemple #4
0
def new_org_group_ui(selenium):
    """Create a new Org Group object via UI (LHN).
  Return: lib.page.widget.OrgGroupInfo
  """
    org_group_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.ORG_GROUPS)
    yield org_group_page
Exemple #5
0
def new_system_ui(selenium):
    """Create a new System object via UI (LHN).
  Return: lib.page.widget.IssueInfo
  """
    system_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.SYSTEMS)
    yield system_page
Exemple #6
0
def new_project_ui(selenium):
    """Create a new Project object via UI (LHN).
  Return: lib.page.widget.ProjectInfo
  """
    project_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.PROJECTS)
    yield project_page
Exemple #7
0
def new_control_ui(selenium):
  """Create a new Control object via UI (LHN).
  Return: lib.page.widget.Controls
  """
  control_info_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.CONTROLS)
  yield control_info_page
Exemple #8
0
 def new_ui_fixture(web_driver, fixture):
     """Extract arguments of 'new_ui_fixture' fixture from fixture name,
 create new objects via UI (LHN) and return UI page object.
 """
     fixture_params = fixture.replace("new_", "").replace("_ui", "")
     obj_name = fixture_params
     obj_count = counters.BATCH_COUNT
     if (objects.get_plural(obj_name) in objects.ALL_OBJS
             and objects.get_plural(obj_name) != objects.PROGRAMS):
         obj_name = objects.get_plural(obj_name)
         obj_count = 1
         objs_info_pages = [
             conftest_utils.create_obj_via_lhn(
                 web_driver, getattr(element.Lhn, obj_name.upper()))
             for _ in xrange(obj_count)
         ]
         return objs_info_pages
     elif objects.get_plural(obj_name) == objects.PROGRAMS:
         modal = conftest_utils.get_lhn_accordion(
             web_driver, getattr(element.Lhn,
                                 objects.PROGRAMS.upper())).create_new()
         test_utils.ModalNewPrograms.enter_test_data(modal)
         modal.save_and_close()
         program_info_page = info_widget.Programs(web_driver)
         return modal, program_info_page
Exemple #9
0
def new_product_ui(selenium):
    """Create new Product object via UI (LHN).
  Return: lib.page.widget.Product
  """
    product_page = conftest_utils.create_obj_via_lhn(selenium,
                                                     element.Lhn.PRODUCTS)
    yield product_page
Exemple #10
0
def new_process_ui(selenium):
    """Create a new process object via UI (LHN).
  Return: lib.page.widget.Processes
  """
    process_info_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.PROCESSES)
    yield process_info_page
Exemple #11
0
def new_process_ui(selenium):
  """Create a new process object via UI (LHN).
  Return: lib.page.widget.Processes
  """
  process_info_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.PROCESSES)
  yield process_info_page
Exemple #12
0
def new_data_asset_ui(selenium):
  """Create a new Data Asset object via UI (LHN).
  Return: lib.page.widget.DataAssetInfo
  """
  data_asset_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.DATA_ASSETS)
  yield data_asset_page
Exemple #13
0
def new_issue_ui(selenium):
  """Create a new Issue object via UI (LHN).
  Return: lib.page.widget.IssueInfo
  """
  issue_info_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.ISSUES)
  yield issue_info_page
Exemple #14
0
def new_risk_ui(selenium):
  """Create a new Risk Group object via UI (LHN).
  Return: lib.page.widget.Risks
  """
  risk_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.RISKS)
  yield risk_page
Exemple #15
0
def new_org_group_ui(selenium):
  """Create a new Org Group object via UI (LHN).
  Return: lib.page.widget.OrgGroupInfo
  """
  org_group_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.ORG_GROUPS)
  yield org_group_page
Exemple #16
0
def new_risk_ui(selenium):
    """Create a new Risk Group object via UI (LHN).
  Return: lib.page.widget.Risks
  """
    risk_page = conftest_utils.create_obj_via_lhn(selenium,
                                                  constants.element.Lhn.RISKS)
    yield risk_page
Exemple #17
0
def new_issue_ui(selenium):
    """Create a new Issue object via UI (LHN).
  Return: lib.page.widget.IssueInfo
  """
    issue_info_page = conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.ISSUES)
    yield issue_info_page
Exemple #18
0
def new_project_ui(selenium):
  """Create a new Project object via UI (LHN).
  Return: lib.page.widget.ProjectInfo
  """
  project_page = conftest_utils.create_obj_via_lhn(
      selenium, constants.element.Lhn.PROJECTS)
  yield project_page
Exemple #19
0
 def create_obj(self):
   """Create object via LHN"""
   obj_info_page = conftest_utils.create_obj_via_lhn(
       self.driver, getattr(element.Lhn, self.obj_name.upper()))
   scope = obj_info_page.get_info_widget_obj_scope()
   obj = self._create_list_objs(
       entity_factory=self.entities_factory_cls, list_scopes=[scope])[0]
   obj.url = self.driver.current_url
   return obj
Exemple #20
0
def new_controls_ui(selenium):
    """Create new Controls objects via UI (LHN).
  Return: [lib.page.widget.Controls, ...]
 """
    controls = []
    for _ in xrange(batch.COUNT):
        controls.append(
            conftest_utils.create_obj_via_lhn(selenium, element.Lhn.CONTROLS))
    yield controls
Exemple #21
0
def new_controls_ui(selenium):
  """Create a new Controls objects via UI (LHN).
  Return: [lib.page.widget.Controls, ...]
  """
  controls = []
  for _ in xrange(batch.COUNT):
    controls.append(conftest_utils.create_obj_via_lhn(
        selenium, constants.element.Lhn.CONTROLS))
  yield controls
Exemple #22
0
 def create_obj(self):
     """Create object via LHN"""
     obj_info_page = conftest_utils.create_obj_via_lhn(
         self.driver, getattr(element.Lhn, self.obj_name.upper()))
     scope = obj_info_page.get_info_widget_obj_scope()
     obj = self._create_list_objs(entity_factory=self.entities_factory_cls,
                                  list_scopes=[scope])[0]
     obj.url = self.driver.current_url
     return obj
Exemple #23
0
 def new_ui_fixture(web_driver, fixture):
   """Extract arguments of 'new_ui_fixture' fixture from fixture name,
   create new objects via UI (LHN) and return UI page object.
   """
   fixture_params = fixture.replace("new_", "").replace("_ui", "")
   obj_name = fixture_params
   obj_count = counters.BATCH_COUNT
   if (objects.get_plural(obj_name) in objects.ALL_OBJS and
           objects.get_plural(obj_name) != objects.PROGRAMS):
     obj_name = objects.get_plural(obj_name)
     obj_count = 1
     objs_info_pages = [conftest_utils.create_obj_via_lhn(
         web_driver,
         getattr(element.Lhn, obj_name.upper())) for _ in xrange(obj_count)]
     return objs_info_pages
   elif objects.get_plural(obj_name) == objects.PROGRAMS:
     modal = conftest_utils.get_lhn_accordion(
         web_driver,
         getattr(element.Lhn, objects.PROGRAMS.upper())).create_new()
     test_utils.ModalNewPrograms.enter_test_data(modal)
     modal.save_and_close()
     program_info_page = info_widget.Programs(web_driver)
     return modal, program_info_page