-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsfound in release: 3.20Found to occur in 3.20Found to occur in 3.20frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework team
Description
Found in
- Issue Typos in flutter_test/lib/src/controller.dart #143173
- PR Fix and test SemanticsController.simulatedAccessibilityTraversal #143386
In SemanticsController.simulatedAccessibilityTraversal, the start and end parameters are deprecated. They are replaced by startNode and endNode, but writing a test for this in the context of multiple views fails.
I wrote such a test in packages/flutter_test/test/multi_view_controller_test.dart
testWidgets('simulatedAccessibilityTraversal - startNode and endNode in same view', (WidgetTester tester) async {
tester.binding.ensureSemantics();
await pumpViews(tester: tester);
expect(
tester.semantics.simulatedAccessibilityTraversal(
startNode: find.semantics.byValue('View2Child1'),
endNode: find.semantics.byValue('View2Child3'),
).map((SemanticsNode node) => node.label),
<String>[
'View2Child1',
'View2Child2',
'View2Child3',
],
);
});but it failed with
Bad state: No element
When the exception was thrown, this was the stack:
#0 Iterable.single (dart:core/iterable.dart:674:25)
#1 SemanticsController.simulatedAccessibilityTraversal (package:flutter_test/src/controller.dart:207:57)
This is coming from here when we are trying to look up the SemanticsOwner:
| final SemanticsOwner owner = startNode.evaluate().single.owner!; |
The new API works in the single view world, so I am going to move forward with that PR to resolve other issues unrelated to this one.
cc @goderbauer
Metadata
Metadata
Assignees
Labels
a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsfound in release: 3.20Found to occur in 3.20Found to occur in 3.20frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework team