E2E Fix integration test Twake Mail v0.18.4
E2E Fix integration test Twake Mail v0.18.4
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:model/extensions/session_extension.dart';
|
||||
import 'package:model/upload/file_info.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/popup_item_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/download_image_as_base64_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_view.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/view/mobile/mobile_editor_view.dart';
|
||||
@@ -33,13 +34,6 @@ class ComposerRobot extends CoreRobot {
|
||||
}) async {
|
||||
final finder = $(RecipientComposerWidget).which<RecipientComposerWidget>(
|
||||
(widget) => widget.prefix == prefixEmailAddress);
|
||||
final isTextFieldFocused = finder
|
||||
.which<RecipientComposerWidget>(
|
||||
(view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterTextWithoutTapAction(email);
|
||||
|
||||
await $(RecipientSuggestionItemWidget)
|
||||
@@ -163,6 +157,10 @@ class ComposerRobot extends CoreRobot {
|
||||
fileSize: await file.length(),
|
||||
fileName: file.path.split('/').last,
|
||||
)));
|
||||
await controller.viewState.stream.firstWhere((state) => state.fold(
|
||||
(failure) => false,
|
||||
(success) => success is DownloadImageAsBase64Success,
|
||||
));
|
||||
}
|
||||
|
||||
Future<void> toggleReadReceipt() async {
|
||||
|
||||
@@ -12,7 +12,7 @@ class EmailAddressDialogRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> tapCopyEmailAddressButton(AppLocalizations appLocalizations) async {
|
||||
await $(appLocalizations.copy_email_address).tap();
|
||||
await $(#copy_email_address).tap();
|
||||
}
|
||||
|
||||
Future<void> tapComposeEmailButton(AppLocalizations appLocalizations) async {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/material_text_button.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_view_back_button.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/information_sender_and_receiver_builder.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
import '../base/core_robot.dart';
|
||||
@@ -40,47 +39,42 @@ class EmailRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> tapMarkAsUnreadOptionInContextMenu() async {
|
||||
await $(#markAsUnread_action).tap();
|
||||
await $(AppLocalizations().mark_as_unread).tap();
|
||||
}
|
||||
|
||||
Future<void> tapEmailDetailedStarButton() async {
|
||||
await $(#email_detailed_star_button).tap();
|
||||
await $(AppLocalizations().starred).tap();
|
||||
}
|
||||
|
||||
Future<void> tapEmailDetailedUnstarButton() async {
|
||||
await $(AppLocalizations().not_starred).tap();
|
||||
}
|
||||
|
||||
Future<void> tapEmailDetailedMoveEmailButton() async {
|
||||
await $(#email_detailed_move_email_button).tap();
|
||||
await $(AppLocalizations().moveMessage).tap();
|
||||
}
|
||||
|
||||
Future<void> tapEmailDetailedDeleteEmailButton() async {
|
||||
await $(#email_detailed_delete_email_button).tap();
|
||||
await $(AppLocalizations().move_to_trash).tap();
|
||||
}
|
||||
|
||||
Future<void> tapMarkAsSpamOptionInContextMenu() async {
|
||||
await $(#moveToSpam_action).tap();
|
||||
await $(AppLocalizations().markAsSpam).tap();
|
||||
}
|
||||
|
||||
Future<void> tapArchiveMessageOptionInContextMenu() async {
|
||||
await $(#archiveMessage_action).tap();
|
||||
await $(AppLocalizations().archiveMessage).tap();
|
||||
}
|
||||
|
||||
Future<void> tapSenderEmailAddress(String email) async {
|
||||
await $(MaterialTextButton)
|
||||
.which<MaterialTextButton>((widget) => widget.label.contains(email))
|
||||
.first
|
||||
.tap();
|
||||
await $(InformationSenderAndReceiverBuilder).$(email).tap();
|
||||
}
|
||||
|
||||
Future<void> tapRecipientEmailAddress(String email) async {
|
||||
await $(TMailButtonWidget)
|
||||
.which<TMailButtonWidget>((widget) => widget.text.contains(email))
|
||||
.first
|
||||
.tap();
|
||||
await $(InformationSenderAndReceiverBuilder).$(email).tap();
|
||||
}
|
||||
|
||||
Future<void> longPressSenderEmailAddress(String email) async {
|
||||
await $(MaterialTextButton)
|
||||
.which<MaterialTextButton>((widget) => widget.label.contains(email))
|
||||
.first
|
||||
.longPress();
|
||||
await $(InformationSenderAndReceiverBuilder).$(email).longPress();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:core/presentation/views/text/text_field_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/label_mailbox_item_widget.dart';
|
||||
@@ -71,11 +70,7 @@ class MailboxMenuRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> closeMenu() async {
|
||||
await $(IconButton)
|
||||
.which<IconButton>((widget) {
|
||||
return widget.tooltip == AppLocalizations().close;
|
||||
})
|
||||
.tap();
|
||||
await $.native.swipe(from: const Offset(0.9, 0.5), to: const Offset(0, 0.5));
|
||||
}
|
||||
|
||||
int getCurrentInboxCount() {
|
||||
|
||||
@@ -57,14 +57,14 @@ class ThreadRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> selectAttachmentFilter() async {
|
||||
await $(#filter_email_attachments).tap();
|
||||
await $(#attachments_filter).tap();
|
||||
}
|
||||
|
||||
Future<void> selectUnreadFilter() async {
|
||||
await $(#filter_email_unread).tap();
|
||||
await $(#unread_filter).tap();
|
||||
}
|
||||
|
||||
Future<void> selectStarredFilter() async {
|
||||
await $(#filter_email_starred).tap();
|
||||
await $(#starred_filter).tap();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user