I'm trying to purchase a subscription in my tests. Everything goes well until the native Android purchase popup appears. I'm not able to tap on the green 'Subscribe' button. Is there a way to do it? The following code doesn't work:
** See screenshot - which button is the problem **
void main() async {
group('App', () {
patrolTest('Buy Subscription', nativeAutomation: true, ( PatrolTester tester) async {
await app.main();
await tester.pumpAndSettle();
await tester(ElevatedButton).tap();
await tester.native.tap(Selector(text: 'Subscribe')); });}); }
Thanks you for your help!
I suggest you take a view hierarchy dump while you see the "Subscribe" button on-screen (you mustn't to do it while the test is running):
Then open the
window_dump.xml
file in some code editor, CTRL+F for "Subscription" and see if the button is visible there. Maybe thetext
attribute is not set, butcontentDescription
is? So you could try doing: