TF-4308 Add E2E tests for ChooseLabelModal and NoLabelYetWidget
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user