Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

96 lignes
3.9 KiB

  1. import custom_submittable_doctype from '../fixtures/custom_submittable_doctype';
  2. context('Timeline', () => {
  3. before(() => {
  4. cy.visit('/login');
  5. cy.login();
  6. });
  7. it('Adding new ToDo, adding new comment, verifying comment addition & deletion and deleting ToDo', () => {
  8. //Adding new ToDo
  9. cy.visit('/app/todo');
  10. cy.click_listview_primary_button('Add ToDo');
  11. cy.findByRole('button', {name: 'Edit in full page'}).click();
  12. cy.findByTitle('New ToDo').should('be.visible');
  13. cy.get('[data-fieldname="description"] .ql-editor').eq(0).type('Test ToDo', {force: true});
  14. cy.wait(200);
  15. cy.findByRole('button', {name: 'Save'}).click();
  16. cy.wait(700);
  17. cy.visit('/app/todo');
  18. cy.get('.level-item.ellipsis').eq(0).click();
  19. //To check if the comment box is initially empty and tying some text into it
  20. cy.get('[data-fieldname="comment"] .ql-editor').should('contain', '').type('Testing Timeline');
  21. //Adding new comment
  22. cy.findByRole('button', {name: 'Comment'}).click();
  23. //To check if the commented text is visible in the timeline content
  24. cy.get('.timeline-content').should('contain', 'Testing Timeline');
  25. //Editing comment
  26. cy.click_timeline_action_btn("Edit");
  27. cy.get('.timeline-content [data-fieldname="comment"] .ql-editor').first().type(' 123');
  28. cy.click_timeline_action_btn("Save");
  29. //To check if the edited comment text is visible in timeline content
  30. cy.get('.timeline-content').should('contain', 'Testing Timeline 123');
  31. //Discarding comment
  32. cy.click_timeline_action_btn("Edit");
  33. cy.findByRole('button', {name: 'Dismiss'}).click();
  34. //To check if after discarding the timeline content is same as previous
  35. cy.get('.timeline-content').should('contain', 'Testing Timeline 123');
  36. //Deleting the added comment
  37. cy.get('.more-actions > .action-btn').click();
  38. cy.get('.more-actions .dropdown-item').contains('Delete').click();
  39. cy.findByRole('button', {name: 'Yes'}).click();
  40. cy.click_modal_primary_button('Yes');
  41. //Deleting the added ToDo
  42. cy.get('[id="page-ToDo"] .menu-btn-group [data-original-title="Menu"]').click();
  43. cy.get('[id="page-ToDo"] .menu-btn-group .dropdown-item').contains('Delete').click();
  44. cy.findByRole('button', {name: 'Yes'}).click();
  45. });
  46. it('Timeline should have submit and cancel activity information', () => {
  47. cy.visit('/app/doctype');
  48. //Creating custom doctype
  49. cy.insert_doc('DocType', custom_submittable_doctype, true);
  50. cy.visit('/app/custom-submittable-doctype');
  51. cy.click_listview_primary_button('Add Custom Submittable DocType');
  52. //Adding a new entry for the created custom doctype
  53. cy.fill_field('title', 'Test');
  54. cy.findByRole('button', {name: 'Save'}).click();
  55. cy.findByRole('button', {name: 'Submit'}).click();
  56. cy.visit('/app/custom-submittable-doctype');
  57. cy.get('.list-subject > .bold > .ellipsis').eq(0).click();
  58. //To check if the submission of the documemt is visible in the timeline content
  59. cy.get('.timeline-content').should('contain', 'Administrator submitted this document');
  60. cy.findByRole('button', {name: 'Cancel'}).click({delay: 900});
  61. cy.findByRole('button', {name: 'Yes'}).click();
  62. //To check if the cancellation of the documemt is visible in the timeline content
  63. cy.get('.timeline-content').should('contain', 'Administrator cancelled this document');
  64. //Deleting the document
  65. cy.visit('/app/custom-submittable-doctype');
  66. cy.get('.list-subject > .select-like > .list-row-checkbox').eq(0).click();
  67. cy.findByRole('button', {name: 'Actions'}).click();
  68. cy.get('.actions-btn-group > .dropdown-menu > li > .dropdown-item').contains("Delete").click();
  69. cy.click_modal_primary_button('Yes', {force: true, delay: 700});
  70. //Deleting the custom doctype
  71. cy.visit('/app/doctype');
  72. cy.get('.list-subject > .select-like > .list-row-checkbox').eq(0).click();
  73. cy.findByRole('button', {name: 'Actions'}).click();
  74. cy.get('.actions-btn-group [data-label="Delete"]').click();
  75. cy.click_modal_primary_button('Yes');
  76. });
  77. });