Finder widgetWithText(Type widgetType, String text, { bool skipOffstage: true })

Looks for widgets that contain a Text descendant with text in it.

Example:

// Suppose you have a button with text 'Update' in it:
new Button(
  child: new Text('Update')
)

// You can find and tap on it like this:
tester.tap(find.widgetWithText(Button, 'Update'));

If the skipOffstage argument is true (the default), then this skips nodes that are Offstage or that are from inactive Routes.

Source

Finder widgetWithText(Type widgetType, String text, { bool skipOffstage: true }) {
  return new _WidgetWithTextFinder(widgetType, text, skipOffstage: skipOffstage);
}