Skip to content

[context_menus] "Selecting the email address shows a custom button" test failure #1584

@parlough

Description

@parlough

Currently the test is failing with the following error from @domesticmouse resulting in the sample being temporarily skipped:

$ flutter test
00:02 +2: /Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart: Selecting the email address shows a custom button

Warning: A call to tap() with finder "exactly one widget with text "Email Button" (ignoring offstage widgets): Text("Email Button", dependencies: [DefaultSelectionStyle, DefaultTextStyle, MediaQuery, _ScrollableScope])" derived an Offset (Offset(400.0, 639.2)) that would not hit test on the specified widget.
Maybe the widget is actually off-screen, or another widget is obscuring it, or the widget cannot receive pointer events.
Indeed, Offset(400.0, 639.2) is outside the bounds of the root of the render tree, Size(800.0, 600.0).
The finder corresponds to this RenderBox: RenderParagraph#aff1c relayoutBoundary=up22
The hit test result at that offset is: HitTestResult(HitTestEntry<HitTestTarget>#702a6(RenderView#d09ee), HitTestEntry<HitTestTarget>#19eaa(<AutomatedTestWidgetsFlutterBinding>))
#0      WidgetController._getElementPoint (package:flutter_test/src/controller.dart:1280:25)
#1      WidgetController.getCenter (package:flutter_test/src/controller.dart:1163:12)
#2      WidgetController.tap (package:flutter_test/src/controller.dart:504:18)
#3      main.<anonymous closure> (file:///Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart:24:20)
<asynchronous suspension>
#4      StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:124:15)
<asynchronous suspension>
To silence this warning, pass "warnIfMissed: false" to "tap()".
To make this warning fatal, set WidgetController.hitTestWarningShouldBeFatal to true.

00:02 +5: /Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart: Selecting the email address shows a custom button
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: exactly one matching node in the widget tree
  Actual: _WidgetTypeFinder:<zero widgets with type "TextField" (ignoring offstage widgets)>
   Which: means none were found but one was expected

When the exception was thrown, this was the stack:
#4      main.<anonymous closure> (file:///Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart:28:7)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

This was caught by the test expectation on the following line:
  file:///Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart line 28
The test description was:
  Selecting the email address shows a custom button
════════════════════════════════════════════════════════════════════════════════════════════════════
00:02 +5 -1: /Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart: Selecting the email address shows a custom button [E]
  Test failed. See exception logs above.
  The test description was: Selecting the email address shows a custom button
  
00:02 +6 -1: ... Gives correct behavior for all values of contextMenuBuilder                    
To run this test again: /Users/brettmorgan/flutter/bin/cache/dart-sdk/bin/dart test /Users/brettmorgan/Documents/GitHub/samples/experimental/context_menus/test/email_button_page_test.dart -p vm --plain-name 'Selecting the email address shows a custom button'
00:03 +18 -1: Some tests failed.    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions