HOTFIX Integration test 0.24.8 (#4298)
This commit is contained in:
@@ -193,4 +193,8 @@ class ComposerRobot extends CoreRobot {
|
||||
);
|
||||
controller?.handleSuccessViewState(LocalImagePickerSuccess(fileInfo));
|
||||
}
|
||||
|
||||
Future<void> tapDiscardChanges() async {
|
||||
await $(AppLocalizations().discardChanges).tap();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@ import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_view.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_attachments_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/attachment_item_widget.dart';
|
||||
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../models/provisioning_email.dart';
|
||||
@@ -56,9 +56,6 @@ class ForwardingEmailLostAttachmentsScenario extends BaseTestScenario {
|
||||
|
||||
await composerRobot.grantContactPermission();
|
||||
|
||||
await composerRobot.expandRecipientsFields();
|
||||
await $.pumpAndSettle();
|
||||
|
||||
await composerRobot.addRecipientIntoField(
|
||||
prefixEmailAddress: PrefixEmailAddress.to,
|
||||
email: emailUser,
|
||||
@@ -75,5 +72,8 @@ class ForwardingEmailLostAttachmentsScenario extends BaseTestScenario {
|
||||
|
||||
Future<void> _expectComposerViewVisible() => expectViewVisible($(ComposerView));
|
||||
|
||||
Future<void> _expectAttachmentListVisible() => expectViewVisible($(EmailAttachmentsWidget));
|
||||
Future<void> _expectAttachmentListVisible() async {
|
||||
await $.waitUntilVisible($(AttachmentItemWidget));
|
||||
expect($(AttachmentItemWidget), findsNWidgets(2));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
import '../base/base_test_scenario.dart';
|
||||
import '../robots/composer_robot.dart';
|
||||
import '../robots/mailbox_menu_robot.dart';
|
||||
import '../robots/thread_robot.dart';
|
||||
|
||||
class SaveAsTemplateScenario extends BaseTestScenario {
|
||||
@@ -10,37 +12,40 @@ class SaveAsTemplateScenario extends BaseTestScenario {
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
final imagePaths = ImagePaths();
|
||||
final appLocalizations = AppLocalizations();
|
||||
final mailboxMenuRobot = MailboxMenuRobot($);
|
||||
final threadRobot = ThreadRobot($);
|
||||
final composerRobot = ComposerRobot($);
|
||||
|
||||
await threadRobot.openMailbox();
|
||||
await mailboxMenuRobot.openFolderByName(
|
||||
appLocalizations.templatesMailboxDisplayName,
|
||||
);
|
||||
|
||||
await threadRobot.openComposer();
|
||||
await composerRobot.grantContactPermission();
|
||||
|
||||
await composerRobot.addSubject('test subject');
|
||||
await composerRobot.saveAsTemplate();
|
||||
await $.pumpAndTrySettle();
|
||||
await _expectSaveToastSuccessVisible();
|
||||
await composerRobot.tapCloseComposer(imagePaths);
|
||||
await composerRobot.tapDiscardChanges();
|
||||
await _expectTemplateVisible('test subject');
|
||||
|
||||
await composerRobot.addSubject('test subject');
|
||||
await threadRobot.openEmailWithSubject('test subject');
|
||||
await composerRobot.addSubject('test subject updated');
|
||||
hideKeyboard();
|
||||
await $.pumpAndTrySettle(duration: const Duration(seconds: 1));
|
||||
await composerRobot.saveAsTemplate();
|
||||
|
||||
await _expectUpdateToastSuccessVisible();
|
||||
await $.pumpAndTrySettle();
|
||||
await composerRobot.tapCloseComposer(imagePaths);
|
||||
await composerRobot.tapDiscardChanges();
|
||||
await _expectTemplateVisible('test subject updated');
|
||||
}
|
||||
|
||||
Future<void> _expectSaveToastSuccessVisible() async {
|
||||
await $(AppLocalizations().saveMessageToTemplateSuccess).waitUntilVisible();
|
||||
expect(
|
||||
$(AppLocalizations().saveMessageToTemplateSuccess).visible,
|
||||
isTrue,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _expectUpdateToastSuccessVisible() async {
|
||||
await $(AppLocalizations().updateMessageToTemplateSuccess).waitUntilVisible();
|
||||
expect(
|
||||
$(AppLocalizations().updateMessageToTemplateSuccess).visible,
|
||||
isTrue,
|
||||
);
|
||||
Future<void> _expectTemplateVisible(String subject) async {
|
||||
await $(subject).waitUntilVisible();
|
||||
expect($(subject).visible, isTrue);
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -5,6 +5,7 @@ import 'package:core/utils/html/html_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/header_style_type.dart';
|
||||
@@ -75,7 +76,15 @@ class RichTextMobileTabletController extends GetxController {
|
||||
@override
|
||||
void onClose() {
|
||||
richTextController.dispose();
|
||||
htmlEditorApi?.webViewController.dispose();
|
||||
if (kDebugMode) {
|
||||
try {
|
||||
htmlEditorApi?.webViewController.dispose();
|
||||
} catch (e) {
|
||||
logWarning('Dispose error: $e');
|
||||
}
|
||||
} else {
|
||||
htmlEditorApi?.webViewController.dispose();
|
||||
}
|
||||
htmlEditorApi = null;
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user