Example #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
Example #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
Example #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
Example #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))
Example #5
0
 def get_verbTab(self):
     WaitForElement.wait(self.driver, MainPageLocators.verbTab)
     return self.driver.find_element(*MainPageLocators.verbTab)
Example #6
0
 def get_dialog_options(self):
     WaitForElement.wait(self.driver, MainPageLocators.dialog)
     return self.driver.find_elements(*MainPageLocators.dialog_options)