-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "interactive" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"firestore": { | ||
"rules": "firestore.rules", | ||
"indexes": "firestore.indexes.json" | ||
}, | ||
"emulators": { | ||
"auth": { | ||
"port": 9099 | ||
}, | ||
"firestore": { | ||
"port": 8080 | ||
}, | ||
"ui": { | ||
"enabled": true | ||
}, | ||
"singleProjectMode": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:firebase_core/firebase_core.dart'; | ||
import 'package:firestore/firebase_options.dart'; | ||
import 'package:firestore/src/app.dart'; | ||
import 'package:firestore/src/widgets/restaurant_card.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
bool USE_FIRESTORE_EMULATOR = true; | ||
|
||
Future<void> main() async { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform,); | ||
final hostUrl = defaultTargetPlatform == TargetPlatform.android ? "10.0.2.2" : "localhost"; | ||
if (USE_FIRESTORE_EMULATOR) { | ||
FirebaseFirestore.instance.useFirestoreEmulator(hostUrl, 8080); | ||
await FirebaseAuth.instance.useAuthEmulator(hostUrl, 9099); | ||
await FirebaseAuth.instance.signInAnonymously(); | ||
} | ||
group('Integration Tests', () { | ||
testWidgets('Test empty home page', (tester) async { | ||
await tester.pumpWidget(FriendlyEatsApp()); | ||
expect(find.text('FriendlyEats has no restaurants yet!'), findsOneWidget); | ||
expect(find.text('ADD SOME'), findsOneWidget); | ||
await tester.tap(find.text('ADD SOME').first); | ||
await tester.pumpAndSettle(const Duration(seconds: 1)); | ||
expect(find.byIcon(Icons.star), findsWidgets); | ||
}); | ||
testWidgets('view restaurant page', (tester) async { | ||
await tester.pumpWidget(FriendlyEatsApp()); | ||
await tester.tap(find.byType(RestaurantCard)); | ||
await tester.pumpAndSettle(const Duration(seconds: 1)); | ||
expect(find.text('Add Random Reviews'), findsOneWidget); | ||
await tester.tap(find.text('Add Random Reviews')); | ||
await tester.pumpAndSettle(const Duration(seconds: 1)); | ||
expect(find.text('Anonymous User'), findsWidgets); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:integration_test/integration_test_driver.dart'; | ||
|
||
Future<void> main() => integrationDriver(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters