示例#1
0
 def click_launchdemo(self):
     launchdemofield = PageBase.findElement(self, self.launchdemobtn)
     PageBase.clickElement(self, launchdemofield)
     self.driver.set_page_load_timeout(const.timeout)
     user_profile = PageBase.findElement(self, self.userprofile)
     if (self.driver.title == const.home_page and user_profile != None):
         self.logger.info('Logged into using UserMail successfully')
示例#2
0
 def add_ElementsButtonClick(self):
     addElementButton = PageBase.findElement(self,self.addElements)
     PageBase.clickElement(self, addElementButton)
     PageBase.waitForElementToBeDisplayed(self, self.addedElements)
     self.addedElementsView = PageBase.findElement(self, self.addedElements)
     if(self.addedElementsView !=None):
         self.logger.info('Added elements successfully')
     pass
 def check_ui_elements(self):
     global elemList
     self.homeElem = PageBase.findElement(self, self.menuHome)
     self.aboutElem = PageBase.findElement(self, self.menuAbout)
     self.contactElem = PageBase.findElement(self, self.menuContactUs)
     self.portfolioElem = PageBase.findElement(self, self.menuPortfolio)
     self.galleryElem = PageBase.findElement(self, self.menuGallery)
     elemList = [self.homeElem, self.aboutElem, self.contactElem, self.portfolioElem, self.galleryElem]
     return elemList 
 def load_url(self, base_url):
     self.logger.info("Trying to load URL \'{}\'".format(base_url))
     self.driver.get(base_url)
     self.driver.set_page_load_timeout(const.timeout)        
     self.elementPagefield = PageBase.findElement(self, self.shiftheading)
     if(self.elementPagefield !=None):
         self.logger.info('Loaded \'URL: {}\' successfully'.format(base_url)) 
示例#5
0
 def delete_ElementsButtonClick(self):
     self.deleteElementsView = PageBase.findElement(self, self.deleteElements)
     PageBase.clickElement(self, self.deleteElementsView)
     PageBase.setPageLoadTimeout(self)
     status =PageBase.waitForElementNotToBeDisplayed(self, self.deleteElementsView)
     if(status == True):
         self.logger.info('Deleted elements successfully')
     pass
 def verify_ui_page(self, test_type, name):
     global error_msg
     try:
         self.logger.info('Verifying the ui shifting page status..')
         if test_type == 'positive':                
             shift_page_view = PageBase.findElement(self, self.shiftheading)
             verifyText = PageBase.getText(self, shift_page_view)
             if(name == verifyText and PageBase.elementIsDispalyed(self, shift_page_view)):
                 return (True)
         else:                           
             return (False)   
     except Exception as e:
         e= sys.exc_info()                          
         return (e[1]) 
示例#7
0
 def verify_added_elements(self, test_type, name):
     global error_msg
     try:
         self.logger.info('Verifying the Added Elements status..')
         if test_type == 'positive':                
             added_elements_view = PageBase.findElement(self, self.addedElements)
             verifyText = PageBase.getText(self, added_elements_view)
             if(name in verifyText and PageBase.elementIsDispalyed(self, added_elements_view)):
                 return (True)
         else:                           
             return (False)   
     except Exception as e:
         e= sys.exc_info()                          
         return (e[1]) 
示例#8
0
 def verify_home_page_status(self, test_type, value):
     global error_msg
     try:
         self.logger.info('verifying the login status...')
         if test_type == 'positive':
             verifyheadingfield = PageBase.findElement(
                 self, self.homepageheading)
             home_status = PageBase.getText(self, verifyheadingfield)
             if (home_status == value):
                 return (True)
         else:
             return (False)
     except Exception as e:
         e = sys.exc_info()
         return (False, e[1])
示例#9
0
 def set_email(self, email):
     self.logger.info(
         'Trying to login into using \'Email: {}\''.format(email))
     emailfield = PageBase.findElement(self, self.email)
     PageBase.sendKeys(self, emailfield, email)