-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cat-voices): Refactor application bootstrap to allow running…
… it in integration tests (#848) * wip * refactor: app initialization logic in tests * chore: improve FPS * refactor: bootstrap * docs(cat-voices): bootstrap docs * refactor(cat-voices): cleanup * refactor(cat-voices): lints * docs(cat-voices): add more documentation * refactor(cat-voices): cleanup * refactor(cat-voices): cleanup * refactor(cat-voices): cleanup name --------- Co-authored-by: kukkok3 <[email protected]>
- Loading branch information
Showing
7 changed files
with
62 additions
and
18 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,23 @@ | ||
import 'package:catalyst_voices/app/view/app.dart'; | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('end-to-end test', () { | ||
testWidgets('run app', (tester) async { | ||
final args = await bootstrap(); | ||
await tester.pumpWidget(App(routerConfig: args.routerConfig)); | ||
// let the application load | ||
await tester.pump(const Duration(seconds: 5)); | ||
|
||
// pump and settle every 100ms to simulate almost production-like FPS | ||
await tester.pumpAndSettle(const Duration(milliseconds: 100)); | ||
|
||
// wait 10s until the test is finished | ||
await Future<void>.delayed(const Duration(seconds: 10)); | ||
}); | ||
}); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
|
||
void main() async { | ||
await bootstrap(); | ||
await bootstrapAndRun(); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
|
||
void main() async { | ||
await bootstrap(); | ||
await bootstrapAndRun(); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
|
||
void main() async { | ||
await bootstrap(); | ||
await bootstrapAndRun(); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
|
||
void main() async { | ||
await bootstrap(); | ||
await bootstrapAndRun(); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
|
||
void main() async { | ||
await bootstrap(); | ||
await bootstrapAndRun(); | ||
} |