Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

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