Beispiel #1
0
 def clickPolicyEntryActionsDropdown(self, retryCount=3, timeout=10):
     self.checkElementonPage(
         locatorName=self.getPolicyEntryActionsDropdown(),
         locatorMessage='Policy Entry Drop Down Present',
         retryCount=retryCount,
         timeout=timeout)
     SeleniumDP.click(self.driver, self.getPolicyEntryActionsDropdown())
Beispiel #2
0
 def clickDestinationClusterDropdownItem1(self):
     self.checkElementonPage(
         locatorName=self.getDestinationClusterDropdownItem1(
             returnLocatorName=True),
         locatorMessage='Destination Cluster Dropdown Item #1 Visible')
     SeleniumDP.click(self.driver,
                      self.getDestinationClusterDropdownItem1())
Beispiel #3
0
 def clickPolicyEntryActionsViewLog(self, retryCount=3, timeout=10):
     self.checkElementonPage(
         locatorName=self.getPolicyEntryActionsViewLog(),
         locatorMessage='Delete Option Visible',
         retryCount=retryCount,
         timeout=timeout)
     SeleniumDP.click(self.driver, self.getPolicyEntryActionsViewLog())
Beispiel #4
0
 def clickRefreshCluster(self, rowNum, retryNum=3):
     try:
         SeleniumDP.click(self.driver,
                          self.getClusterRefreshClickableElement())
         return True
     except Exception as e:
         # We might reach this point only if StaleElementReferenceException
         # is seen where-in we might need to invoke the whole process again
         logger.error(
             "Caught an exception: %s, Let's retry to try our luck !!!" % e)
         if retryNum > 0:
             logger.info("Retry Attempt:  %s" % retryNum)
             logger.info(
                 "Invoking clickClusterButtonAndValidateHoverVisibility"
                 "for Row: %s since refresh caused cache to loose state" %
                 rowNum)
             if self.clickClusterButtonAndValidateHoverVisibility(
                     rowNum=rowNum):
                 logger.info(
                     "Hover visible in clickRefreshCluster, Proceeding to click now"
                 )
                 return self.clickRefreshCluster(rowNum, retryNum - 1)
             else:
                 logger.error(
                     "No point proceeding further ... Failing the test")
                 return False
         else:
             logger.info("Retry Attempts failed")
             return False
    def clickToGoToPolicyLandingPage(self, policyType):

        IS_HUMBOLDT = Machine.isWindows()
        global serviceName, service_name_type_dict, service_name_type_dict_for_Humboldt

        service_name_type_dict_for_Humboldt = {
            'hadoop': 'hadoopdev',
            'hive': 'hivedev',
            'hbase': 'hbasedev',
            'knox': 'knoxdev',
            'storm': 'stormdev'
        }
        service_name_type_dict = {
            'hadoop': xa_testenv.getEnv("XA_HDFS_REPO_NAME", "hadoopdev"),
            'hive': xa_testenv.getEnv("XA_HIVE_REPO_NAME", "hivedev"),
            'hbase': xa_testenv.getEnv("XA_HBASE_REPO_NAME", "hbasedev"),
            'knox': xa_testenv.getEnv("XA_KNOX_REPO_NAME", "knoxdev"),
            'storm': xa_testenv.getEnv("XA_STORM_REPO_NAME", "stormdev")
        }

        if IS_HUMBOLDT:
            logger.info("Its a Humboldt cluster !!")
            serviceName = service_name_type_dict_for_Humboldt[policyType]
        else:
            logger.info("Its NOT a Humboldt cluster !!")
            serviceName = service_name_type_dict[policyType]
        logger.info("serviceName: " + serviceName)
        SeleniumDP.click(self.driver, self.getServiceLink(policyType, serviceName))
Beispiel #6
0
 def selectClusterToEdit(self, clusterName):
     self.isInfraLandingPage(retryCount=2)
     clusterInfoTableExists = self.checkElementonPage(
         locatorName=self.getClusterInfoTable(returnLocatorName=True),
         locatorMessage='Clusters info table',
         retryCount=5)
     if clusterInfoTableExists:
         tries = 5
         while tries > 0:
             try:
                 clusterInfoTableBody = self.findElement(
                     *self.locator_dictionary[self.getClusterInfoTableBody(
                         returnLocatorName=True)])
                 for row in clusterInfoTableBody.find_elements(
                         By.TAG_NAME, 'tr'):
                     columns = row.find_elements(By.TAG_NAME, 'td')
                     if clusterName.lower() == columns[1].text.lower():
                         actionsButton = columns[7].find_element(
                             By.TAG_NAME, 'button')
                         SeleniumDP.click(self.driver, actionsButton)
                         dropDownMenuElement = columns[7].find_element(
                             By.TAG_NAME, 'ul')
                         dropDownOptions = dropDownMenuElement.find_elements(
                             By.TAG_NAME, 'li')
                         for option in dropDownOptions:
                             entries = option.find_elements(
                                 By.TAG_NAME, 'a')
                             for entry in entries:
                                 if entry.text.lower() == 'edit':
                                     SeleniumDP.click(self.driver, entry)
                                     return
             except:
                 tries = tries - 1
Beispiel #7
0
 def validatePolicyCreationFailure(self, retryCount=3, timeout=5):
     assert self.checkElementonPage(
         locatorName=self.getPolicyCreationFailMessage(
             returnLocatorName=True),
         locatorMessage='Policy Creation Fail Message Visible',
         retryCount=retryCount,
         timeout=timeout)
     assert self.checkElementonPage(
         locatorName=self.getPolicyCreationErrorDetails(
             returnLocatorName=True),
         locatorMessage="Policy Creation Error Details Button Visible",
         retryCount=retryCount,
         timeout=timeout)
     SeleniumDP.click(self.driver, self.getPolicyCreationErrorDetails())
     assert self.checkElementonPage(
         locatorName=self.getPolicyCreationFailDialog(
             returnLocatorName=True),
         locatorMessage="Policy Creation Fail Dialog Visible",
         retryCount=retryCount,
         timeout=timeout)
     assert self.checkElementonPage(
         locatorName=self.getdlmModalDialogOKButton(returnLocatorName=True),
         locatorMessage="OK Button Visible",
         retryCount=retryCount,
         timeout=timeout)
     SeleniumDP.click(self.driver, self.getdlmModalDialogOKButton())
Beispiel #8
0
 def clickClusterDetailsDropDownClusterOne(self):
     self.checkElementonPage(
         locatorName=self.getClusterDetailsDropDownClusterOne(
             returnLocatorName=True),
         locatorMessage='Clusters Details DropDown',
         retryCount=2)
     SeleniumDP.click(self.driver,
                      self.getClusterDetailsDropDownClusterOne())
Beispiel #9
0
 def viewPolicyLog(self, policyName):
     SeleniumDP.sendKeys(self.getFilterInput(), policyName + '\n')
     self.clickPolicyEntryActionsDropdown()
     self.checkElementonPage(
         locatorName=self.getPolicyEntryActionsViewLog(),
         locatorMessage='Suspend Action Button Visible',
         retryCount=3,
         timeout=5)
     SeleniumDP.click(self.driver, self.getPolicyEntryActionsViewLog())
Beispiel #10
0
 def signOutUnauthorizedUser(self):
     unauthorizedUserNotificationTitleExists = self.checkElementonPage(
         locatorName=self.getUnauthorizedNotificationTitleElement(
             returnLocatorName=True),
         locatorMessage='User Status label ',
         retryCount=15)
     if unauthorizedUserNotificationTitleExists:
         SeleniumDP.click(self.driver,
                          self.getUnauthorizedNotificationSignOutElement())
Beispiel #11
0
 def getLoggedInUserName(self):
     SeleniumDP.click(self.driver, self.getLogoutMenu())
     self.checkElementonPage(
         locatorName=self.getLoggedInUser(returnLocatorName=True),
         locatorMessage='Logout Button',
         retryCount=4,
         timeout=0.5)
     loggedInUser = self.getLoggedInUser().text
     SeleniumDP.click(self.driver, self.getLoggedInUser())
     return loggedInUser
Beispiel #12
0
 def checkIfSearchFilterElementIsClickable(self, searchFilterElement):
     if searchFilterElement.is_enabled():
         logger.info(
             "searchFilterElement is available and clickable, Proceeding to click ..."
         )
         SeleniumDP.click(self.driver, searchFilterElement)
         self.take_screenshot("checkIfSearchFilterElementIsClickable")
         return True
     else:
         logger.error("SearchFilterElement: %s is not enabled yet" %
                      searchFilterElement.text)
         return False
Beispiel #13
0
 def clickClusterDetailsDropDownClusterOneHdfsBrowserTmpDirElement(self):
     # First time loading of HDFS data is slow
     self.checkElementonPage(
         locatorName=self.
         getClusterDetailsDropDownClusterOneHdfsBrowserTmpDirElement(
             returnLocatorName=True),
         locatorMessage='HDFS Browser tmp Dir Displayed',
         timeout=10,
         retryCount=5)
     SeleniumDP.click(
         self.driver,
         self.getClusterDetailsDropDownClusterOneHdfsBrowserTmpDirElement())
Beispiel #14
0
 def clickClusterTableSortableHeader(self, clickableElement):
     """
     Clicks the Cluster Table Header element which comes in as the input
     argument
     """
     try:
         SeleniumDP.click(self.driver, clickableElement)
         logger.info("Clicked the element")
         return True
     except Exception as e:
         logger.info("Caught Exception: %s" % e)
         return False
Beispiel #15
0
 def clickClusterRowButton(self, buttonRowNum):
     xpathForRowButton = "//table/tbody/tr[%s]/td[8]/button" % buttonRowNum
     InfraLandingPage.locator_dictionary["clusterRowButton"] = (
         By.XPATH, xpathForRowButton)
     if self.getClusterRowButton().is_enabled():
         logger.info(
             "Button is available and clickable, Proceeding to click ...")
         SeleniumDP.click(self.driver, self.getClusterRowButton())
         return True
     else:
         logger.error(
             "ClusterRowButton not clickable, might need a retry !!!")
         return False
Beispiel #16
0
 def removeAllSearchFiltersApplied(self):
     """
     Removes all the search filters applied on the cluster table
     """
     searchFiltersApplied = self.getAllSearchFiltersApplied()
     if searchFiltersApplied:
         for searchFilter in searchFiltersApplied:
             SeleniumDP.click(self.driver, searchFilter)
         logger.info("%s filter/s removed" % len(searchFiltersApplied))
         return True
     else:
         logger.info("No filters are applied")
         return False
Beispiel #17
0
 def switchUserStatusToInactive(self):
     userStatusLabelExists = self.checkElementonPage(
         locatorName=self.getStatusSwitchLabelElement(
             returnLocatorName=True),
         locatorMessage='User Status label ',
         retryCount=15)
     if userStatusLabelExists:
         currentStatus = self.findElement(
             *self.locator_dictionary[self.getStatusSwitchLabelElement(
                 returnLocatorName=True)]).text
         if currentStatus.lower() == 'active':
             SeleniumDP.click(self.driver,
                              self.getStatusSwitchToggleElement())
         else:
             logger.info("--- Current user status is Inactive")
Beispiel #18
0
 def viewClusterDetails(self, clusterName):
     self.isInfraLandingPage(retryCount=2)
     clusterInfoTableExists = self.checkElementonPage(
         locatorName=self.getClusterInfoTable(returnLocatorName=True),
         locatorMessage='Clusters info table',
         retryCount=5)
     if clusterInfoTableExists:
         clusterInfoTableBody = self.findElement(
             *self.locator_dictionary[self.getClusterInfoTableBody(
                 returnLocatorName=True)])
         for row in clusterInfoTableBody.find_elements(By.TAG_NAME, 'tr'):
             columns = row.find_elements(By.TAG_NAME, 'td')
             if clusterName.lower() == columns[1].text.lower():
                 SeleniumDP.click(self.driver, columns[1])
                 break
Beispiel #19
0
 def editUser(self, username):
     self.isUsersPage()
     userInfoTableExists = self.checkElementonPage(
         locatorName=self.getUsersInfoTableBody(returnLocatorName=True),
         locatorMessage='Users info table',
         retryCount=15)
     if userInfoTableExists:
         userInfoTable = self.findElement(
             *self.locator_dictionary[self.getUsersInfoTableBody(
                 returnLocatorName=True)])
         for row in userInfoTable.find_elements(By.TAG_NAME, 'tr'):
             columns = row.find_elements(By.TAG_NAME, 'td')
             if username.lower() == columns[0].text.lower():
                 SeleniumDP.click(self.driver, columns[0])
                 self.take_screenshot("editUser")
                 break
Beispiel #20
0
 def enterGroup(self, group, attempts=2):
     SeleniumDP.sendKeys(self.getGroupsInputField(), group)
     if self.checkElementonPage(
             locatorName=self.getGroupsDropdownSearchingRow(
                 returnLocatorName=True),
             locatorMessage='Groups DropDown Searching Row Visible',
             retryCount=1,
             timeout=1):
         self.waitForElementInvisibility(
             self.getGroupsDropdownSearchingRow(returnLocatorName=True))
     if self.checkElementonPage(
             locatorName=self.getGroupsDropdownRow(returnLocatorName=True),
             locatorMessage='Groups DropDown Visible',
             retryCount=1,
             timeout=1):
         SeleniumDP.click(self.driver, self.getGroupsDropdownRow())
     else:
         self.enterGroup(group, attempts=attempts - 1)
Beispiel #21
0
 def selectUsername(self, username):
     tries = 5
     while tries > 0:
         try:
             SeleniumDP.sendKeys(self.getUsernameField(), username)
             dropDownElementExists = self.checkElementonPage(
                 locatorName=self.getUsernameDropDownElement(
                     returnLocatorName=True),
                 locatorMessage='Drop Down element',
                 retryCount=15)
             if dropDownElementExists:
                 dropDownOptions = self.findElement(
                     *self.locator_dictionary[
                         self.getUsernameDropDownElement(
                             returnLocatorName=True)])
                 for option in dropDownOptions.find_elements(
                         By.TAG_NAME, 'div'):
                     if username == option.text.lower():
                         SeleniumDP.click(self.driver, option)
                         self.take_screenshot("selectUsername")
                         userTagExists = self.checkElementonPage(
                             locatorName=self.getUsernameTaggingElement(
                                 returnLocatorName=True),
                             locatorMessage='User Tags',
                             retryCount=15)
                         if userTagExists:
                             userTags = self.findElement(
                                 *self.locator_dictionary[
                                     self.getUsernameTaggingElement(
                                         returnLocatorName=True)])
                             for tag in userTags.find_elements(
                                     By.CLASS_NAME, 'tagSticker'):
                                 if username == tag.text.strip().lower():
                                     self.take_screenshot("selectUsername")
                                     return
         except:
             tries = tries - 1
Beispiel #22
0
 def doLogout(self):
     # Element Ids are different for DLM and DP
     if 'dlm' in self.getCurrentURL().lower():
         SeleniumDP.click(self.driver, self.getUserDropdown())
         self.checkElementonPage(
             locatorName=self.getLogoutButtonDLM(returnLocatorName=True),
             locatorMessage='Logout Button DLM',
             retryCount=4,
             timeout=0.5)
         SeleniumDP.click(self.driver, self.getLogoutButtonDLM())
     else:
         SeleniumDP.click(self.driver, self.getLogoutMenu())
         self.checkElementonPage(
             locatorName=self.getLogoutButton(returnLocatorName=True),
             locatorMessage='Logout Button',
             retryCount=4,
             timeout=0.5)
         #SeleniumDP.clickUsingClickable(self.getLogoutButton())
         SeleniumDP.click(self.driver, self.getLogoutButton())
Beispiel #23
0
 def clickOnOkBtnInPopupForMaskValueNotEntered(self, driver):
     SeleniumDP.click(driver, self.getOkBtnInPopupForMaskValueNotEntered())
Beispiel #24
0
 def clickOnCustomMaskOptionRadioBtnInPopup(self, driver):
     SeleniumDP.click(driver, self.getRadioBtnForCustomMaskingOption())
Beispiel #25
0
 def clickOnTickBtnToAddMaskOptionsInPopup(self, driver):
     SeleniumDP.click(driver, self.getTickBtnToAddMaskOptionsInPopup())
Beispiel #26
0
 def clickOnAddMaskingOptionsBtn(self, driver):
     SeleniumDP.click(driver, self.getAddMaskingOptionBtnInFirstPermRow())
Beispiel #27
0
 def clickGetStartedButton(self):
     SeleniumDP.click(self.driver, self.getGetStartedButton())
Beispiel #28
0
 def clickFlowID(self, user, flowName):
     SeleniumDP.click(self.driver, self.getFlowID(user, flowName))
Beispiel #29
0
 def clickflowRunMetrics(self, user, flowName, runID):
     SeleniumDP.click(self.driver, self.getFlowRunMetrics(user, flowName, runID))
Beispiel #30
0
 def clickXOnPair(self):
     self.checkElementonPage(
         locatorName=self.getXOnPair(returnLocatorName=True),
         locatorMessage='Unpair Button Visible')
     SeleniumDP.click(self.driver, self.getXOnPair())