Have you looked at css_text in ui_helpers.py? It combines the waiting and the returning text.