25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

40 satır
1.2 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. });
  10. it('Field with enabled allow_on_submit should be editable.', () => {
  11. cy.insert_doc(doctype_name, {
  12. 'title': 'Doc 1',
  13. 'description': 'Random Text',
  14. 'enabled': 0,
  15. // submit document
  16. 'docstatus': 1
  17. }, true).as('doc');
  18. cy.intercept('POST', 'api/method/frappe.client.set_value').as('value-update');
  19. cy.visit(`/app/List/${doctype_name}/Report`);
  20. // check status column added from docstatus
  21. cy.get('.dt-row-0 > .dt-cell--col-3').should('contain', 'Submitted');
  22. let cell = cy.get('.dt-row-0 > .dt-cell--col-4');
  23. // select the cell
  24. cell.dblclick();
  25. cell.get('.dt-cell__edit--col-4').findByRole('checkbox').check({ force: true });
  26. cy.wait('@value-update');
  27. cy.get('@doc').then(doc => {
  28. cy.call('frappe.client.get_value', {
  29. doctype: doc.doctype,
  30. filters: {
  31. name: doc.name,
  32. },
  33. fieldname: 'enabled'
  34. }).then(r => {
  35. expect(r.message.enabled).to.equals(1);
  36. });
  37. });
  38. });
  39. });