-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(cat-voices): Adding account tests
- Loading branch information
Showing
7 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
catalyst_voices/apps/voices/integration_test/account_test.dart
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,44 @@ | ||
import 'package:catalyst_voices/app/view/app.dart'; | ||
import 'package:catalyst_voices/configs/bootstrap.dart'; | ||
import 'package:catalyst_voices/routes/routes.dart'; | ||
import 'package:catalyst_voices_models/catalyst_voices_models.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:patrol_finders/patrol_finders.dart'; | ||
|
||
import 'pageobject/account_dropdown_page.dart'; | ||
import 'pageobject/app_bar_page.dart'; | ||
import 'pageobject/overall_spaces_page.dart'; | ||
|
||
void main() async { | ||
late final GoRouter router; | ||
|
||
setUpAll(() async { | ||
router = buildAppRouter(); | ||
}); | ||
|
||
setUp(() async { | ||
await registerDependencies(config: const AppConfig()); | ||
router.go(const DiscoveryRoute().location); | ||
}); | ||
|
||
tearDown(() async { | ||
await restartDependencies(); | ||
}); | ||
|
||
group( | ||
'Account dropdown -', | ||
() { | ||
patrolWidgetTest( | ||
'user - Account dropdown button opens account dropdown', | ||
(PatrolTester $) async { | ||
await $.pumpWidgetAndSettle(App(routerConfig: router)); | ||
await $(OverallSpacesPage.userShortcutBtn) | ||
.tap(settleTimeout: const Duration(seconds: 10)); | ||
await $(AppBarPage.accountPopupBtn).tap(); | ||
await AccountDropdownPage.accountDropdownLooksAsExpected($); | ||
}, | ||
); | ||
}, | ||
); | ||
} |
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
19 changes: 19 additions & 0 deletions
19
catalyst_voices/apps/voices/integration_test/pageobject/account_dropdown_page.dart
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,19 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:patrol_finders/patrol_finders.dart'; | ||
|
||
class AccountDropdownPage { | ||
static const popUpMenuAccountHeader = Key('PopUpMenuAccountHeader'); | ||
static const popUpMenuMyAccount = Key('PopUpMenuMyAccount'); | ||
static const popUpMenuProfileAndKeychain = Key('PopUpMenuProfileAndKeychain'); | ||
static const popUpMenuLock = Key('PopUpMenuLockAccount'); | ||
|
||
static Future<void> accountDropdownLooksAsExpected( | ||
PatrolTester $, | ||
) async { | ||
expect($(popUpMenuAccountHeader), findsOneWidget); | ||
expect($(popUpMenuMyAccount), findsOneWidget); | ||
expect($(popUpMenuProfileAndKeychain), findsOneWidget); | ||
expect($(popUpMenuLock), findsOneWidget); | ||
} | ||
} |
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