Commit e066c5a9 authored by JunHyung An's avatar JunHyung An
Browse files

Check third module and second custom dashboard existed

parent 5bae6bf1
Loading
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -213,20 +213,35 @@ class MultipleTest(unittest.TestCase):

    def _dashboard_actions(self, driver):
        """Performs actions on the Dashboard."""
        wait = WebDriverWait(driver, 3)
        driver.find_element(By.XPATH, "//div[@id='wrapper']/nav/ul/li[1]/a/div").click()
        # Default dashbaord
        self._take_screenshot(driver, "dashboard_menu_click")
        driver.find_element(By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div/div/div/div/div/div/div[2]/div/div/span[2]/span/span").click()
        self._take_screenshot(driver, "dashboard_first_element_click")
        time.sleep(1.5)
        self._take_screenshot(driver, "dashboard_default_first_module_click")
        driver.find_element(By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div/div/div/div/div/div/div[2]/div[2]/div/span[2]/span/span").click()
        self._take_screenshot(driver, "dashboard_second_element_click")
        driver.find_element(By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div/div/div/div/div/div/div[2]/div[3]/div/span[2]/span/span").click()
        self._take_screenshot(driver, "dashboard_third_element_click")
        time.sleep(1.5)
        self._take_screenshot(driver, "dashboard_default_second_module_click")
        try:
            wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div/div/div/div/div/div/div[2]/div[3]/div/span[2]/span/span"))).click()
            time.sleep(1.5)
            self._take_screenshot(driver, "dashboard_default_third_module_click")
        except (TimeoutException, NoSuchElementException):
            print("There is no third modules")

        # Custom dashboard
        driver.find_element(By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/div[2]/label[2]/span/span").click()
        self._take_screenshot(driver, "dashboard_fourth_element_click")
        self._take_screenshot(driver, "dashboard_custom_dashbaord_menu_click")
        driver.find_element(By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div[2]/div/div/div/div/div/div[2]/div/div/span[2]/span/span").click()
        self._take_screenshot(driver, "dashboard_fifth_element_click")
        driver.find_element(By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div[2]/div/div/div/div/div/div[2]/div[2]/div/span[2]/span/span").click()
        self._take_screenshot(driver, "dashboard_sixth_element_click")
        time.sleep(20)
        self._take_screenshot(driver, "dashboard_custom_first_dashboard_click")
        try:
            wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@id='wrapper']/div/div/aside/div/div/div/div/article/div/div[2]/div/div/div/div/div/div[2]/div[2]/div/span[2]/span/span"))).click()
            time.sleep(20)
            self._take_screenshot(driver, "dashboard_custom_second_dashboard_click")
        except (TimeoutException, NoSuchElementException):
            print("There is no second custom dashboard")

    def _topology_map_actions(self, driver):
        """Performs actions on the Topology Map."""