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