-
Notifications
You must be signed in to change notification settings - Fork 0
Setup tests remove external packages #147
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7917017
widget tests
ZanderCowboy d996485
update Android folder of Multichoice
ZanderCowboy 288613c
add isar-3.1.0-1 to packages_external
ZanderCowboy c0a9c4b
update pubspecs
ZanderCowboy c77a1e1
please review this commit
ZanderCowboy 7738fa4
Merge branch 'develop' into setup-tests
ZanderCowboy c4ef1ef
remove all packages_external
ZanderCowboy 671085d
complete a flutter upgrade and use community isar
ZanderCowboy cf975d2
Merge branch 'develop' into setup-tests-remove-external-packages
ZanderCowboy 4be6c1b
clean up and linting issues
ZanderCowboy 5596b5f
create and update docs; should still be finished
ZanderCowboy 972c35d
revert changes to move to a new branch
ZanderCowboy b6d3cdd
Bump pubspec version to '0.3.0+152'
ZanderCowboy 5c7931b
Merge branch 'develop' into setup-tests-remove-external-packages
ZanderCowboy 574907a
Bump pubspec version to '0.3.0+153'
ZanderCowboy 140abc1
Merge branch 'develop' into setup-tests-remove-external-packages
ZanderCowboy 40908bb
Bump pubspec version to '0.3.0+159'
ZanderCowboy 300400a
chore: import change
ZanderCowboy 3a943f8
Bump pubspec version to '0.3.0+160'
ZanderCowboy 96ee9bf
chore: update docs
ZanderCowboy 6e7257b
chore: add tasks.json
ZanderCowboy a1afc4a
chore: PR comments
ZanderCowboy be37a4b
Bump pubspec version to '0.3.0+161'
ZanderCowboy d87fef1
fix sonarcloud workflow issue
ZanderCowboy 783ca0a
chore: update melos and sonarcloud to use correct scripts
ZanderCowboy 8ace6e6
sonarcloud issue
ZanderCowboy c0d7bca
Bump pubspec version to '0.3.0+162'
ZanderCowboy b12c096
sonarcloud issue
ZanderCowboy 674c79d
Bump pubspec version to '0.3.0+163'
ZanderCowboy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,35 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Flutter Integration Test", | ||
| "type": "shell", | ||
| "command": "flutter", | ||
| "args": [ | ||
| "drive", | ||
| "--target=apps/multichoice/test_driver/integration_test.dart" | ||
| ], | ||
| "group": "test", | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Uninstall App", | ||
| "type": "shell", | ||
| "command": "adb", | ||
| "args": [ | ||
| "uninstall", | ||
| "co.za.zanderkotze.multichoice" | ||
| ], | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Uninstall and Run Integration Test", | ||
| "dependsOn": [ | ||
| "Uninstall App", | ||
| "Flutter Integration Test" | ||
| ], | ||
| "dependsOrder": "sequence", | ||
| "group": "test" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,12 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "multichoice (integration test)", | ||
| "request": "launch", | ||
| "type": "dart", | ||
| "program": "apps/multichoice/test_driver/integration_test.dart", | ||
| "preLaunchTask": "Flutter Integration Test" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,6 @@ | ||
| # Set up integration tests | ||
|
|
||
| - Add integration tests | ||
| - Setup integration tests | ||
| - Add tasks.json file | ||
| - Update _build-android-app file to use this ROOT changelog |
This file contains hidden or 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 hidden or 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,81 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:integration_test/integration_test.dart'; | ||
| import 'package:multichoice/app/export.dart'; | ||
| import 'package:multichoice/main.dart' as app; | ||
| import 'package:multichoice/presentation/shared/widgets/add_widgets/_base.dart'; | ||
|
|
||
| void main() { | ||
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
| final keys = WidgetKeys.instance; | ||
|
|
||
| testWidgets('Test counter increment', (WidgetTester tester) async { | ||
| app.main(); | ||
| // Wait for the app to settle | ||
| await tester.pumpAndSettle(const Duration(seconds: 2)); | ||
|
|
||
| // Verify a Permission Required dialog appears | ||
| expect(find.text('Permission Required'), findsOneWidget); | ||
| expect(find.text('Deny'), findsOneWidget); | ||
| expect(find.text('Open Settings'), findsOneWidget); | ||
| await tester.tap(find.text('Deny')); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| // On Home Screen - Verify Add Tab Card | ||
| expect(find.byIcon(Icons.add_outlined), findsOneWidget); | ||
| expect(find.byType(AddTabCard), findsOneWidget); | ||
|
|
||
| // Open Settings Drawer - Test Layout Switch | ||
| expect(find.byIcon(Icons.settings_outlined), findsOneWidget); | ||
| await tester.tap(find.byIcon(Icons.settings_outlined)); | ||
| await tester.pumpAndSettle(); | ||
| expect(find.text('Horizontal/Vertical Layout'), findsOneWidget); | ||
| expect(find.byKey(keys.layoutSwitch), findsOneWidget); | ||
| await tester.tap(find.byKey(keys.layoutSwitch)); | ||
| await tester.pumpAndSettle(); | ||
| expect(find.byIcon(Icons.close_outlined), findsOneWidget); | ||
| await tester.tap(find.byIcon(Icons.close_outlined)); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| // On Home Screen - Add New Tab | ||
| expect(find.byIcon(Icons.add_outlined), findsOneWidget); | ||
| expect(find.byType(AddTabCard), findsOneWidget); | ||
| await tester.tap(find.byType(AddTabCard)); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| // Add New Tab Dialog | ||
| expect(find.text('Add New Tab'), findsOneWidget); | ||
| expect(find.text('Cancel'), findsOneWidget); | ||
| expect(find.text('Add'), findsOneWidget); | ||
|
|
||
| // Enter Tab Data | ||
| expect(find.byType(TextFormField), findsExactly(2)); | ||
| await tester.enterText(find.byType(TextFormField).first, 'Tab 1'); | ||
| await tester.enterText(find.byType(TextFormField).last, 'Tab 2'); | ||
| await tester.pumpAndSettle(); | ||
| expect(find.text('Tab 1'), findsOneWidget); | ||
| expect(find.text('Tab 2'), findsOneWidget); | ||
| await tester.tap(find.text('Add')); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| expect(find.text('Tab 1'), findsOneWidget); | ||
|
|
||
| // Open Settings Drawer - Test Light/Dark Mode | ||
| await tester.tap(find.byIcon(Icons.settings_outlined)); | ||
| await tester.pumpAndSettle(); | ||
| expect(find.text('Light / Dark Mode'), findsOneWidget); | ||
| expect(find.byKey(keys.lightDarkModeSwitch), findsOneWidget); | ||
| await tester.tap(find.byKey(keys.lightDarkModeSwitch)); | ||
| await tester.pumpAndSettle(); | ||
| expect(find.text('Tab 1'), findsOneWidget); | ||
| expect(find.byType(AddTabCard), findsOneWidget); | ||
| final BuildContext context = tester.element(find.byType(AddTabCard)); | ||
| final theme = Theme.of(context); | ||
| expect(theme.brightness, Brightness.dark); | ||
|
|
||
| // On Home Screen | ||
| await tester.tap(find.byIcon(Icons.search_outlined)); | ||
| await tester.pumpAndSettle(); | ||
| expect(find.textContaining('not been implemented'), findsOneWidget); | ||
| }); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.