You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

94 lines
3.6 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 Full Form").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", () => {
  16. cy.visit("/app/todo");
  17. cy.click_listview_row_item_with_text("Test ToDo");
  18. //Creating a new email
  19. cy.get(".timeline-actions > .timeline-item > .action-buttons > .action-btn").click();
  20. cy.fill_field("recipients", "test@example.com", "MultiSelect");
  21. cy.get(
  22. '.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'
  23. ).type("Test Mail");
  24. //Adding attachment to the email
  25. cy.get(".add-more-attachments > .btn").click();
  26. cy.get(".mt-2 > .btn > .mt-1").eq(2).click();
  27. cy.get(".input-group > .form-control").type(
  28. "https://wallpaperplay.com/walls/full/8/2/b/72402.jpg"
  29. );
  30. cy.get(".btn-primary").contains("Upload").click();
  31. //Sending the email
  32. cy.click_modal_primary_button("Send", { delay: 500 });
  33. //To check if the sent mail content is shown in the timeline content
  34. cy.get('[data-doctype="Communication"] > .timeline-content').should(
  35. "contain",
  36. "Test Mail"
  37. );
  38. //To check if the attachment of email is shown in the timeline content
  39. cy.get(".timeline-content").should("contain", "Added 72402.jpg");
  40. //Deleting the sent email
  41. cy.get('[title="Open Communication"] > .icon').first().click({ force: true });
  42. cy.get(
  43. "#page-Communication > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .btn"
  44. ).click();
  45. cy.get(
  46. "#page-Communication > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .dropdown-menu > li > .grey-link"
  47. )
  48. .eq(9)
  49. .click();
  50. cy.get(
  51. ".modal.show > .modal-dialog > .modal-content > .modal-footer > .standard-actions > .btn-primary"
  52. ).click();
  53. });
  54. it("Deleting attachment and ToDo", () => {
  55. cy.visit("/app/todo");
  56. cy.click_listview_row_item_with_text("Test ToDo");
  57. //Removing the added attachment
  58. cy.get(".attachment-row > .data-pill > .remove-btn > .icon").click();
  59. cy.wait(500);
  60. cy.get(".modal-footer:visible > .standard-actions > .btn-primary").contains("Yes").click();
  61. //To check if the removed attachment is shown in the timeline content
  62. cy.get(".timeline-content").should("contain", "Removed 72402.jpg");
  63. cy.wait(500);
  64. //To check if the discard button functionality in email is working correctly
  65. cy.get(".timeline-actions > .timeline-item > .action-buttons > .action-btn").click();
  66. cy.fill_field("recipients", "test@example.com", "MultiSelect");
  67. cy.get(".modal-footer > .standard-actions > .btn-secondary").contains("Discard").click();
  68. cy.wait(500);
  69. cy.get(".timeline-actions > .timeline-item > .action-buttons > .action-btn").click();
  70. cy.wait(500);
  71. cy.get_field("recipients", "MultiSelect").should("have.text", "");
  72. cy.get(".modal-header:visible > .modal-actions > .btn-modal-close > .icon").click();
  73. //Deleting the added ToDo
  74. cy.get(".menu-btn-group:visible > .btn").click();
  75. cy.get(".menu-btn-group:visible > .dropdown-menu > li > .dropdown-item")
  76. .contains("Delete")
  77. .click();
  78. cy.get(".modal-footer:visible > .standard-actions > .btn-primary").click();
  79. });
  80. });