Commit 11d7c79b authored by Todd Volkert's avatar Todd Volkert Committed by Yegor

Always evaluate the finder in `driver.waitFor()` and `driver.waitForAbsent()`

Fixes #11327
parent ba5bb57a
......@@ -200,7 +200,7 @@ class FlutterDriverExtension {
if (_frameSync)
await _waitUntilFrame(() => SchedulerBinding.instance.transientCallbackCount == 0);
await _waitUntilFrame(() => finder.precache());
await _waitUntilFrame(() => finder.evaluate().isNotEmpty);
if (_frameSync)
await _waitUntilFrame(() => SchedulerBinding.instance.transientCallbackCount == 0);
......@@ -213,7 +213,7 @@ class FlutterDriverExtension {
if (_frameSync)
await _waitUntilFrame(() => SchedulerBinding.instance.transientCallbackCount == 0);
await _waitUntilFrame(() => !finder.precache());
await _waitUntilFrame(() => finder.evaluate().isEmpty);
if (_frameSync)
await _waitUntilFrame(() => SchedulerBinding.instance.transientCallbackCount == 0);
......@@ -268,10 +268,8 @@ class FlutterDriverExtension {
Future<WaitForResult> _waitFor(Command command) async {
final WaitFor waitForCommand = command;
if ((await _waitForElement(_createFinder(waitForCommand.finder))).evaluate().isNotEmpty)
return new WaitForResult();
else
return null;
await _waitForElement(_createFinder(waitForCommand.finder));
return new WaitForResult();
}
Future<WaitForAbsentResult> _waitForAbsent(Command command) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment