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.

timeline.js 3.6 KiB

il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/new-todo-1');
  10. cy.get('[data-fieldname="description"] .ql-editor.ql-blank').type('Test ToDo', {force: true}).wait(200);
  11. cy.get('.page-head .page-actions').findByRole('button', {name: 'Save'}).click();
  12. cy.visit('/app/todo');
  13. cy.click_listview_row_item(0);
  14. //To check if the comment box is initially empty and tying some text into it
  15. cy.get('[data-fieldname="comment"] .ql-editor').should('contain', '').type('Testing Timeline');
  16. //Adding new comment
  17. cy.get('.comment-box').findByRole('button', {name: 'Comment'}).click();
  18. //To check if the commented text is visible in the timeline content
  19. cy.get('.timeline-content').should('contain', 'Testing Timeline');
  20. //Editing comment
  21. cy.click_timeline_action_btn("Edit");
  22. cy.get('.timeline-content [data-fieldname="comment"] .ql-editor').first().type(' 123');
  23. cy.click_timeline_action_btn("Save");
  24. //To check if the edited comment text is visible in timeline content
  25. cy.get('.timeline-content').should('contain', 'Testing Timeline 123');
  26. //Discarding comment
  27. cy.click_timeline_action_btn("Edit");
  28. cy.click_timeline_action_btn("Dismiss");
  29. //To check if after discarding the timeline content is same as previous
  30. cy.get('.timeline-content').should('contain', 'Testing Timeline 123');
  31. //Deleting the added comment
  32. cy.get('.timeline-message-box .more-actions > .action-btn').click(); //Menu button in timeline item
  33. cy.get('.timeline-message-box .more-actions .dropdown-item').contains('Delete').click({ force: true });
  34. cy.get_open_dialog().findByRole('button', {name: 'Yes'}).click({ force: true });
  35. cy.get('.timeline-content').should('not.contain', 'Testing Timeline 123');
  36. });
  37. it('Timeline should have submit and cancel activity information', () => {
  38. cy.visit('/app/doctype');
  39. //Creating custom doctype
  40. cy.insert_doc('DocType', custom_submittable_doctype, true);
  41. cy.visit('/app/custom-submittable-doctype');
  42. cy.click_listview_primary_button('Add Custom Submittable DocType');
  43. //Adding a new entry for the created custom doctype
  44. cy.fill_field('title', 'Test');
  45. cy.click_modal_primary_button('Save');
  46. cy.click_modal_primary_button('Submit');
  47. cy.visit('/app/custom-submittable-doctype');
  48. cy.click_listview_row_item(0);
  49. //To check if the submission of the documemt is visible in the timeline content
  50. cy.get('.timeline-content').should('contain', 'Administrator submitted this document');
  51. cy.get('[id="page-Custom Submittable DocType"] .page-actions').findByRole('button', {name: 'Cancel'}).click();
  52. cy.get_open_dialog().findByRole('button', {name: 'Yes'}).click();
  53. //To check if the cancellation of the documemt is visible in the timeline content
  54. cy.get('.timeline-content').should('contain', 'Administrator cancelled this document');
  55. //Deleting the document
  56. cy.visit('/app/custom-submittable-doctype');
  57. cy.select_listview_row_checkbox(0);
  58. cy.get('.page-actions').findByRole('button', {name: 'Actions'}).click();
  59. cy.get('.page-actions .actions-btn-group [data-label="Delete"]').click();
  60. cy.click_modal_primary_button('Yes');
  61. //Deleting the custom doctype
  62. cy.visit('/app/doctype');
  63. cy.select_listview_row_checkbox(0);
  64. cy.get('.page-actions').findByRole('button', {name: 'Actions'}).click();
  65. cy.get('.page-actions .actions-btn-group [data-label="Delete"]').click();
  66. cy.click_modal_primary_button('Yes');
  67. });
  68. });