-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add alignment
parameter to $.tap
#2484
Comments
Please notice, that adding the alignment other than Alignment.center to the Future<void> tap(
finders.FinderBase<Element> finder, {
int? pointer,
int buttons = kPrimaryButton,
bool warnIfMissed = true,
PointerDeviceKind kind = PointerDeviceKind.touch,
}) {
return tapAt(getCenter(finder, warnIfMissed: warnIfMissed, callee: 'tap'), pointer: pointer, buttons: buttons, kind: kind);
} copied from flutter_test/lib/src/controller.dart/WidgetController Unfortunately i did not save the test. But it was similar to the waitUntilVisible Test with Alignment. Just try to tap it with patrolWidgetTest('waits until widget is only visible at the topCenter alignment', ($) async {
await $.pumpWidget(
MaterialApp(
home: FutureBuilder(
future: Future<void>.delayed(const Duration(seconds: 3)),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return const Column(children: [
Text('some text'),
SizedBox(height: 60),
Text('some other text'),
],);
} else {
return const Text('in progress');
}
},
),
),
);
await $(Column).waitUntilVisible(alignment: Alignment.topCenter);
expect($(Column).visible, false);
expect($(Column).isVisibleAt(alignment: Alignment.topCenter), true);
await expectLater(
$(Column).waitUntilVisible,
throwsA(isA<WaitUntilVisibleTimeoutException>()),
);
});
}); |
You're right, but we can handle this. Just need to use tapAt from flutter_test directly |
As FritzMatthaeus noticed in: this comment, after adding option to pass Alignment to waitUntilVisible, we need to enhance other methods with that option. So user can tap, on something that was found as visible with alignment different than center.
We need to:
alignment
to tap.tap
withtapAt
when usingalignment
.The text was updated successfully, but these errors were encountered: