part of 'main.dart'; void applePayAPI() { final shouldSkip = kIsWeb ? true : ![ TargetPlatform.iOS, TargetPlatform.macOS, ].contains(defaultTargetPlatform); skippableTestWidgets('Apple Pay API enabled', (WidgetTester tester) async { final Completer pageLoaded = Completer(); final Completer alertMessageCompleter = Completer(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: InAppWebView( key: GlobalKey(), initialData: InAppWebViewInitialData(data: """ Apple Pay API """), initialSettings: InAppWebViewSettings( applePayAPIEnabled: true, ), onLoadStop: (controller, url) { pageLoaded.complete(); }, onJsAlert: (controller, jsAlertRequest) async { alertMessageCompleter.complete(jsAlertRequest.message); return null; }, ), ), ); await pageLoaded.future; final message = await alertMessageCompleter.future; expect(message, 'true'); }, skip: shouldSkip); }