From d0defec7d62a1455a6be26522d914c148da1e72c Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 19 Aug 2019 11:54:12 +0100 Subject: [PATCH] testing has commenced adding accessibility options now --- lib/pages/receipt_page_2.dart | 1 + test/widget_test.dart | 17 +++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/pages/receipt_page_2.dart b/lib/pages/receipt_page_2.dart index e064039..3244b56 100644 --- a/lib/pages/receipt_page_2.dart +++ b/lib/pages/receipt_page_2.dart @@ -470,6 +470,7 @@ class ReceiptPage2State extends State { } }, child: Text("GO", + key: Key("goButton"), style: TextStyle(color: Colors.white, fontSize: 22.0)), color: Colors.blue, diff --git a/test/widget_test.dart b/test/widget_test.dart index ea7f4d6..3835e00 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -11,20 +11,17 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:local_spend/main.dart'; void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { + + testWidgets('GO button repetition test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); + // Tap the GO button and trigger a frame. + await tester.tap(find.byKey(Key("goButton"))); await tester.pump(); - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); + // Verify that the dialog has shown +// expect(find.text('GO'), findsNothing); +// expect(find.text('Invalid data'), findsOneWidget); }); }