您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

75 行
3.5 KiB

  1. context('Timeline Email', () => {
  2. before(() => {
  3. cy.visit('/login');
  4. cy.login();
  5. cy.visit('/app/todo');
  6. });
  7. it('Adding new ToDo', () => {
  8. cy.click_listview_primary_button('Add ToDo');
  9. cy.get('.custom-actions:visible > .btn').contains("Edit in full page").click({delay: 500});
  10. cy.fill_field("description", "Test ToDo", "Text Editor");
  11. cy.wait(500);
  12. cy.get('.primary-action').contains('Save').click({force: true});
  13. cy.wait(700);
  14. });
  15. it('Adding email and verifying timeline content for email attachment, deleting attachment and ToDo', () => {
  16. cy.visit('/app/todo');
  17. cy.get('.list-row > .level-left > .list-subject').eq(0).click();
  18. //Creating a new email
  19. cy.get('.timeline-actions > .btn').click();
  20. cy.fill_field('recipients', 'test@example.com', 'MultiSelect');
  21. cy.get('.modal.show > .modal-dialog > .modal-content > .modal-body > :nth-child(1) > .form-layout > .form-page > :nth-child(3) > .section-body > .form-column > form > [data-fieldtype="Text Editor"] > .form-group > .control-input-wrapper > .control-input > .ql-container > .ql-editor').type('Test Mail');
  22. //Adding attachment to the email
  23. cy.get('.add-more-attachments > .btn').click();
  24. cy.get('.mt-2 > .btn > .mt-1').eq(2).click();
  25. cy.get('.input-group > .form-control').type('https://wallpaperplay.com/walls/full/8/2/b/72402.jpg');
  26. cy.get('.btn-primary').contains('Upload').click();
  27. //Sending the email
  28. cy.click_modal_primary_button('Send', {delay: 500});
  29. //To check if the sent mail content is shown in the timeline content
  30. cy.get('[data-doctype="Communication"] > .timeline-content').should('contain', 'Test Mail');
  31. //To check if the attachment of email is shown in the timeline content
  32. cy.get('.timeline-content').should('contain', 'Added 72402.jpg');
  33. //Deleting the sent email
  34. cy.get('[title="Open Communication"] > .icon').first().click({force: true});
  35. cy.get('#page-Communication > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .btn').click();
  36. cy.get('#page-Communication > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .dropdown-menu > li > .grey-link').eq(9).click();
  37. cy.get('.modal.show > .modal-dialog > .modal-content > .modal-footer > .standard-actions > .btn-primary').click();
  38. cy.visit('/app/todo');
  39. cy.get('.list-row > .level-left > .list-subject > .level-item.ellipsis > .ellipsis').eq(0).click();
  40. //Removing the added attachment
  41. cy.get('.attachment-row > .data-pill > .remove-btn > .icon').click();
  42. cy.wait(500);
  43. cy.get('.modal-footer:visible > .standard-actions > .btn-primary').contains('Yes').click();
  44. //To check if the removed attachment is shown in the timeline content
  45. cy.get('.timeline-content').should('contain', 'Removed 72402.jpg');
  46. cy.wait(500);
  47. //To check if the discard button functionality in email is working correctly
  48. cy.get('.timeline-actions > .btn').click();
  49. cy.fill_field('recipients', 'test@example.com', 'MultiSelect');
  50. cy.get('.modal-footer > .standard-actions > .btn-secondary').contains('Discard').click();
  51. cy.wait(500);
  52. cy.get('.timeline-actions > .btn').click();
  53. cy.wait(500);
  54. cy.get_field('recipients', 'MultiSelect').should('have.text', '');
  55. cy.get('.modal-header:visible > .modal-actions > .btn-modal-close > .icon').click();
  56. //Deleting the added ToDo
  57. cy.get('.menu-btn-group:visible > .btn').click();
  58. cy.get('.menu-btn-group:visible > .dropdown-menu > li > .dropdown-item').contains('Delete').click();
  59. cy.get('.modal-footer:visible > .standard-actions > .btn-primary').click();
  60. });
  61. });