* Add folder info when open mail list from Label (cherry picked from commit de0bb4ee02030ca90126766a8713a6826d791acd) * Add unit test for `hasMailboxLabel` function in BaseEmailItemTile mixin (cherry picked from commit 18f8d1847acccd6f95006b93903f0caa6c0408df) * TF-4292 Add E2E test for test case `Add folder info when open mail list from Label` on mobile (cherry picked from commit 1c209e333510db161522e4449ad7fb2e5d28399f)
This commit is contained in:
+57
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:labels/labels.dart';
|
||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_list_view.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../mixin/provisioning_label_scenario_mixin.dart';
|
||||
import '../../robots/label_robot.dart';
|
||||
import '../../robots/thread_robot.dart';
|
||||
|
||||
class DisplayFolderInfoWhenOpenMailFromTagScenario extends BaseTestScenario
|
||||
with ProvisioningLabelScenarioMixin {
|
||||
const DisplayFolderInfoWhenOpenMailFromTagScenario(super.$);
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||
if (emailUser.isEmpty) {
|
||||
fail('Missing --dart-define=BASIC_AUTH_EMAIL for this integration scenario');
|
||||
}
|
||||
|
||||
final threadRobot = ThreadRobot($);
|
||||
final labelRobot = LabelRobot($);
|
||||
|
||||
final labels = await provisionLabelsByDisplayNames(
|
||||
['Tag 1'],
|
||||
);
|
||||
await $.pumpAndSettle();
|
||||
expect(labels, isNotEmpty, reason: 'Provisioning label "Tag 1" failed');
|
||||
final newLabel = labels.first;
|
||||
|
||||
await provisionEmail(
|
||||
buildEmailsForLabel(
|
||||
label: newLabel,
|
||||
toEmail: emailUser,
|
||||
count: 2,
|
||||
),
|
||||
requestReadReceipt: false,
|
||||
folderLocationRole: PresentationMailbox.roleTrash,
|
||||
);
|
||||
await $.pumpAndSettle(duration: const Duration(seconds: 2));
|
||||
|
||||
await threadRobot.openMailbox();
|
||||
await _expectLabelListViewVisible();
|
||||
|
||||
await labelRobot.openLabelByName(newLabel.safeDisplayName);
|
||||
await _expectFolderInfoDisplayed();
|
||||
}
|
||||
|
||||
Future<void> _expectLabelListViewVisible() =>
|
||||
expectViewVisible($(LabelListView));
|
||||
|
||||
Future<void> _expectFolderInfoDisplayed() async {
|
||||
await expectViewVisible($(AppLocalizations().trashMailboxDisplayName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import '../../base/test_base.dart';
|
||||
import '../../scenarios/labels/display_folder_info_when_open_mail_from_tag_scenario.dart';
|
||||
|
||||
void main() {
|
||||
TestBase().runPatrolTest(
|
||||
description: 'Should display folder info when open mail list from tag',
|
||||
scenarioBuilder: ($) => DisplayFolderInfoWhenOpenMailFromTagScenario($),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user