// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import'package:flutter/material.dart';import'package:flutter_api_samples/material/popup_menu/popup_menu.1.dart'asexample;import'package:flutter_test/flutter_test.dart';voidmain(){testWidgets('Can open popup menu',(WidgetTestertester)async{constStringmenuItem='Item 1';awaittester.pumpWidget(constMaterialApp(home:Scaffold(body:example.PopupMenuApp(),),),);expect(find.text(menuItem),findsNothing);// Open popup menu.awaittester.tap(find.byIcon(Icons.adaptive.more));awaittester.pumpAndSettle();expect(find.text(menuItem),findsOneWidget);// Close popup menu.awaittester.tapAt(constOffset(1,1));awaittester.pumpAndSettle();expect(find.text(menuItem),findsNothing);});}