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.
 
 
 
 
 
 

53 regels
2.5 KiB

  1. context('Timeline', () => {
  2. before(() => {
  3. cy.visit('/login');
  4. cy.login();
  5. cy.visit('/app/todo');
  6. });
  7. it('Adding new ToDo, adding new comment, verifying comment addition & deletion and deleting ToDo', () => {
  8. //Adding new ToDo
  9. cy.click_listview_primary_button('Add ToDo');
  10. cy.get('.modal-footer > .custom-actions > .btn').contains('Edit in full page').click();
  11. cy.get('.row > .section-body > .form-column > form > .frappe-control > .form-group > .control-input-wrapper > .control-input > .ql-container > .ql-editor').eq(0).type('Test ToDo', {force: true});
  12. cy.wait(200);
  13. cy.get('#page-ToDo > .page-head > .container > .row > .col > .standard-actions > .primary-action').contains('Save').click();
  14. cy.wait(700);
  15. cy.visit('/app/todo');
  16. cy.get('.list-row > .level-left > .list-subject > .level-item.ellipsis > .ellipsis').eq(0).click();
  17. //To check if the comment box is initially empty and tying some text into it
  18. cy.get('.comment-input-container > .frappe-control > .ql-container > .ql-editor').should('contain', '').type('Testing Timeline');
  19. //Adding new comment
  20. cy.get('.comment-input-wrapper > .btn').contains('Comment').click();
  21. //To check if the commented text is visible in the timeline content
  22. cy.get('.timeline-content').should('contain', 'Testing Timeline');
  23. //Editing comment
  24. cy.click_timeline_action_btn(0);
  25. cy.get('.timeline-content > .timeline-message-box > .comment-edit-box > .frappe-control > .ql-container > .ql-editor').first().type(' 123');
  26. cy.click_timeline_action_btn(0);
  27. //To check if the edited comment text is visible in timeline content
  28. cy.get('.timeline-content').should('contain', 'Testing Timeline 123');
  29. //Discarding comment
  30. cy.click_timeline_action_btn(0);
  31. cy.get('.actions > .btn').eq(1).first().click();
  32. //To check if after discarding the timeline content is same as previous
  33. cy.get('.timeline-content').should('contain', 'Testing Timeline 123');
  34. //Deleting the added comment
  35. cy.get('.actions > .btn > .icon').first().click();
  36. cy.get('.modal-footer > .standard-actions > .btn-primary').contains('Yes').click();
  37. cy.click_modal_primary_button('Yes');
  38. //Deleting the added ToDo
  39. cy.get('#page-ToDo > .page-head > .container > .row > .col > .standard-actions > .menu-btn-group > .btn').click({force: true});
  40. cy.get('.menu-btn-group > .dropdown-menu > li > .grey-link').eq(17).click({force: true});
  41. cy.get('.modal.show > .modal-dialog > .modal-content > .modal-footer > .standard-actions > .btn-primary').contains('Yes').click({force: true});
  42. });
  43. });