- 
                Notifications
    
You must be signed in to change notification settings  - Fork 103
 
TF-4053 Move all emails #4132
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
      
      
            dab246
  wants to merge
  7
  commits into
  master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
enhancement/tf-4053-move-all-emails
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
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.
          
          
  
     Open
                    TF-4053 Move all emails #4132
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            7 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4512c9b
              
                TF-4053 Add `Move folder content` action in mailbox content menu
              
              
                dab246 7293156
              
                TF-4053 Add interactor/datasource/repository for move folder content β¦
              
              
                dab246 9cd067b
              
                TF-4053 Remove method is not used
              
              
                dab246 46e155d
              
                TF-4053 Implement move folder content on mailbox list view
              
              
                dab246 6cd4c82
              
                TF-4053 Implement move folder content on mailbox search view
              
              
                dab246 5ad006b
              
                TF-4053 Add E2E test for test case move folder content
              
              
                dab246 c922694
              
                TF-4053 Verify `empty widget` in Inbox when perform E2E for move foldβ¦
              
              
                dab246 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
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      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
    
  
  
    
              
        
          
          
            78 changes: 78 additions & 0 deletions
          
          78 
        
  integration_test/scenarios/mailbox/move_folder_content_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,78 @@ | ||
| import 'package:flutter_test/flutter_test.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 MoveFolderContentScenario extends BaseTestScenario { | ||
| const MoveFolderContentScenario(super.$); | ||
| 
     | 
||
| @override | ||
| Future<void> runTestLogic() async { | ||
| const email = String.fromEnvironment('BASIC_AUTH_EMAIL'); | ||
| const emailSubject = 'Move folder content'; | ||
| 
     | 
||
| final threadRobot = ThreadRobot($); | ||
| final mailboxMenuRobot = MailboxMenuRobot($); | ||
| final appLocalizations = AppLocalizations(); | ||
| 
     | 
||
| final listEmails = List.generate( | ||
| 40, | ||
| (_) => ProvisioningEmail( | ||
| toEmail: email, | ||
| subject: emailSubject, | ||
| content: '', | ||
| ), | ||
| ); | ||
| 
     | 
||
| await provisionEmail(listEmails); | ||
| await $.pumpAndTrySettle(duration: const Duration(seconds: 2)); | ||
| await _expectEmptyViewInVisibleInInboxFolder(); | ||
| 
     | 
||
| await threadRobot.openMailbox(); | ||
| await $.pumpAndTrySettle(); | ||
| 
     | 
||
| await mailboxMenuRobot.longPressMailboxWithName( | ||
| appLocalizations.inboxMailboxDisplayName, | ||
| ); | ||
| await mailboxMenuRobot.tapMoveFolderContentAction( | ||
| appLocalizations.templatesMailboxDisplayName, | ||
| ); | ||
| await $.pumpAndTrySettle(duration: const Duration(seconds: 3)); | ||
| 
     | 
||
| await threadRobot.openMailbox(); | ||
| await $.pumpAndTrySettle(); | ||
| await mailboxMenuRobot.openFolderByName( | ||
| appLocalizations.templatesMailboxDisplayName, | ||
| ); | ||
| await $.pumpAndTrySettle(); | ||
| await _expectEmailWithSubjectVisible(emailSubject); | ||
| 
     | 
||
| await threadRobot.openMailbox(); | ||
| await $.pumpAndTrySettle(); | ||
| await mailboxMenuRobot.openFolderByName( | ||
| appLocalizations.inboxMailboxDisplayName, | ||
| ); | ||
| await $.pumpAndTrySettle(); | ||
| await _expectEmailWithSubjectInVisible(emailSubject); | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about verify also  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just need to verify if the widget is displayed. I have updated the E2E expect. π§ͺ Should see all Inbox emails in the Templates folder when perform move folder content action successfully
        β
   1. waitUntilVisible widgets with type "TwakeWelcomeView".
        β
   2. tap widgets with text "Use company server".
        β
   3. waitUntilVisible widgets with type "LoginView".
        β
   4. tap widgets with type "TextField" descending from widgets with key [<'dns_lookup_input_form'>].
        β
   5. enterText widgets with type "TextField" descending from widgets with key [<'dns_lookup_input_form'>].
        β
   6. waitUntilVisible widgets with text "bob".
        β
   7. tap widgets with text "Next".
        β
   8. waitUntilVisible widgets with key [<'base_url_form'>] descending from widgets with type "LoginView".
        β
   9. enterText widgets with type "TextField" descending from widgets with key [<'base_url_form'>].
        β
  10. waitUntilVisible widgets with text containing 016e14f5ac71.ngrok-free.app.
        β
  11. tap widgets with text "Next".
        β
  12. waitUntilVisible widgets with key [<'credential_input_form'>] descending from widgets with type "LoginView".
        β
  13. enterText widgets with type "TextField" descending from widgets with key [<'login_username_input'>].
        β
  14. waitUntilVisible widgets with text "bob@example.com".
β
 Should see all Inbox emails in the Templates folder when perform move folder content action successfully (integration_test/tests/mailbox/move_folder_content_test.dart) (25s)
Test summary:
π Total: 1
β
 Successful: 1
β Failed: 0
β© Skipped: 0
π Report: file:///Users/datvu/WorkingSpace/tmail-flutter/build/app/reports/androidTests/connected/index.html
β±οΈ  Duration: 91s | 
||
| await _expectEmptyViewVisibleInInboxFolder(); | ||
| } | ||
| 
     | 
||
| Future<void> _expectEmailWithSubjectVisible(String subject) async { | ||
| await expectViewVisible($(subject)); | ||
| } | ||
| 
     | 
||
| Future<void> _expectEmailWithSubjectInVisible(String subject) async { | ||
| await expectViewInvisible($(subject)); | ||
| } | ||
| 
     | 
||
| Future<void> _expectEmptyViewVisibleInInboxFolder() async { | ||
| await expectViewVisible($(#empty_thread_view)); | ||
| } | ||
| 
     | 
||
| Future<void> _expectEmptyViewInVisibleInInboxFolder() async { | ||
| await expectViewInvisible($(#empty_thread_view)); | ||
| } | ||
| } | ||
  
    
      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,9 @@ | ||
| import '../../base/test_base.dart'; | ||
| import '../../scenarios/mailbox/move_folder_content_scenario.dart'; | ||
| 
     | 
||
| void main() { | ||
| TestBase().runPatrolTest( | ||
| description: 'Should see all Inbox emails in the Templates folder when perform move folder content action successfully', | ||
| scenarioBuilder: ($) => MoveFolderContentScenario($), | ||
| ); | ||
| } | 
  
    
      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
    
  
  
    
              
      
      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.
do we have other emails in
Inbox?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.
It is possible if we run multiple tests simultaneously.