i read flutter's doc but i couldn't test button's action , i tried to do it this way, the button is children of PrivacyPolicyCard, and when clicked goes to the next page
testWidgets(
"TextButton Acept",
(WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
home: PrivacyPolicyCard(),
));
final buton = find.byKey(Key("bt-acept"), skipOffstage: false);
await tester.ensureVisible(buton);
expect(find.bySemanticsLabel("Button Acept"), findsOneWidget);
await tester.tap(buton);
await tester.pumpAndSettle(Duration(seconds: 2));
expect(find.text("Next Page"), findsOneWidget);
await tester.printToConsole("test passed");
},
);
how do I find out if the button's action went to the next page?