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.
 
 
 
 
 
 

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