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.
 
 
 
 
 
 

42 lines
1.3 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#workspace/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. // submit document
  14. 'docstatus': 1
  15. }, true).as('doc');
  16. });
  17. it('Field with enabled allow_on_submit should be editable.', () => {
  18. cy.server();
  19. cy.route('POST', 'api/method/frappe.client.set_value').as('value-update');
  20. cy.visit(`/app/List/${doctype_name}/Report`);
  21. // check status column added from docstatus
  22. cy.get('.dt-row-0 > .dt-cell--col-3').should('contain', 'Submitted');
  23. let cell = cy.get('.dt-row-0 > .dt-cell--col-4');
  24. // select the cell
  25. cell.dblclick();
  26. cell.find('input[data-fieldname="enabled"]').check({force: true});
  27. cy.get('.dt-row-0 > .dt-cell--col-5').click();
  28. cy.wait('@value-update');
  29. cy.get('@doc').then(doc => {
  30. cy.call('frappe.client.get_value', {
  31. doctype: doc.doctype,
  32. filters: {
  33. name: doc.name,
  34. },
  35. fieldname: 'enabled'
  36. }).then(r => {
  37. expect(r.message.enabled).to.equals(1);
  38. });
  39. });
  40. });
  41. });