only tap on widgets reachable by hit testing (#11767)
* only tap on widgets reachable by hit testing * use FractionalOffset * added tests * check finder finds correct widget * undo unintentional changes * address comments * style fix * add Directionality in test * fix analysis warning
This commit is contained in:
@@ -77,5 +77,21 @@ void main() {
|
||||
test('waitForAbsent resolves immediately when the element does not exist', () async {
|
||||
await driver.waitForAbsent(find.text('that does not exist'));
|
||||
});
|
||||
|
||||
test('uses hit test to determine tappable elements', () async {
|
||||
final SerializableFinder a = find.byValueKey('a');
|
||||
final SerializableFinder menu = find.byType('_DropdownMenu<Letter>');
|
||||
|
||||
// Dropdown is closed
|
||||
await driver.waitForAbsent(menu);
|
||||
|
||||
// Open dropdown
|
||||
await driver.tap(a);
|
||||
await driver.waitFor(menu);
|
||||
|
||||
// Close it again
|
||||
await driver.tap(a);
|
||||
await driver.waitForAbsent(menu);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user