Skip to content

[Flutter-Driver]: driver.getText is not supporting RichText widget properly #62489

@GarimaVats

Description

@GarimaVats

I am trying to fetch text from RichText widget with driver.getText function on . I am using get text as below :
expect(await world.driver.getText(find.byValueKey(widgetkey)), searchtext);

We are writing RichText code like below example:
_text = RichText(
key: WidgetKeys.XYZScreenText,
text: TextSpan(
children: [
TextSpan(
text: translate(context, StringKeys.xyzInfoText1),
style: appTextTheme(context)
.bodyText2
.apply(color: AMBColors.bodyText)),
TextSpan(
text: translate(context, StringKeys.xyzInfoText2),
style:
TextStyles.body2Bold.apply(color: AMBColors.bodyText)),
],
),
);

I tried it on master as well as stable flutter channel. But still I am facing exception
Exception: DriverError: Error in Flutter application: Uncaught extension error while executing get_text: Unsupported operation: Type RichText is currently not supported by getText

Screenshot 2020-07-29 at 1 03 05 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versiont: flutter driver"flutter driver", flutter_drive, or a driver test

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions