-
Notifications
You must be signed in to change notification settings - Fork 87
TF-3611 E2E Trash & spam empty and recover #3612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tddang-linagora
wants to merge
5
commits into
patrol-integration-test
Choose a base branch
from
integration-test/TF-3611-trash-spam-empty-recover
base: patrol-integration-test
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+408
−3
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8769579
TF-3611 E2E Add docker config for recover emails
tddang-linagora 74b98ef
TF-3611 E2E Trash mailbox empty and recover
tddang-linagora 0032c0c
TF-3611 E2E Spam mailbox empty and recover
tddang-linagora 0d2a064
TF-3611 E2E Long press trash empty and recover
tddang-linagora 8d57dbd
TF-3611 E2E Long press spam empty and recover
tddang-linagora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# ============================================= Deleted Messages Vault Configuration ================================== | ||
|
||
enabled=true | ||
restoreLocation=Restored-Messages | ||
|
||
# Retention period for your deleted messages into the vault, after which they expire and can be potentially cleaned up | ||
# Optional, default 1y | ||
# retentionPeriod=1y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
|
||
<listeners> | ||
<preDeletionHook> | ||
<class>org.apache.james.vault.DeletedMessageVaultHook</class> | ||
</preDeletionHook> | ||
</listeners> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
integration_test/scenarios/mailbox/empty_and_recover_spam_scenario.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:model/mailbox/presentation_mailbox.dart'; | ||
import 'package:tmail_ui_user/features/thread/presentation/widgets/banner_delete_all_spam_emails_widget.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 EmptyAndRecoverSpamScenario extends BaseTestScenario { | ||
const EmptyAndRecoverSpamScenario(super.$); | ||
|
||
@override | ||
Future<void> runTestLogic() async { | ||
const toEmail = String.fromEnvironment('BASIC_AUTH_EMAIL'); | ||
const subject = 'spam and recover'; | ||
|
||
final threadRobot = ThreadRobot($); | ||
final mailboxMenuRobot = MailboxMenuRobot($); | ||
final appLocalizations = AppLocalizations(); | ||
|
||
await provisionEmail( | ||
[ProvisioningEmail( | ||
toEmail: toEmail, | ||
subject: subject, | ||
content: '', | ||
)], | ||
sentLocation: PresentationMailbox.roleJunk, | ||
); | ||
|
||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.openFolderByName( | ||
appLocalizations.spamMailboxDisplayName, | ||
); | ||
await threadRobot.tapEmptySpamBanner(); | ||
await threadRobot.confirmEmptySpam(); | ||
await _expectSpamBannerInvisible(); | ||
|
||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.longPressMailboxWithName( | ||
appLocalizations.trashMailboxDisplayName, | ||
); | ||
await mailboxMenuRobot.tapRecoverDeletedMessages(); | ||
await mailboxMenuRobot.tapConfirmRecoverDeletedMessages(); | ||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.openFolderByName( | ||
appLocalizations.recoveredMailboxDisplayName, | ||
); | ||
await _expectEmailWithSubjectVisible(subject); | ||
} | ||
|
||
Future<void> _expectSpamBannerInvisible() async { | ||
await $(#spam_banner_not_visible).waitUntilExists(); | ||
expect($(BannerDeleteAllSpamEmailsWidget).visible, false); | ||
} | ||
|
||
Future<void> _expectEmailWithSubjectVisible(String subject) async { | ||
await expectViewVisible($(subject)); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
integration_test/scenarios/mailbox/empty_and_recover_trash_scenario.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:model/mailbox/presentation_mailbox.dart'; | ||
import 'package:tmail_ui_user/features/thread/presentation/widgets/banner_empty_trash_widget.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 EmptyAndRecoverTrashScenario extends BaseTestScenario { | ||
const EmptyAndRecoverTrashScenario(super.$); | ||
|
||
@override | ||
Future<void> runTestLogic() async { | ||
const toEmail = String.fromEnvironment('BASIC_AUTH_EMAIL'); | ||
const subject = 'trash and recover'; | ||
|
||
final threadRobot = ThreadRobot($); | ||
final mailboxMenuRobot = MailboxMenuRobot($); | ||
final appLocalizations = AppLocalizations(); | ||
|
||
await provisionEmail( | ||
[ProvisioningEmail( | ||
toEmail: toEmail, | ||
subject: subject, | ||
content: '', | ||
)], | ||
sentLocation: PresentationMailbox.roleTrash, | ||
); | ||
|
||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.openFolderByName( | ||
appLocalizations.trashMailboxDisplayName, | ||
); | ||
await threadRobot.tapEmptyTrashBanner(); | ||
await threadRobot.confirmEmptyTrash(); | ||
await _expectTrashBannerInvisible(); | ||
|
||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.longPressMailboxWithName( | ||
appLocalizations.trashMailboxDisplayName, | ||
); | ||
await mailboxMenuRobot.tapRecoverDeletedMessages(); | ||
await mailboxMenuRobot.tapConfirmRecoverDeletedMessages(); | ||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.openFolderByName( | ||
appLocalizations.recoveredMailboxDisplayName, | ||
); | ||
await _expectEmailWithSubjectVisible(subject); | ||
} | ||
|
||
Future<void> _expectTrashBannerInvisible() async { | ||
await $(#trash_banner_not_visible).waitUntilExists(); | ||
expect($(BannerEmptyTrashWidget).visible, false); | ||
} | ||
|
||
Future<void> _expectEmailWithSubjectVisible(String subject) async { | ||
await expectViewVisible($(subject)); | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
integration_test/scenarios/mailbox/long_press_empty_and_recover_spam_scenario.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:model/mailbox/presentation_mailbox.dart'; | ||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/trailing_mailbox_item_widget.dart'; | ||
import 'package:tmail_ui_user/features/thread/presentation/widgets/banner_delete_all_spam_emails_widget.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 LongPressEmptyAndRecoverSpamScenario extends BaseTestScenario { | ||
const LongPressEmptyAndRecoverSpamScenario(super.$); | ||
|
||
@override | ||
Future<void> runTestLogic() async { | ||
const toEmail = String.fromEnvironment('BASIC_AUTH_EMAIL'); | ||
const subject = 'long press spam'; | ||
|
||
final threadRobot = ThreadRobot($); | ||
final mailboxMenuRobot = MailboxMenuRobot($); | ||
final appLocalizations = AppLocalizations(); | ||
|
||
await provisionEmail( | ||
[ProvisioningEmail( | ||
toEmail: toEmail, | ||
subject: subject, | ||
content: '', | ||
)], | ||
sentLocation: PresentationMailbox.roleJunk, | ||
); | ||
|
||
await threadRobot.openMailbox(); | ||
await _expectMailboxWithNameHaveCountVisible( | ||
appLocalizations.spamMailboxDisplayName, | ||
); | ||
await mailboxMenuRobot.longPressMailboxWithName( | ||
appLocalizations.spamMailboxDisplayName, | ||
); | ||
await threadRobot.tapEmptySpamAfterLongPress(); | ||
await threadRobot.confirmEmptySpam(); | ||
_expectMailboxWithNameHaveCountInvisible( | ||
appLocalizations.spamMailboxDisplayName, | ||
); | ||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.openFolderByName( | ||
appLocalizations.spamMailboxDisplayName, | ||
); | ||
await _expectSpamBannerInvisible(); | ||
|
||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.longPressMailboxWithName( | ||
appLocalizations.trashMailboxDisplayName, | ||
); | ||
await mailboxMenuRobot.tapRecoverDeletedMessages(); | ||
await mailboxMenuRobot.tapConfirmRecoverDeletedMessages(); | ||
await threadRobot.openMailbox(); | ||
await mailboxMenuRobot.openFolderByName( | ||
appLocalizations.recoveredMailboxDisplayName, | ||
); | ||
await _expectEmailWithSubjectVisible(subject); | ||
} | ||
|
||
Future<void> _expectSpamBannerInvisible() async { | ||
await $(#spam_banner_not_visible).waitUntilExists(); | ||
expect($(BannerDeleteAllSpamEmailsWidget).visible, false); | ||
} | ||
|
||
Future<void> _expectEmailWithSubjectVisible(String subject) async { | ||
await expectViewVisible($(subject)); | ||
} | ||
|
||
Future<void> _expectMailboxWithNameHaveCountVisible(String name) async { | ||
await expectViewVisible( | ||
$(TrailingMailboxItemWidget) | ||
.which<TrailingMailboxItemWidget>((widget) { | ||
return widget.mailboxNode.item.name?.name.toLowerCase() == name.toLowerCase(); | ||
}) | ||
); | ||
} | ||
|
||
void _expectMailboxWithNameHaveCountInvisible(String name) { | ||
expect( | ||
$(TrailingMailboxItemWidget) | ||
.which<TrailingMailboxItemWidget>((widget) { | ||
return widget.mailboxNode.item.name?.name.toLowerCase() == name.toLowerCase(); | ||
}) | ||
.visible, | ||
false, | ||
); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to wait for permission here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.