From ade48aafc32c291fb80f46a67cc0fdcb7c523d5c Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Mon, 28 Apr 2014 08:54:33 -0400 Subject: tests: fix searchbar lookup --- tests/steps/steps.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/steps/steps.py') diff --git a/tests/steps/steps.py b/tests/steps/steps.py index 2b36709d8e..94ce1ee52b 100644 --- a/tests/steps/steps.py +++ b/tests/steps/steps.py @@ -44,9 +44,10 @@ def view_is_opened(context, name): def get_visible_searchbar(context): """Wait for searchbar to become visible""" - searchbars = context.app.findChildren(lambda x: x.labeller.name == 'Search:' and x.showing) - assert wait_until(lambda x: len(x) > 0, searchbars), "No visible searchbars found" - return searchbars[0] + def get_searchbars(): + return context.app.findChildren(lambda x: x.labeller.name == 'Search:' and x.showing) + assert wait_until(lambda x: len(x()) > 0, get_searchbars), "No visible searchbars found" + return get_searchbars()[0] @step(u'Open "{section_name}" section') -- cgit v1.2.3