Skip to content

Instantly share code, notes, and snippets.

@izznfkhrlislm
Created April 4, 2019 03:08
Show Gist options
  • Save izznfkhrlislm/466ac983a2e8a12c54705481f51d4456 to your computer and use it in GitHub Desktop.
Save izznfkhrlislm/466ac983a2e8a12c54705481f51d4456 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ScrumBooster/initScreen/AboutPage.dart';
import 'package:ScrumBooster/utils/utils.dart';
void main() {
final AboutPage about = AboutPage();
final util = new Util();
//About Page Widget Tests
testWidgets('About Page: Find Logos', (WidgetTester tester) async {
List<String> keys = <String>[
"Scrum Booster Logo",
"Makara UI Logo",
];
await tester.pumpWidget(util.makeTestableWidget(child: about));
for (int i = 0; i < keys.length; i++) {
expect(find.byKey(new Key(keys[i])), findsOneWidget);
}
});
testWidgets('About Page: Find Team Members Text', (WidgetTester tester) async {
List<String> teamMembers = <String>[
"Mochamad Aulia Akbar Praditomo",
"Fajrin Maulana Kingwijati",
"Izzan Fakhril Islam",
"Muhammad Rezki",
"Khoirul Khuluqi Abdulloh",
"Wildan Fahmi Gunawan",
];
await tester.pumpWidget(util.makeTestableWidget(child: about));
for (int i = 0; i < teamMembers.length; i++) {
expect(find.text(teamMembers[i]), findsOneWidget);
}
});
testWidgets('About Page: Find Explanation words', (WidgetTester tester) async {
Key key = new Key("Explanation");
await tester.pumpWidget(util.makeTestableWidget(child: about));
expect(find.byKey(key), findsOneWidget);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment