コード例 #1
0
 def get_events(self):
     """Get list of elements that displayed in Tree View on Event widget."""
     selenium_utils.get_when_clickable(self._driver,
                                       self._locators.FIRST_TREE_VIEW_ITEM)
     self._browser.elements(class_name="event-owner")[0].element(
         class_name="person-name").wait_until(lambda e: "@" in e.text)
     return self._driver.find_elements(*self._locators.TREE_VIEW_ITEMS)
コード例 #2
0
 def choose_and_fill_dropdown_lca(self, dropdown_id, option_title,
                                  **kwargs):
     """Choose and fill comment or url for Assessment dropdown."""
     self.select_ca_dropdown_option(dropdown_id, option_title)
     SetValueForAsmtDropdown(self._driver).fill_dropdown_lca(**kwargs)
     selenium_utils.get_when_clickable(self._driver,
                                       WidgetInfoAssessment.BUTTON_COMPLETE)
コード例 #3
0
 def choose_and_fill_dropdown_lca(self, dropdown_id, option_title, **kwargs):
   """Choose and fill comment or url for Assessment dropdown."""
   self.select_ca_dropdown_option(dropdown_id, option_title)
   set_value_for_asmt_ca.SetValueForAsmtDropdown(
       self._driver).fill_dropdown_lca(**kwargs)
   selenium_utils.get_when_clickable(
       self._driver, WidgetInfoAssessment.BUTTON_COMPLETE)
コード例 #4
0
ファイル: info_widget.py プロジェクト: egorhm/ggrc-core
 def select_ca_dropdown_option(self, dropdown_id, option_value):
   """Select custom attribute dropdown option."""
   dropdown_locator = (
       By.CSS_SELECTOR, "#form-field-{}".format(dropdown_id))
   selenium_utils.get_when_clickable(
       self.info_widget_elem, dropdown_locator)
   base.DropdownStatic(self.info_widget_elem,
                       dropdown_locator).select(option_value)
コード例 #5
0
 def select_ca_dropdown_option(self, dropdown_id, option_value):
     """Select custom attribute dropdown option."""
     dropdown_locator = (By.CSS_SELECTOR,
                         "#form-field-{}".format(dropdown_id))
     selenium_utils.get_when_clickable(self.info_widget_elem,
                                       dropdown_locator)
     base.DropdownStatic(self.info_widget_elem,
                         dropdown_locator).select(option_value)
コード例 #6
0
ファイル: widget_base.py プロジェクト: zidarsk8/ggrc-core
 def open_add_new_ca_modal(self):
   """Open Add Attribute modal and return Custom Attribute Modal."""
   selenium_utils.wait_until_stops_moving(self.button_add.element)
   selenium_utils.scroll_into_view(self._driver, self.button_add.element)
   selenium_utils.get_when_clickable(self._driver, self._locators.ADD_BTN)
   selenium_utils.get_when_invisible(
       self._driver, self._locators.TREE_SPINNER)
   self.button_add.click()
   return CustomAttributeModal(self._driver)
コード例 #7
0
 def open_add_new_ca_modal(self):
   """Open Add Attribute modal and return Custom Attribute Modal."""
   selenium_utils.wait_until_stops_moving(self.add_btn.element)
   selenium_utils.scroll_into_view(self._driver, self.item_el)
   selenium_utils.get_when_clickable(self._driver, self._locators.ADD_BTN_CSS)
   selenium_utils.wait_until_not_present(
       self._driver, self._locators.TREE_SPINNER_CSS)
   self.add_btn.click()
   return CustomAttributeModal(self._driver)
コード例 #8
0
 def open_add_new_ca_modal(self):
   """Open Add Attribute modal and return Custom Attribute Modal."""
   selenium_utils.wait_until_stops_moving(self.add_btn.element)
   selenium_utils.scroll_into_view(self._driver, self.item_el)
   selenium_utils.get_when_clickable(self._driver, self._locators.ADD_BTN_CSS)
   selenium_utils.wait_until_not_present(
       self._driver, self._locators.TREE_SPINNER_CSS)
   self.add_btn.click()
   return CustomAttributeModal(self._driver)
コード例 #9
0
ファイル: info_widget.py プロジェクト: hcyg/ggrc-core
 def choose_and_fill_dropdown_lca(self, dropdown, **kwargs):
   """Choose and fill comment or url for Assessment dropdown."""
   self.fill_ca_values({dropdown.title: dropdown.multi_choice_options},
                       is_global=False,
                       is_inline=True)
   set_value_for_asmt_ca.SetValueForAsmtDropdown(
       self._driver).fill_dropdown_lca(**kwargs)
   selenium_utils.get_when_clickable(
       self._driver, locator.WidgetInfoAssessment.BUTTON_COMPLETE)
コード例 #10
0
ファイル: widget_base.py プロジェクト: jasonray716/ggrc-core
 def open_add_new_ca_modal(self):
     """Open Add Attribute modal and return CustomAttributeModal PageObject."""
     selenium_utils.wait_until_stops_moving(self.button_add.element)
     selenium_utils.scroll_into_view(self._driver, self.button_add.element)
     selenium_utils.get_when_clickable(self._driver, self._locator.ADD_BTN)
     selenium_utils.get_when_invisible(self._driver,
                                       self._locator.TREE_SPINNER)
     self.button_add.click()
     return CustomAttributeModal(self._driver)
コード例 #11
0
 def select_ca_member_by_num(self, num):
   """Select Custom Attribute member from list of members by number
   (start from 0).
   Args: num (int)
   Return: lib.page.widget.widget_base.CustomAttributeModal
   """
   # check that the buttons are loaded
   selenium_utils.get_when_clickable(self._driver, self._locators.EDIT_BTN)
   elements = self._driver.find_elements(self._locators.EDIT_BTN)
   selenium_utils.scroll_into_view(self._driver, elements[num]).click()
   return CustomAttributeModal(self._driver)
コード例 #12
0
ファイル: widget_base.py プロジェクト: jasonray716/ggrc-core
    def edit_nth_member(self, member):
        """Selects nth member from listed members in the dropdown. Since we're
    selecting from a list, the first member has the index 0.

    Args:
        member (int)
    """
        # check that the buttons are loaded
        selenium_utils.get_when_clickable(self._driver, self._locator.EDIT_BTN)

        elements = self._driver.find_elements(self._locator.EDIT_BTN)
        selenium_utils.scroll_into_view(self._driver, elements[member]).click()
        return CustomAttributeModal(self._driver)
コード例 #13
0
ファイル: generic_widget.py プロジェクト: runt18/ggrc-core
    def _set_members_listed(self):
        """Waits for the listed members to be loaded and adds them to a local
    container"""
        self._set_member_count()

        if self.member_count:
            # wait until the elements are loaded
            selenium_utils.get_when_clickable(
                self._driver, locator.ObjectWidget.MEMBERS_TITLE_LIST)

            self.members_listed = self._driver.find_elements(
                *locator.ObjectWidget.MEMBERS_TITLE_LIST)
        else:
            self.members_listed = []
コード例 #14
0
 def select_member_by_num(self, num):
     """Select member from list of members by number (start from 0).
 Args: num (int)
 Return: lib.page.widget.info.Widget
 """
     # pylint: disable=not-callable
     selenium_utils.wait_for_js_to_load(self._driver)
     self._set_members_listed()
     # need "try-except" block due to issue GGRC-1675
     try:
         member = self.members_listed[num]
         # wait for the listed items animation to stop
         selenium_utils.wait_until_stops_moving(member)
         selenium_utils.click_via_js(self._driver, member)
         # wait for the info pane animation to stop
         info_panel = selenium_utils.get_when_clickable(
             self._driver, locator.ObjectWidget.INFO_PANE)
         selenium_utils.wait_until_stops_moving(info_panel)
     except exceptions.StaleElementReferenceException:
         self.members_listed = self._driver.find_elements(
             *locator.ObjectWidget.MEMBERS_TITLE_LIST)
         return self.select_member_by_num(num)
     except exceptions.TimeoutException:
         # sometimes the click to the listed member results in hover
         return self.select_member_by_num(num)
     return self.info_widget_cls(self._driver)
コード例 #15
0
ファイル: generic_widget.py プロジェクト: zidarsk8/ggrc-core
 def select_member_by_num(self, num):
   """Select member from list of members by number (start from 0).
   Args: num (int)
   Return: lib.page.widget.info.Widget
   """
   # pylint: disable=not-callable
   selenium_utils.wait_for_js_to_load(self._driver)
   self._set_members_listed()
   try:
     member = self.members_listed[num]
     # wait for the listed items animation to stop
     selenium_utils.wait_until_stops_moving(member)
     selenium_utils.click_via_js(self._driver, member)
     # wait for the info pane animation to stop
     info_panel = selenium_utils.get_when_clickable(
         self._driver, locator.ObjectWidget.INFO_PANE)
     selenium_utils.wait_until_stops_moving(info_panel)
     return self.info_widget_cls(self._driver)
   except exceptions.StaleElementReferenceException:
     self.members_listed = self._driver.find_elements(
         *locator.ObjectWidget.MEMBERS_TITLE_LIST)
     return self.select_member_by_num(num)
   except exceptions.TimeoutException:
     # sometimes the click to the listed member results in hover
     return self.select_member_by_num(num)
コード例 #16
0
    def select_nth_member(self, member):
        """Selects member from the list. Members start from (including) 0.

    Args:
        member (int)

    Returns:
        lib.page.widget.info.Widget
    """
        try:
            element = self.members_listed[member]

            # wait for the listed items animation to stop
            selenium_utils.wait_until_stops_moving(element)
            element.click()

            # wait for the info pane animation to stop
            info_pane = selenium_utils.get_when_clickable(
                self._driver, locator.ObjectWidget.INFO_PANE)
            selenium_utils.wait_until_stops_moving(info_pane)

            return self._info_pane_cls(self._driver)
        except exceptions.StaleElementReferenceException:
            self.members_listed = self._driver.find_elements(
                *locator.ObjectWidget.MEMBERS_TITLE_LIST)
            return self.select_nth_member(member)
        except exceptions.TimeoutException:
            # sometimes the click to the listed member results in hover
            return self.select_nth_member(member)
コード例 #17
0
 def click(self):
     """When clicking on tab to first make sure it's clickable i.e.
 that this element will receive click."""
     selenium_utils.get_when_clickable(self._driver, self._locator).click()
     self.is_activated = True
コード例 #18
0
 def get_element(self):
     return selenium_utils.get_when_clickable(self._driver, self._locator)
コード例 #19
0
ファイル: base.py プロジェクト: zidarsk8/ggrc-core
 def click(self):
   """When clicking on tab to first make sure it's clickable i.e.
   that this element will receive click."""
   selenium_utils.get_when_clickable(self._driver, self._locator).click()
   self.is_activated = True
コード例 #20
0
ファイル: base.py プロジェクト: zidarsk8/ggrc-core
 def get_element(self):
   return selenium_utils.get_when_clickable(self._driver, self._locator)
コード例 #21
0
ファイル: base.py プロジェクト: zidarsk8/ggrc-core
 def get_element(self):
   """Get checkbox when web element clickable."""
   return selenium_utils.get_when_clickable(self._driver, self._locator)
コード例 #22
0
 def get_events(self):
     """Get list of elements that displayed in Tree View on Event widget."""
     selenium_utils.get_when_clickable(self._driver,
                                       self._locators.FIRST_TREE_VIEW_ITEM)
     return self._driver.find_elements(*self._locators.TREE_VIEW_ITEMS)
コード例 #23
0
 def get_element(self):
     """Get checkbox when web element clickable."""
     return selenium_utils.get_when_clickable(self._driver, self._locator)
コード例 #24
0
 def get_events(self):
     """Get list of WebElements that displayed in tree view at Event widget"""
     selenium_utils.get_when_clickable(self._driver,
                                       self._locator.FIRST_TREE_VIEW_ITEM)
     return self._driver.find_elements(*self._locator.TREE_VIEW_ITEMS)
コード例 #25
0
ファイル: admin_widget.py プロジェクト: egorhm/ggrc-core
 def get_events(self):
   """Get list of elements that displayed in Tree View on Event widget."""
   selenium_utils.get_when_clickable(
       self._driver, self._locators.FIRST_TREE_VIEW_ITEM)
   return self._driver.find_elements(*self._locators.TREE_VIEW_ITEMS)
コード例 #26
0
ファイル: admin_widget.py プロジェクト: egorhm/ggrc-core
 def click_create_button(self):
   """Click on the Create button on People widget"""
   add_button = selenium_utils.get_when_clickable(
       self._driver, self._locators.CREATE_PERSON_BUTTON_SELECTOR)
   add_button.click()
コード例 #27
0
ファイル: admin_widget.py プロジェクト: zdqf/ggrc-core
 def click_create_button(self):
     """Click on the Create button on People widget"""
     add_button = selenium_utils.get_when_clickable(
         self._driver, self._locators.CREATE_PERSON_BUTTON_SELECTOR)
     add_button.click()
コード例 #28
0
ファイル: admin_widget.py プロジェクト: VinnieJohns/ggrc-core
 def get_events(self):
   """Get list of WebElements that displayed in tree view at Event widget"""
   selenium_utils.get_when_clickable(
       self._driver,
       self._locator.FIRST_TREE_VIEW_ITEM)
   return self._driver.find_elements(*self._locator.TREE_VIEW_ITEMS)