Wait until text is present on a screen in iOS

Hi I’m trying to wait until something is present in my appium automation. I’m very new to appium but I’m writing this in python. I’ve been trying to debug the error but I really feel like I’m just not getting it.

When I wrote my code it was as such:

    def find_text(self, text):
         wait = WebDriverWait(self.driver, 20)
         wait.until(self.driver.find_element_by_accessibility_id(text).is_displayed())

Which leads to the error: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/support/wait.py:71: TypeError

What am I doing wrong? I feel like this is a lot simpler than what I’m making it out to be and I’m just overlooking something but it doesnt seem to make any sense as I’m able to find text using self.driver.find_element_by_accessibility_id(text).is_displayed() but when I try to use the above block of code I’m thrown an error. It doesnt seem to make any sense to me.

https://selenium-python.readthedocs.io/waits.html

The until method expects a special lambda function (from expected_conditions set) as an argument

Is there are a working example I can find? Every example I have found fails or shoots back an error no matter how many times I’ve tweaked it. Everything seems to fail. The only thing I have found that directly passes is if I just run “self.driver.find_element_by_accessibility_id(text).is_displayed()” That works. But when I use “Wait until _______” It just fails. What do you mean it expects a special lambda function? What sort of special lambda function?

All examples are present at the link above. I don’t think anything else is needed

Unfortunately as I have said the error persists. Until is either broken or the documentation listed is completely wrong. as I have said. There are continued TypeError’s. The use of “until” is continuing to cause errors.

I would start with functional programming basics. Are you able to explain what high-order function is? What is lambda function?

At the time of asking it I was asking for a working example. Seeing as you failed to provide a working example and simply stated “Look at the documentation it works” and I’ve referred and spoken to other companies and employees to show me and they also have come to the same conclusion we have figured out a solution of our own. It seems that the functionality of the code itself is broken and not us having a misunderstanding.
-Thankyou

np.

It would be interesting to know more details on what exact functionality is broken. This might be useful for other people who face similar issues