Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

115 řádky
4.3 KiB

  1. context("Grid", () => {
  2. beforeEach(() => {
  3. cy.login();
  4. cy.visit("/app/website");
  5. });
  6. before(() => {
  7. cy.login();
  8. cy.visit("/app/website");
  9. return cy
  10. .window()
  11. .its("xhiveframework")
  12. .then((xhiveframework) => {
  13. return xhiveframework.call(
  14. "xhiveframework.tests.ui_test_helpers.create_contact_phone_nos_records"
  15. );
  16. });
  17. });
  18. it("update docfield property using update_docfield_property", () => {
  19. cy.visit("/app/contact/Test Contact");
  20. cy.window()
  21. .its("cur_frm")
  22. .then((frm) => {
  23. cy.get('.xhiveframework-control[data-fieldname="phone_nos"]').as("table");
  24. let field = frm.get_field("phone_nos");
  25. field.grid.update_docfield_property("is_primary_phone", "hidden", true);
  26. cy.get("@table").find('[data-idx="1"] .edit-grid-row').click();
  27. cy.get(".grid-row-open").as("table-form");
  28. cy.get("@table-form")
  29. .find('.xhiveframework-control[data-fieldname="is_primary_phone"]')
  30. .should("be.hidden");
  31. cy.get("@table-form").find(".grid-footer-toolbar").click();
  32. cy.get("@table").find('[data-idx="2"] .edit-grid-row').click();
  33. cy.get(".grid-row-open").as("table-form");
  34. cy.get("@table-form")
  35. .find('.xhiveframework-control[data-fieldname="is_primary_phone"]')
  36. .should("be.hidden");
  37. cy.get("@table-form").find(".grid-footer-toolbar").click();
  38. });
  39. });
  40. it("update docfield property using toggle_display", () => {
  41. cy.visit("/app/contact/Test Contact");
  42. cy.window()
  43. .its("cur_frm")
  44. .then((frm) => {
  45. cy.get('.xhiveframework-control[data-fieldname="phone_nos"]').as("table");
  46. let field = frm.get_field("phone_nos");
  47. field.grid.toggle_display("is_primary_mobile_no", false);
  48. cy.get("@table").find('[data-idx="1"] .edit-grid-row').click();
  49. cy.get(".grid-row-open").as("table-form");
  50. cy.get("@table-form")
  51. .find('.xhiveframework-control[data-fieldname="is_primary_mobile_no"]')
  52. .should("be.hidden");
  53. cy.get("@table-form").find(".grid-footer-toolbar").click();
  54. cy.get("@table").find('[data-idx="2"] .edit-grid-row').click();
  55. cy.get(".grid-row-open").as("table-form");
  56. cy.get("@table-form")
  57. .find('.xhiveframework-control[data-fieldname="is_primary_mobile_no"]')
  58. .should("be.hidden");
  59. cy.get("@table-form").find(".grid-footer-toolbar").click();
  60. });
  61. });
  62. it("update docfield property using toggle_enable", () => {
  63. cy.visit("/app/contact/Test Contact");
  64. cy.window()
  65. .its("cur_frm")
  66. .then((frm) => {
  67. cy.get('.xhiveframework-control[data-fieldname="phone_nos"]').as("table");
  68. let field = frm.get_field("phone_nos");
  69. field.grid.toggle_enable("phone", false);
  70. cy.get("@table").find('[data-idx="1"] .edit-grid-row').click();
  71. cy.get(".grid-row-open").as("table-form");
  72. cy.get("@table-form")
  73. .find('.xhiveframework-control[data-fieldname="phone"] .control-value')
  74. .should("have.class", "like-disabled-input");
  75. cy.get("@table-form").find(".grid-footer-toolbar").click();
  76. cy.get("@table").find('[data-idx="2"] .edit-grid-row').click();
  77. cy.get(".grid-row-open").as("table-form");
  78. cy.get("@table-form")
  79. .find('.xhiveframework-control[data-fieldname="phone"] .control-value')
  80. .should("have.class", "like-disabled-input");
  81. cy.get("@table-form").find(".grid-footer-toolbar").click();
  82. });
  83. });
  84. it("update docfield property using toggle_reqd", () => {
  85. cy.visit("/app/contact/Test Contact");
  86. cy.window()
  87. .its("cur_frm")
  88. .then((frm) => {
  89. cy.get('.xhiveframework-control[data-fieldname="phone_nos"]').as("table");
  90. let field = frm.get_field("phone_nos");
  91. field.grid.toggle_reqd("phone", false);
  92. cy.get("@table").find('[data-idx="1"] .edit-grid-row').click();
  93. cy.get(".grid-row-open").as("table-form");
  94. cy.get_field("phone").as("phone-field");
  95. cy.get("@phone-field").focus().clear().wait(500).blur();
  96. cy.get("@phone-field").should("not.have.class", "has-error");
  97. cy.get("@table-form").find(".grid-footer-toolbar").click();
  98. cy.get("@table").find('[data-idx="2"] .edit-grid-row').click();
  99. cy.get(".grid-row-open").as("table-form");
  100. cy.get_field("phone").as("phone-field");
  101. cy.get("@phone-field").focus().clear().wait(500).blur();
  102. cy.get("@phone-field").should("not.have.class", "has-error");
  103. cy.get("@table-form").find(".grid-footer-toolbar").click();
  104. });
  105. });
  106. });