25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

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