Пример #1
0
    def addCluster(self, ambariURL, clusterLocation, dataCenter, tags, description, clickAddAndNewButton=False):

        self.enterAmbariURLAndValidate(ambariURL)

        SeleniumDP.sendKeys(self.getClusterLocationField(), clusterLocation)
        time.sleep(2)
        SeleniumDP.clickUsingClickable(self.getClusterLocationAutoComplete())
        SeleniumDP.sendKeys(self.getDataCenterField(), dataCenter)
        SeleniumDP.sendKeys(self.getTagsField(), tags)
        SeleniumDP.sendKeys(self.getDescriptionField(), description)
        if clickAddAndNewButton:
            self.clickAddAndNewButton()
            if self.isClearButtonDisplayed():
                self.waitForElement(self.getGoButton(returnLocatorName=True))
        else:
            self.clickAddButton()
Пример #2
0
 def enterAmbariURLAndValidate(
         self,
         ambariURL,
         invalidURL=False,
         incorrectAmbariHost=False,
         clusterAlreadyExists=False,
         mandatoryFieldsTest=False
 ):
     SeleniumDP.sendKeys(self.getAmbariURLInputField(), ambariURL)
     self.clickGoButton()
     if invalidURL:
         # Waiting for 0 seconds for Invalid Ambari URL message to load
         assert self.checkElementonPage(
             locatorName=self.getInvalidAmbariURL(returnLocatorName=True),
             locatorMessage='Invalid Ambari URL Message Displayed',
             retryCount=0
         )
     elif clusterAlreadyExists:
         # Waiting for 0 seconds for Cluster Already Exists message to load
         assert self.checkElementonPage(
             locatorName=self.getClusterAlreadyExists(returnLocatorName=True),
             locatorMessage='Cluster Already Exists Message Displayed',
             retryCount=0
         )
     elif incorrectAmbariHost:
         # Waiting for max 30 seconds for Error Message to load
         assert self.checkElementonPage(
             locatorName=self.getErrorMessage(returnLocatorName=True),
             locatorMessage='Error Message - Dataplane could not retreive cluster information Displayed',
             retryCount=3,
             timeout=10
         )
     else:
         # Waiting for max 60 seconds for Cluster details to load
         assert self.checkElementonPage(
             locatorName=self.getClusterLocationField(returnLocatorName=True),
             locatorMessage='Add Cluster Details Parameters Displayed',
             retryCount=6,
             timeout=10
         )
         if mandatoryFieldsTest:
             SeleniumDP.sendKeys(self.getClusterLocationField(), "San Jose, California, United States of America")
             time.sleep(2)
             SeleniumDP.clickUsingClickable(self.getClusterLocationAutoComplete())