TF-4308 Add E2E tests for ChooseLabelModal and NoLabelYetWidget

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2026-04-17 14:49:52 +07:00
committed by Dat H. Pham
parent a693ceb456
commit cb41b5690b
8 changed files with 263 additions and 0 deletions
@@ -0,0 +1,35 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:tmail_ui_user/features/labels/presentation/widgets/choose_label_modal.dart';
import 'package:tmail_ui_user/features/labels/presentation/widgets/no_label_yet_widget.dart';
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_list_item.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import '../../base/core_robot.dart';
class ChooseLabelModalRobot extends CoreRobot {
ChooseLabelModalRobot(super.$);
Future<void> tapCreateALabelButton() async {
await $(ChooseLabelModal)
.$(find.text(AppLocalizations().createALabel))
.tap();
}
Future<void> tapLabelByName(String name) async {
final item = $(ChooseLabelModal).$(LabelListItem).$(name);
await $.scrollUntilVisible(finder: item);
await item.tap();
}
Future<void> tapAddLabelButton() async {
await $(ChooseLabelModal)
.$(find.text(AppLocalizations().addLabel))
.tap();
}
bool get isNoLabelYetWidgetVisible =>
$(ChooseLabelModal).$(NoLabelYetWidget).visible;
bool get isLabelListVisible =>
$(ChooseLabelModal).$(LabelListItem).visible;
}
@@ -117,6 +117,12 @@ class ThreadRobot extends CoreRobot {
await $.pumpAndSettle(duration: const Duration(seconds: 2));
}
Future<void> tapLabelAsButton() async {
await $(#moreAction_selected_email_button).tap();
await $.pumpAndTrySettle();
await $(#labelAs_action).tap();
}
Future<void> tapEmptySpamAfterLongPress() async {
await $(AppLocalizations().deleteAllSpamEmails).tap();
}