-
Notifications
You must be signed in to change notification settings - Fork 4.1k
test: migrate all packages from Flutter driver to integration tests #9649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
acaad19
6e14cb9
f5ab85d
cace857
8cd393a
f740e69
bc2fe33
2889d8b
eaf42c5
74f47c6
96b1030
12acdf0
a2c55e7
efb62b2
a6f9b4f
055bbaf
3aa0992
3034fa6
de19624
ddeb590
6c230af
abc6cd8
d7255fc
c412716
13e8da1
eb5cda0
7a292d1
6bb66ed
375fc02
2152519
7aac7a2
c212aae
d7d755c
d626e02
e7786d7
24aab48
ae6b089
a21c701
47a1ce6
abcf170
6f3578d
87e8d8b
abffc17
649b06d
19eaa21
05c76cd
3931a05
72b3133
42701f8
e0af8b7
ec3fb33
915af70
d20019f
67ddfd4
cc9154a
b2cd159
7a69ac7
0b8397e
532c9a1
913f6ec
2072c17
bfc2b59
ea9c124
b06cd3c
a3da82b
a6c7714
7034d76
f117e20
36487e1
6fdc1a3
56a275a
62f2e06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,21 +111,30 @@ flutter test | |
| ### End-to-end (e2e) tests | ||
|
|
||
| E2e tests are those which directly communicate with Firebase, whose results cannot be mocked. These tests run directly from | ||
| an example application. To run e2e tests, run the `flutter drive` command from the plugins main `example` directory, targeting the | ||
| entry e2e test file. | ||
| an example application. To run e2e tests, run the `flutter test` (for Android, iOS & macOS) or the `flutter drive` (for web) | ||
| command from the plugins main `example` directory, targeting the entry e2e test file. | ||
|
|
||
| > Some packages use Firebase Emulator Suite to run tests. To learn more, [visit the official documentation](https://firebase.google.com/docs/emulator-suite). | ||
|
|
||
| To start the Firebase Emulator, run these commands: | ||
|
|
||
| ```bash | ||
| cd .github/workflows/scripts | ||
| firebase emulators:start --only auth,firestore,functions,storage,database --project flutterfire-e2e-tests | ||
|
Comment on lines
+122
to
+123
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have the |
||
| ``` | ||
russellwheatley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| To run tests against Android, iOS or macOS environments, run these commands: | ||
|
|
||
| ```bash | ||
| cd packages/firebase_auth/firebase_auth/example | ||
| flutter drive --target=./test_driver/firebase_auth_e2e.dart | ||
| flutter test integration_test/firebase_auth_e2e_test.dart | ||
| ``` | ||
|
|
||
| To run tests against web environments, run the command as a release build: | ||
|
|
||
| ```bash | ||
| cd packages/firebase_auth/firebase_auth/example | ||
| flutter drive --target=./test_driver/firebase_auth_e2e.dart --release -d chrome | ||
| flutter drive --target=./integration_test/firebase_auth_e2e_test.dart --driver=./test_driver/integration_test.dart --release -d chrome | ||
| ``` | ||
|
|
||
| ### Using Melos | ||
|
|
||
This file was deleted.
| 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(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,6 @@ dev_dependencies: | |
| flutter_test: | ||
| sdk: flutter | ||
| mockito: ^5.0.0 | ||
| test: any | ||
|
|
||
| flutter: | ||
| plugin: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright 2021, the Chromium project authors. Please see the AUTHORS file | ||
| // for details. 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:cloud_firestore/cloud_firestore.dart'; | ||
| import 'package:firebase_core/firebase_core.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:integration_test/integration_test.dart'; | ||
|
|
||
| import 'collection_reference_test.dart' as collection_reference_test; | ||
| import 'document_reference_test.dart' as document_reference_test; | ||
| import 'path_test.dart' as path_test; | ||
| import 'query_reference_test.dart' as query_reference_test; | ||
|
|
||
| void main() { | ||
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. afaik this isn't required, because the flutter tool creates a temporary file where the call to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the note, @bartekpacia. However, it seems that without See: |
||
|
|
||
| group('cloud_firestore_odm', () { | ||
| setUpAll(() async { | ||
| await Firebase.initializeApp( | ||
| options: const FirebaseOptions( | ||
| apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0', | ||
| appId: '1:448618578101:ios:3a3c8ae9cb0b6408ac3efc', | ||
| messagingSenderId: '448618578101', | ||
| projectId: 'react-native-firebase-testing', | ||
| authDomain: 'react-native-firebase-testing.firebaseapp.com', | ||
| iosClientId: | ||
| '448618578101-m53gtqfnqipj12pts10590l37npccd2r.apps.googleusercontent.com', | ||
| ), | ||
| ); | ||
| FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080); | ||
| }); | ||
|
|
||
| collection_reference_test.main(); | ||
| document_reference_test.main(); | ||
| // TODO CI tests configuration currently not compatible with widget testing | ||
| // firestore_builder_test.main(); | ||
| query_reference_test.main(); | ||
| path_test.main(); | ||
| }); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.