Skip to content

Conversation

@gspencergoog
Copy link
Contributor

Description

This adds the ability for find.byTooltip to use a RegEx to match the tooltip.

Also, adds some tests for byTooltip, since there weren't any.

Tests

  • added tests

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels May 30, 2024
@gspencergoog gspencergoog requested a review from goderbauer May 30, 2024 20:04
@goderbauer
Copy link
Member

The checks look unhappy on this one.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, just an observation: Looks like this matcher is completely ignoring tooltips that have been configured with Tooltip.richMessage, https://main-api.flutter.dev/flutter/material/Tooltip/richMessage.html.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, good catch. I'll add that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this import may have slipped in unintentionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it wasn't me. Argh. VSCode, you're drunk, go home.

(Widget widget) => widget is Tooltip && widget.message == message,
(Widget widget) {
return widget is Tooltip && (message is RegExp
? (message.hasMatch(widget.message ?? '') || message.hasMatch(widget.richMessage?.toPlainText() ?? ''))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the regex: Should we only match on the property that isn't null? In theory, your regex could match for empty string and in the case where richMessage is non-null, this would give you a positive result (because of the first condition) even though it may not actually match richMessage.

Copy link
Contributor Author

@gspencergoog gspencergoog Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, OK, I'll fix that. I was assuming nobody would regex on an empty string, but I can see it happening.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2024
@auto-submit auto-submit bot merged commit ea8ae8c into flutter:master Jun 4, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 4, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 5, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 5, 2024
flutter/flutter@c246ecd...27e0656

2024-06-05 98614782+auto-submit[bot]@users.noreply.github.com Reverts "TreeSliver & associated classes (#147171)" (flutter/flutter#149754)
2024-06-05 [email protected] Feature: Add AnimatedList with separators (flutter/flutter#144899)
2024-06-05 [email protected] make output of flutter run web tests verbose (flutter/flutter#149694)
2024-06-05 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Request focus if `SemanticsAction.focus` is sent to a focusable widget (#142942)" (flutter/flutter#149741)
2024-06-05 [email protected] Roll Flutter Engine from e88469090fed to 11a32d43e3f6 (2 revisions) (flutter/flutter#149699)
2024-06-05 [email protected] Request focus if `SemanticsAction.focus` is sent to a focusable widget (flutter/flutter#142942)
2024-06-04 [email protected] Roll Flutter Engine from 3dd40156afb6 to e88469090fed (2 revisions) (flutter/flutter#149695)
2024-06-04 [email protected] TreeSliver & associated classes (flutter/flutter#147171)
2024-06-04 [email protected] Roll Flutter Engine from fe00f023666c to 3dd40156afb6 (3 revisions) (flutter/flutter#149692)
2024-06-04 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.7 to 3.25.8 (flutter/flutter#149691)
2024-06-04 [email protected] Prepares semantics_update_test for upcoming heading level changes (flutter/flutter#149671)
2024-06-04 [email protected] Identify and re-throw our dependency checking errors in `flutter.groovy` (flutter/flutter#149609)
2024-06-04 [email protected] Scrollbar thumb drag gestures now produce one start and one end scroll notification (flutter/flutter#146654)
2024-06-04 [email protected] Disable sandboxing for macOS apps and tests in CI (flutter/flutter#149618)
2024-06-04 [email protected] Roll Flutter Engine from e211c43f3dc1 to fe00f023666c (3 revisions) (flutter/flutter#149680)
2024-06-04 [email protected] Allow `find.byTooltip` to use a RegEx (flutter/flutter#149348)
2024-06-04 [email protected] Roll Flutter Engine from a6aa5d826649 to e211c43f3dc1 (8 revisions) (flutter/flutter#149658)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants