TF-3569 E2E Mailbox toggle read/star/spam
This commit is contained in:
@@ -127,4 +127,23 @@ class ThreadRobot extends CoreRobot {
|
|||||||
await $(#moveToTrash_selected_email_button).tap();
|
await $(#moveToTrash_selected_email_button).tap();
|
||||||
await $.pumpAndTrySettle();
|
await $.pumpAndTrySettle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> tapMarkAsReadButton() async {
|
||||||
|
await $(#markAsRead_selected_email_button).tap();
|
||||||
|
await $.pumpAndTrySettle();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> tapMarkAsStarAction() async {
|
||||||
|
await $(#moreAction_selected_email_button).tap();
|
||||||
|
await $.pumpAndTrySettle();
|
||||||
|
await $(#markAsStarred_action).tap();
|
||||||
|
await $.pumpAndTrySettle();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> tapMarkAsSpamAction() async {
|
||||||
|
await $(#moreAction_selected_email_button).tap();
|
||||||
|
await $.pumpAndTrySettle();
|
||||||
|
await $(#moveToSpam_action).tap();
|
||||||
|
await $.pumpAndTrySettle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import 'package:tmail_ui_user/features/thread/presentation/widgets/email_tile_builder.dart';
|
||||||
|
|
||||||
|
import '../../base/base_test_scenario.dart';
|
||||||
|
import '../../models/provisioning_email.dart';
|
||||||
|
import '../../robots/thread_robot.dart';
|
||||||
|
|
||||||
|
class MarkSingleSelectedEmailAsReadScenario extends BaseTestScenario {
|
||||||
|
const MarkSingleSelectedEmailAsReadScenario(super.$);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> runTestLogic() async {
|
||||||
|
const email = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||||
|
const readSubject = 'single selected read';
|
||||||
|
|
||||||
|
final threadRobot = ThreadRobot($);
|
||||||
|
|
||||||
|
await provisionEmail([
|
||||||
|
ProvisioningEmail(toEmail: email, subject: readSubject, content: ''),
|
||||||
|
]);
|
||||||
|
await $.pumpAndSettle(duration: const Duration(seconds: 2));
|
||||||
|
|
||||||
|
await threadRobot.longPressEmailWithSubject(readSubject);
|
||||||
|
await threadRobot.tapMarkAsReadButton();
|
||||||
|
await _expectEmailWithSubjectIsRead(readSubject);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _expectEmailWithSubjectIsRead(String subject) async {
|
||||||
|
await expectViewVisible($(EmailTileBuilder).which<EmailTileBuilder>(
|
||||||
|
(widget) => widget.presentationEmail.subject == subject
|
||||||
|
&& widget.presentationEmail.hasRead
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import 'package:tmail_ui_user/features/thread/presentation/widgets/email_tile_builder.dart';
|
||||||
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
|
import '../../base/base_test_scenario.dart';
|
||||||
|
import '../../models/provisioning_email.dart';
|
||||||
|
import '../../robots/mailbox_menu_robot.dart';
|
||||||
|
import '../../robots/thread_robot.dart';
|
||||||
|
|
||||||
|
class MarkSingleSelectedEmailAsSpamScenario extends BaseTestScenario {
|
||||||
|
const MarkSingleSelectedEmailAsSpamScenario(super.$);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> runTestLogic() async {
|
||||||
|
const email = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||||
|
const spamSubject = 'single selected spam';
|
||||||
|
|
||||||
|
final threadRobot = ThreadRobot($);
|
||||||
|
final mailboxMenuRobot = MailboxMenuRobot($);
|
||||||
|
|
||||||
|
await provisionEmail([
|
||||||
|
ProvisioningEmail(toEmail: email, subject: spamSubject, content: ''),
|
||||||
|
]);
|
||||||
|
await $.pumpAndSettle(duration: const Duration(seconds: 2));
|
||||||
|
|
||||||
|
await threadRobot.longPressEmailWithSubject(spamSubject);
|
||||||
|
await threadRobot.tapMarkAsSpamAction();
|
||||||
|
await threadRobot.openMailbox();
|
||||||
|
await mailboxMenuRobot.openFolderByName(
|
||||||
|
AppLocalizations().spamMailboxDisplayName,
|
||||||
|
);
|
||||||
|
await _expectEmailWithSubjectExist(spamSubject);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _expectEmailWithSubjectExist(String subject) async {
|
||||||
|
await expectViewVisible($(EmailTileBuilder).which<EmailTileBuilder>(
|
||||||
|
(widget) => widget.presentationEmail.subject == subject
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import 'package:tmail_ui_user/features/thread/presentation/widgets/email_tile_builder.dart';
|
||||||
|
|
||||||
|
import '../../base/base_test_scenario.dart';
|
||||||
|
import '../../models/provisioning_email.dart';
|
||||||
|
import '../../robots/thread_robot.dart';
|
||||||
|
|
||||||
|
class MarkSingleSelectedEmailAsStarScenario extends BaseTestScenario {
|
||||||
|
const MarkSingleSelectedEmailAsStarScenario(super.$);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> runTestLogic() async {
|
||||||
|
const email = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||||
|
const starSubject = 'single selected star';
|
||||||
|
|
||||||
|
final threadRobot = ThreadRobot($);
|
||||||
|
|
||||||
|
await provisionEmail([
|
||||||
|
ProvisioningEmail(toEmail: email, subject: starSubject, content: ''),
|
||||||
|
]);
|
||||||
|
await $.pumpAndSettle(duration: const Duration(seconds: 2));
|
||||||
|
|
||||||
|
await threadRobot.longPressEmailWithSubject(starSubject);
|
||||||
|
await threadRobot.tapMarkAsStarAction();
|
||||||
|
await _expectEmailWithSubjectIsStarred(starSubject);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _expectEmailWithSubjectIsStarred(String subject) async {
|
||||||
|
await expectViewVisible($(EmailTileBuilder).which<EmailTileBuilder>(
|
||||||
|
(widget) => widget.presentationEmail.subject == subject
|
||||||
|
&& widget.presentationEmail.hasStarred
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import '../../base/test_base.dart';
|
||||||
|
import '../../scenarios/mailbox/mark_single_selected_email_as_read_scenario.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
TestBase().runPatrolTest(
|
||||||
|
description: 'Should see selected email mark as read successfully',
|
||||||
|
scenarioBuilder: ($) => MarkSingleSelectedEmailAsReadScenario($),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import '../../base/test_base.dart';
|
||||||
|
import '../../scenarios/mailbox/mark_single_selected_email_as_spam_scenario.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
TestBase().runPatrolTest(
|
||||||
|
description: 'Should see selected email mark as spam successfully',
|
||||||
|
scenarioBuilder: ($) => MarkSingleSelectedEmailAsSpamScenario($),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import '../../base/test_base.dart';
|
||||||
|
import '../../scenarios/mailbox/mark_single_selected_email_as_star_scenario.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
TestBase().runPatrolTest(
|
||||||
|
description: 'Should see selected email mark as star successfully',
|
||||||
|
scenarioBuilder: ($) => MarkSingleSelectedEmailAsStarScenario($),
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user