diff --git a/integration_test/robots/composer_robot.dart b/integration_test/robots/composer_robot.dart index 7e72a3c60..4c60bdace 100644 --- a/integration_test/robots/composer_robot.dart +++ b/integration_test/robots/composer_robot.dart @@ -121,10 +121,14 @@ class ComposerRobot extends CoreRobot { await $(#save_as_draft_popup_item).tap(); } - Future tapRecipientExpandButton() async { + Future tapToRecipientExpandButton() async { await $(#prefix_to_recipient_expand_button).tap(); } + Future tapCcRecipientExpandButton() async { + await $(#prefix_cc_recipient_expand_button).tap(); + } + Future tapFromFieldPopupMenu() async { await $(FromComposerMobileWidget).$(InkWell).tap(); } diff --git a/integration_test/scenarios/composer/change_identity_in_draft_email_scenario.dart b/integration_test/scenarios/composer/change_identity_in_draft_email_scenario.dart index 453a35197..e25319cf2 100644 --- a/integration_test/scenarios/composer/change_identity_in_draft_email_scenario.dart +++ b/integration_test/scenarios/composer/change_identity_in_draft_email_scenario.dart @@ -55,7 +55,7 @@ class ChangeIdentityInDraftEmailScenario extends BaseTestScenario { await composerRobot.addSubject(subject); await composerRobot.addContent(subject); - await composerRobot.tapRecipientExpandButton(); + await composerRobot.tapToRecipientExpandButton(); await $.pumpAndSettle(); await _expectIdentityVisible(identity1); @@ -81,7 +81,7 @@ class ChangeIdentityInDraftEmailScenario extends BaseTestScenario { await composerRobot.grantContactPermission(); - await composerRobot.tapRecipientExpandButton(); + await composerRobot.tapToRecipientExpandButton(); await $.pumpAndSettle(); await _expectIdentityVisible(identity2); } diff --git a/integration_test/scenarios/composer/show_full_recipient_fields_when_expand_all_scenario.dart b/integration_test/scenarios/composer/show_full_recipient_fields_when_expand_all_scenario.dart new file mode 100644 index 000000000..a0bb093a7 --- /dev/null +++ b/integration_test/scenarios/composer/show_full_recipient_fields_when_expand_all_scenario.dart @@ -0,0 +1,73 @@ +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 '../../base/base_test_scenario.dart'; +import '../../robots/composer_robot.dart'; +import '../../robots/thread_robot.dart'; + +class ShowFullRecipientFieldsWhenExpandAllScenario extends BaseTestScenario { + const ShowFullRecipientFieldsWhenExpandAllScenario(super.$); + + @override + Future runTestLogic() async { + const email = String.fromEnvironment('BASIC_AUTH_EMAIL'); + const subject = 'Show full recipient fields'; + + final threadRobot = ThreadRobot($); + final composerRobot = ComposerRobot($); + + await threadRobot.openComposer(); + await _expectComposerViewVisible(); + + await composerRobot.grantContactPermission(); + await $.pumpAndTrySettle(); + await composerRobot.tapToRecipientExpandButton(); + await _expectAllRecipientFieldsVisible(); + + await composerRobot.addRecipientIntoField( + prefixEmailAddress: PrefixEmailAddress.cc, + email: email, + ); + await composerRobot.addSubject(subject); + await _expectAllRecipientFieldsInvisible(); + await $.pumpAndTrySettle(); + + await composerRobot.expandRecipientsFields(); + await composerRobot.tapCcRecipientExpandButton(); + await _expectAllRecipientFieldsVisible(); + } + + Future _expectComposerViewVisible() => + expectViewVisible($(ComposerView)); + + Future _expectAllRecipientFieldsVisible() async { + await expectViewVisible( + $(#prefix_to_recipient_composer_widget), + ); + await expectViewVisible( + $(#prefix_cc_recipient_composer_widget), + ); + await expectViewVisible( + $(#prefix_bcc_recipient_composer_widget), + ); + await expectViewVisible( + $(#prefix_replyTo_recipient_composer_widget), + ); + } + + Future _expectAllRecipientFieldsInvisible() async { + await expectViewInvisible( + $(#prefix_to_recipient_composer_widget), + ); + await expectViewInvisible( + $(#prefix_cc_recipient_composer_widget), + ); + await expectViewInvisible( + $(#prefix_bcc_recipient_composer_widget), + ); + await expectViewInvisible( + $(#prefix_replyTo_recipient_composer_widget), + ); + } +} diff --git a/integration_test/tests/compose/change_identity_in_draft_email_test.dart b/integration_test/tests/composer/change_identity_in_draft_email_test.dart similarity index 100% rename from integration_test/tests/compose/change_identity_in_draft_email_test.dart rename to integration_test/tests/composer/change_identity_in_draft_email_test.dart diff --git a/integration_test/tests/compose/composer_upload_attachment_and_inline_image_test.dart b/integration_test/tests/composer/composer_upload_attachment_and_inline_image_test.dart similarity index 100% rename from integration_test/tests/compose/composer_upload_attachment_and_inline_image_test.dart rename to integration_test/tests/composer/composer_upload_attachment_and_inline_image_test.dart diff --git a/integration_test/tests/compose/forward_email_test.dart b/integration_test/tests/composer/forward_email_test.dart similarity index 100% rename from integration_test/tests/compose/forward_email_test.dart rename to integration_test/tests/composer/forward_email_test.dart diff --git a/integration_test/tests/compose/reply_email_with_content_contain_image_base64_data_test.dart b/integration_test/tests/composer/reply_email_with_content_contain_image_base64_data_test.dart similarity index 100% rename from integration_test/tests/compose/reply_email_with_content_contain_image_base64_data_test.dart rename to integration_test/tests/composer/reply_email_with_content_contain_image_base64_data_test.dart diff --git a/integration_test/tests/compose/reply_to_own_sent_email_test.dart b/integration_test/tests/composer/reply_to_own_sent_email_test.dart similarity index 100% rename from integration_test/tests/compose/reply_to_own_sent_email_test.dart rename to integration_test/tests/composer/reply_to_own_sent_email_test.dart diff --git a/integration_test/tests/compose/save_draft_then_close_composer_and_open_draft_test.dart b/integration_test/tests/composer/save_draft_then_close_composer_and_open_draft_test.dart similarity index 100% rename from integration_test/tests/compose/save_draft_then_close_composer_and_open_draft_test.dart rename to integration_test/tests/composer/save_draft_then_close_composer_and_open_draft_test.dart diff --git a/integration_test/tests/compose/send_email_test.dart b/integration_test/tests/composer/send_email_test.dart similarity index 100% rename from integration_test/tests/compose/send_email_test.dart rename to integration_test/tests/composer/send_email_test.dart diff --git a/integration_test/tests/compose/send_email_with_mark_as_important_test.dart b/integration_test/tests/composer/send_email_with_mark_as_important_test.dart similarity index 100% rename from integration_test/tests/compose/send_email_with_mark_as_important_test.dart rename to integration_test/tests/composer/send_email_with_mark_as_important_test.dart diff --git a/integration_test/tests/compose/send_email_with_read_receipt_enabled_test.dart b/integration_test/tests/composer/send_email_with_read_receipt_enabled_test.dart similarity index 100% rename from integration_test/tests/compose/send_email_with_read_receipt_enabled_test.dart rename to integration_test/tests/composer/send_email_with_read_receipt_enabled_test.dart diff --git a/integration_test/tests/composer/show_full_recipient_fields_when_expand_all_test.dart b/integration_test/tests/composer/show_full_recipient_fields_when_expand_all_test.dart new file mode 100644 index 000000000..82de559ce --- /dev/null +++ b/integration_test/tests/composer/show_full_recipient_fields_when_expand_all_test.dart @@ -0,0 +1,10 @@ +import '../../base/test_base.dart'; +import '../../scenarios/composer/show_full_recipient_fields_when_expand_all_scenario.dart'; + +void main() { + TestBase().runPatrolTest( + description: + 'Should see all recipient fields when expand all recipients in composer', + scenarioBuilder: ($) => ShowFullRecipientFieldsWhenExpandAllScenario($), + ); +} diff --git a/integration_test/tests/compose/update_draft_email_with_messsage_success_toast_test.dart b/integration_test/tests/composer/update_draft_email_with_messsage_success_toast_test.dart similarity index 100% rename from integration_test/tests/compose/update_draft_email_with_messsage_success_toast_test.dart rename to integration_test/tests/composer/update_draft_email_with_messsage_success_toast_test.dart