Esempio n. 1
0
 def test_info_panel_close_button(self, program, my_work_dashboard):
     """Tests My Work Info panel close button."""
     info_panel = (my_work_dashboard.select_programs().tree_view.
                   select_member_by_title(program.title).panel)
     info_panel.button_close.js_click()
     selenium_utils.wait_for_doc_is_ready(my_work_dashboard._driver)
     assert info_panel.is_opened is False
Esempio n. 2
0
 def test_info_panel_close_button(self, program, my_work_dashboard):
   """Tests My Work Info panel close button."""
   info_panel = (my_work_dashboard.select_programs().tree_view.
                 select_member_by_title(program.title).panel)
   info_panel.button_close.js_click()
   selenium_utils.wait_for_doc_is_ready(my_work_dashboard._driver)
   assert info_panel.is_opened is False
Esempio n. 3
0
 def open_digest_page(self):
     """Open page with daily emails."""
     selenium_utils.open_url(self.daily_emails_url)
     selenium_utils.wait_for_doc_is_ready(self._driver)
     self._browser.element(
         xpath="//h1[contains(text(),'digest')]").wait_until(
             lambda e: e.present,
             timeout=constants.ux.MAX_USER_WAIT_SECONDS)
Esempio n. 4
0
    def wait_loading_after_actions(self):
        """Wait loading elements of Tree View after made some action with
    object(s) under Tree View.
    """
        from lib.utils.test_utils import wait_for
        selenium_utils.wait_until_not_present(self._driver,
                                              self._locators.ITEM_LOADING_CSS)
        selenium_utils.get_when_invisible(self._driver,
                                          self._locators.TREE_SPINNER_CSS)
        if "MAPPER_TREE_SPINNER_NO_RESULT" in self._locators.__dict__:

            def is_result_ready():
                """Check if the results on mapper is ready."""
                is_results_ready = False
                if not selenium_utils.is_element_enabled(
                        selenium_utils.get_when_visible(
                            self._driver, constants.locator.
                            CommonModalUnifiedMapper.BUTTON_SEARCH)):
                    return is_results_ready
                if (selenium_utils.is_element_exist(
                        self._driver,
                        self._locators.MAPPER_TREE_SPINNER_NO_RESULT)
                        or selenium_utils.is_element_exist(
                            self._driver,
                            self._locators.MAPPER_TREE_SPINNER_ITEMS)):
                    return is_results_ready
                if (selenium_utils.is_element_exist(
                        self._driver, self.locator_no_results_message)
                        or selenium_utils.get_when_all_visible(
                            self._driver,
                            (By.CSS_SELECTOR, self._locators.ITEMS))):
                    is_results_ready = True
                    return is_results_ready
                return is_results_ready

            wait_for(is_result_ready)
        selenium_utils.wait_for_doc_is_ready(self._driver)
        selenium_utils.wait_for_js_to_load(self._driver)
Esempio n. 5
0
 def wait_loading_after_actions(self):
   """Wait loading elements of Tree View after made some action with
   object(s) under Tree View.
   """
   from lib.utils.test_utils import wait_for
   selenium_utils.wait_until_not_present(
       self._driver, self._locators.ITEM_LOADING_CSS)
   selenium_utils.get_when_invisible(
       self._driver, self._locators.TREE_SPINNER_CSS)
   if "MAPPER_TREE_SPINNER_NO_RESULT" in self._locators.__dict__:
     def is_result_ready():
       """Check if the results on mapper is ready."""
       is_results_ready = False
       if not selenium_utils.is_element_enabled(
           selenium_utils.get_when_visible(
               self._driver,
               constants.locator.CommonModalUnifiedMapper.BUTTON_SEARCH)
       ):
         return is_results_ready
       if (
           selenium_utils.is_element_exist(
               self._driver, self._locators.MAPPER_TREE_SPINNER_NO_RESULT) or
           selenium_utils.is_element_exist(
               self._driver, self._locators.MAPPER_TREE_SPINNER_ITEMS)
       ):
         return is_results_ready
       if (
           selenium_utils.is_element_exist(
               self._driver, self.locator_no_results_message) or
           selenium_utils.get_when_all_visible(
               self._driver, (By.CSS_SELECTOR, self._locators.ITEMS))
       ):
         is_results_ready = True
         return is_results_ready
       return is_results_ready
     wait_for(is_result_ready)
   selenium_utils.wait_for_doc_is_ready(self._driver)
   selenium_utils.wait_for_js_to_load(self._driver)