-
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 (#1491)
- Loading branch information
Showing
7 changed files
with
102 additions
and
0 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
45 changes: 45 additions & 0 deletions
45
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,45 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:patrol_finders/patrol_finders.dart'; | ||
|
||
import '../utils/translations_utils.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> accountDropdownContainsSpecificData( | ||
PatrolTester $, | ||
) async { | ||
expect( | ||
$(popUpMenuAccountHeader).$(Expanded).$(Text).text?.isNotEmpty, | ||
true, | ||
reason: 'The wallet name should not be an empty string.', | ||
); | ||
expect( | ||
$(popUpMenuAccountHeader).$(Expanded).$(Text).at(1).text?.contains('₳'), | ||
true, | ||
reason: 'The account balance should contain the symbol ₳.', | ||
); | ||
expect( | ||
$(popUpMenuMyAccount).$(Text).text, | ||
T.get('My account'), | ||
); | ||
expect( | ||
$(popUpMenuProfileAndKeychain).$(Text).text, | ||
T.get('Profile & Keychain'), | ||
); | ||
expect($(popUpMenuLock).$(Text).text, T.get('Lock account')); | ||
} | ||
|
||
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
45 changes: 45 additions & 0 deletions
45
catalyst_voices/apps/voices/integration_test/suites/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,45 @@ | ||
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($); | ||
await AccountDropdownPage.accountDropdownContainsSpecificData($); | ||
}, | ||
); | ||
}, | ||
); | ||
} |
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