fixing keyless tests

This commit is contained in:
Joakim Troëng 2024-04-15 12:06:10 +02:00
parent 848605c855
commit 94885c41c2
2 changed files with 29 additions and 11 deletions

View File

@ -36,21 +36,22 @@ void main() {
});
group('Settings', () {
appTestKeyless('Click through all Themes', (WidgetTester tester) async {
var settingDrawerButton = find.byKey(settingDrawerIcon).hitTestable();
await tester.tap(settingDrawerButton);
await tester.longWait();
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(find.byKey(settingDrawerIcon).hitTestable());
await tester.shortWait();
await tester.tap(find.byKey(themeModeSetting));
await tester.longWait();
await tester.shortWait();
await tester
.tap(find.byKey(themeModeOption(ThemeMode.light)).hitTestable());
await tester.longWait();
await tester.tap(find.byKey(themeModeSetting));
await tester.longWait();
await tester.shortWait();
await tester
.tap(find.byKey(themeModeOption(ThemeMode.dark)).hitTestable());
await tester.longWait();
await tester.tap(find.byKey(themeModeSetting));
await tester.longWait();
await tester.shortWait();
await tester
.tap(find.byKey(themeModeOption(ThemeMode.system)).hitTestable());
await tester.longWait();
@ -60,6 +61,8 @@ void main() {
var helpDrawerButton = find.byKey(helpDrawerIcon).hitTestable();
appTestKeyless('Check Licenses view', (WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.shortWait();
var licensesButtonText = find.byKey(licensesButton).hitTestable();
@ -70,8 +73,10 @@ void main() {
});
group('Opening of URLs', () {
appTestKeyless('TOS link', (WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.longWait();
await tester.shortWait();
if (isAndroid) {
expect(find.byKey(tosButton).hitTestable(), findsOneWidget);
} else {
@ -80,8 +85,10 @@ void main() {
}
});
appTestKeyless('Privacy link', (WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.longWait();
await tester.shortWait();
if (isAndroid) {
expect(find.byKey(privacyButton).hitTestable(), findsOneWidget);
} else {
@ -90,8 +97,10 @@ void main() {
}
});
appTestKeyless('Feedback link', (WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.longWait();
await tester.shortWait();
if (isAndroid) {
expect(find.byKey(userGuideButton).hitTestable(), findsOneWidget);
} else {
@ -100,6 +109,8 @@ void main() {
}
});
appTestKeyless('Help link', (WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.longWait();
if (isAndroid) {
@ -113,14 +124,18 @@ void main() {
group('Troubleshooting', () {
appTestKeyless('Diagnostics Button', skip: isAndroid,
(WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.longWait();
await tester.shortWait();
await tester.tap(find.byKey(diagnosticsChip).hitTestable());
await tester.longWait();
});
appTestKeyless('Log button', (WidgetTester tester) async {
await tester.tap(find.byKey(actionsIconButtonKey).hitTestable());
await tester.shortWait();
await tester.tap(helpDrawerButton);
await tester.longWait();
await tester.shortWait();
await tester.tap(find.byKey(logChip).hitTestable());
await tester.longWait();
});

View File

@ -25,6 +25,7 @@ import '../../app/message.dart';
import '../../app/models.dart';
import '../../app/shortcuts.dart';
import '../../app/views/action_list.dart';
import '../../app/views/keys.dart';
import '../../app/views/reset_dialog.dart';
import '../../core/models.dart';
import '../../core/state.dart';
@ -97,6 +98,7 @@ Widget homeBuildActions(
ActionListSection(l10n.s_application, children: [
ActionListItem(
icon: const Icon(Symbols.settings),
key: settingDrawerIcon,
title: l10n.s_settings,
subtitle: l10n.l_settings_desc,
actionStyle: ActionStyle.primary,
@ -107,6 +109,7 @@ Widget homeBuildActions(
),
ActionListItem(
icon: const Icon(Symbols.help),
key: helpDrawerIcon,
title: l10n.s_help_and_about,
subtitle: l10n.l_help_and_about_desc,
actionStyle: ActionStyle.primary,