-
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): 1444 add tooltip test
- Loading branch information
Showing
4 changed files
with
155 additions
and
50 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
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
67 changes: 67 additions & 0 deletions
67
catalyst_voices/apps/voices/integration_test/testestestest.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,67 @@ | ||
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/widgets.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:patrol_finders/patrol_finders.dart'; | ||
|
||
import 'pageobject/app_bar_page.dart'; | ||
import 'pageobject/overall_spaces_page.dart'; | ||
import 'pageobject/spaces_drawer_page.dart'; | ||
|
||
void main() async { | ||
final spaceToTooltipText = <Space, String>{ | ||
Space.discovery: 'Discovery space', | ||
Space.workspace: 'Workspace', | ||
Space.voting: 'Voting space', | ||
Space.fundedProjects: 'Funded project space', | ||
Space.treasury: 'Treasury space', | ||
}; | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
late final GoRouter router; | ||
|
||
setUpAll(() async { | ||
router = buildAppRouter(); | ||
await bootstrap(router: router); | ||
}); | ||
|
||
setUp(() async { | ||
await registerDependencies(); | ||
router.go(const DiscoveryRoute().location); | ||
}); | ||
|
||
tearDown(() async { | ||
await restartDependencies(); | ||
}); | ||
|
||
patrolWidgetTest( | ||
'Drawer tooltip - check tooltip text', | ||
(PatrolTester $) async { | ||
await $.pumpWidgetAndSettle(App(routerConfig: router)); | ||
await $(OverallSpacesPage.userShortcutBtn) | ||
.tap(settleTimeout: const Duration(seconds: 10)); | ||
await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); | ||
for (final space in Space.values) { | ||
await $(SpacesDrawerPage.chooserItem(space)).tap(); | ||
await $(SpacesDrawerPage.chooserIcon(space)).longPress(); | ||
await Future<void>.delayed(const Duration(seconds: 1)); | ||
final expectedText = spaceToTooltipText[space]; | ||
final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); | ||
final tooltipElement = find.descendant( | ||
of: chooserItem, | ||
matching: find.byKey(SpacesDrawerPage.tooltipElement), | ||
); | ||
final tooltipTextElement = find.descendant( | ||
of: tooltipElement, | ||
matching: find.byType(Text), | ||
); | ||
|
||
final tooltipText = $(tooltipTextElement).text; | ||
expect(tooltipText, expectedText); | ||
} | ||
}, | ||
); | ||
} |
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