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.
 
 
 
 
 
 

75 lines
2.6 KiB

  1. import custom_submittable_doctype from '../fixtures/custom_submittable_doctype';
  2. const doctype_name = custom_submittable_doctype.name;
  3. context('Report View', () => {
  4. before(() => {
  5. cy.login();
  6. cy.visit('/app/website');
  7. cy.insert_doc('DocType', custom_submittable_doctype, true);
  8. cy.clear_cache();
  9. cy.insert_doc(doctype_name, {
  10. 'title': 'Doc 1',
  11. 'description': 'Random Text',
  12. 'enabled': 0,
  13. 'docstatus': 1 // submit document
  14. }, true);
  15. return cy.window().its('frappe').then(frappe => {
  16. return frappe.call("frappe.tests.ui_test_helpers.create_multiple_contact_records");
  17. });
  18. });
  19. it('Field with enabled allow_on_submit should be editable.', () => {
  20. cy.intercept('POST', 'api/method/frappe.client.set_value').as('value-update');
  21. cy.visit(`/app/List/${doctype_name}/Report`);
  22. // check status column added from docstatus
  23. cy.get('.dt-row-0 > .dt-cell--col-3').should('contain', 'Submitted');
  24. let cell = cy.get('.dt-row-0 > .dt-cell--col-4');
  25. // select the cell
  26. cell.dblclick();
  27. cell.get('.dt-cell__edit--col-4').findByRole('checkbox').check({ force: true });
  28. cy.get('.frappe-list').click(); // click outside
  29. cy.wait('@value-update');
  30. cy.call('frappe.client.get_value', {
  31. doctype: doctype_name,
  32. filters: {
  33. title: 'Doc 1',
  34. },
  35. fieldname: 'enabled'
  36. }).then(r => {
  37. expect(r.message.enabled).to.equals(1);
  38. });
  39. });
  40. it('test load more with count selection buttons', () => {
  41. cy.visit('/app/contact/view/report');
  42. cy.get('.list-paging-area .list-count').should('contain.text', '20 of');
  43. cy.get('.list-paging-area .btn-more').click();
  44. cy.get('.list-paging-area .list-count').should('contain.text', '40 of');
  45. cy.get('.list-paging-area .btn-more').click();
  46. cy.get('.list-paging-area .list-count').should('contain.text', '60 of');
  47. cy.get('.list-paging-area .btn-group .btn-paging[data-value="100"]').click();
  48. cy.get('.list-paging-area .list-count').should('contain.text', '100 of');
  49. cy.get('.list-paging-area .btn-more').click();
  50. cy.get('.list-paging-area .list-count').should('contain.text', '200 of');
  51. cy.get('.list-paging-area .btn-more').click();
  52. cy.get('.list-paging-area .list-count').should('contain.text', '300 of');
  53. // check if refresh works after load more
  54. cy.get('.page-head .standard-actions [data-original-title="Refresh"]').click();
  55. cy.get('.list-paging-area .list-count').should('contain.text', '300 of');
  56. cy.get('.list-paging-area .btn-group .btn-paging[data-value="500"]').click();
  57. cy.get('.list-paging-area .list-count').should('contain.text', '500 of');
  58. cy.get('.list-paging-area .btn-more').click();
  59. cy.get('.list-paging-area .list-count').should('contain.text', '1000 of');
  60. });
  61. });