From 0e72619eb5fdb7b22b9129f48245040378debe7f Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 31 Jan 2023 15:14:58 -0800 Subject: [PATCH] Fix ExpectWidget with Text Override --- integration_test/steps/overrides.dart | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/integration_test/steps/overrides.dart b/integration_test/steps/overrides.dart index 29f3dcc2..b5e36c2e 100644 --- a/integration_test/steps/overrides.dart +++ b/integration_test/steps/overrides.dart @@ -139,16 +139,16 @@ StepDefinitionGeneric ExpectWidgetWithTextWithin() { return given3( RegExp(r'I expect a {string} widget with text {string} to be present within {int} second(s)$'), (widgetType, text, seconds, context) async { - await context.world.appDriver.waitUntil( - () async { - await context.world.appDriver.waitForAppToSettle(); + await () async { + await context.world.appDriver.waitForAppToSettle(); - return context.world.appDriver.isPresent( - context.world.appDriver.findByDescendant(context.world.appDriver.findBy(widgetTypeByName(widgetType), FindType.type), context.world.appDriver.findBy(text, FindType.text)), - ); - }, - timeout: Duration(seconds: seconds), - ); + return context.world.appDriver.isPresent( + context.world.appDriver.findByDescendant( + context.world.appDriver.findBy( + widgetTypeByName(widgetType), FindType.type), + context.world.appDriver.findBy(text, FindType.text)), + ); + }().timeout(Duration(seconds: 120)); }, configuration: StepDefinitionConfiguration()..timeout = const Duration(days: 1), ); @@ -160,8 +160,6 @@ StepDefinitionGeneric WaitUntilTextExists() { (text, existence, context) async { await context.world.appDriver.waitUntil( () async { - await context.world.appDriver.waitForAppToSettle(); - return existence == Existence.absent ? context.world.appDriver.isAbsent( context.world.appDriver.findBy(text, FindType.text),