示例#1
0
 def dialogIsShown(self):
     WaitForElement.wait(self.driver, MainPageLocators.dialog)
     dialog = self.driver.find_element(*MainPageLocators.dialog)
     if dialog is not None:
         return True
     else:
         return False
示例#2
0
 def originIsValid(self, word):
     WaitForElement.wait(self.driver, MainPageLocators.translationsList)
     elements = self.driver.find_elements(
         *MainPageLocators.translationsList)
     for element in elements:
         if word in element.text:
             return True
     return False
示例#3
0
 def get_TranslationsList(self):
     text_translations = []
     WaitForElement.wait(self.driver, MainPageLocators.translationsList)
     elements = self.driver.find_elements(
         *MainPageLocators.translationsList)
     for element in elements:
         text = element.get_attribute("text")
         text_translations.append(text)
     print(text_translations)
     return text_translations
示例#4
0
 def LongTapTranslation(self, translation):
     try:
         WaitForElement.wait(self.driver, MainPageLocators.translationsList)
         elements = self.driver.find_elements(
             *MainPageLocators.translationsList)
         for element in elements:
             if translation in element.text:
                 self.long_press_element(element)
                 break
     except:
         raise Exception("Cannot tap an element with translation {}".format(
             translation))
示例#5
0
 def get_verbTab(self):
     WaitForElement.wait(self.driver, MainPageLocators.verbTab)
     return self.driver.find_element(*MainPageLocators.verbTab)
示例#6
0
 def get_dialog_options(self):
     WaitForElement.wait(self.driver, MainPageLocators.dialog)
     return self.driver.find_elements(*MainPageLocators.dialog_options)