No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

232 líneas
5.6 KiB

  1. context("View", () => {
  2. before(() => {
  3. cy.login();
  4. cy.visit("/app/website");
  5. });
  6. it("Route to ToDo List View", () => {
  7. cy.visit("/app/todo/view/list");
  8. cy.wait(500);
  9. cy.window()
  10. .its("cur_list")
  11. .then((list) => {
  12. expect(list.view_name).to.equal("List");
  13. });
  14. });
  15. it("Route to ToDo Report View", () => {
  16. cy.visit("/app/todo/view/report");
  17. cy.wait(500);
  18. cy.window()
  19. .its("cur_list")
  20. .then((list) => {
  21. expect(list.view_name).to.equal("Report");
  22. });
  23. });
  24. it("Route to ToDo Dashboard View", () => {
  25. cy.visit("/app/todo/view/dashboard");
  26. cy.wait(500);
  27. cy.window()
  28. .its("cur_list")
  29. .then((list) => {
  30. expect(list.view_name).to.equal("Dashboard");
  31. });
  32. });
  33. it("Route to ToDo Gantt View", () => {
  34. cy.visit("/app/todo/view/gantt");
  35. cy.wait(500);
  36. cy.window()
  37. .its("cur_list")
  38. .then((list) => {
  39. expect(list.view_name).to.equal("Gantt");
  40. });
  41. });
  42. it("Route to ToDo Kanban View", () => {
  43. cy.call("xhiveframework.tests.ui_test_helpers.create_kanban").then(() => {
  44. cy.visit("/app/note/view/kanban/_Note _Kanban");
  45. cy.wait(500);
  46. cy.window()
  47. .its("cur_list")
  48. .then((list) => {
  49. expect(list.view_name).to.equal("Kanban");
  50. });
  51. });
  52. });
  53. it("Route to ToDo Calendar View", () => {
  54. cy.visit("/app/todo/view/calendar");
  55. cy.wait(500);
  56. cy.window()
  57. .its("cur_list")
  58. .then((list) => {
  59. expect(list.view_name).to.equal("Calendar");
  60. });
  61. });
  62. it("Route to Custom Tree View", () => {
  63. cy.call("xhiveframework.tests.ui_test_helpers.setup_tree_doctype").then(() => {
  64. cy.visit("/app/custom-tree/view/tree");
  65. cy.wait(500);
  66. cy.window()
  67. .its("cur_tree")
  68. .then((list) => {
  69. expect(list.view_name).to.equal("Tree");
  70. });
  71. });
  72. });
  73. it("Route to Custom Image View", () => {
  74. cy.call("xhiveframework.tests.ui_test_helpers.setup_image_doctype").then(() => {
  75. cy.visit("app/custom-image/view/image");
  76. cy.wait(500);
  77. cy.window()
  78. .its("cur_list")
  79. .then((list) => {
  80. expect(list.view_name).to.equal("Image");
  81. });
  82. });
  83. });
  84. it("Route to Communication Inbox View", () => {
  85. cy.call("xhiveframework.tests.ui_test_helpers.setup_inbox").then(() => {
  86. cy.visit("app/communication/view/inbox");
  87. cy.wait(500);
  88. cy.window()
  89. .its("cur_list")
  90. .then((list) => {
  91. expect(list.view_name).to.equal("Inbox");
  92. });
  93. });
  94. });
  95. it("Route to File View", () => {
  96. cy.intercept("POST", "/api/method/xhiveframework.desk.reportview.get").as("list_loaded");
  97. cy.visit("app/file");
  98. cy.wait("@list_loaded");
  99. cy.window()
  100. .its("cur_list")
  101. .then((list) => {
  102. expect(list.view_name).to.equal("File");
  103. expect(list.current_folder).to.equal("Home");
  104. });
  105. cy.visit("app/file/view/home/Attachments");
  106. cy.wait("@list_loaded");
  107. cy.window()
  108. .its("cur_list")
  109. .then((list) => {
  110. expect(list.view_name).to.equal("File");
  111. expect(list.current_folder).to.equal("Home/Attachments");
  112. });
  113. });
  114. it("Re-route to default view", () => {
  115. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", { view: "Report" }).then(() => {
  116. cy.visit("app/event");
  117. cy.wait(500);
  118. cy.window()
  119. .its("cur_list")
  120. .then((list) => {
  121. expect(list.view_name).to.equal("Report");
  122. });
  123. });
  124. });
  125. it("Route to default view from app/{doctype}", () => {
  126. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", { view: "Report" }).then(() => {
  127. cy.visit("/app/event");
  128. cy.wait(500);
  129. cy.window()
  130. .its("cur_list")
  131. .then((list) => {
  132. expect(list.view_name).to.equal("Report");
  133. });
  134. });
  135. });
  136. it("Route to default view from app/{doctype}/view", () => {
  137. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", { view: "Report" }).then(() => {
  138. cy.visit("/app/event/view");
  139. cy.wait(500);
  140. cy.window()
  141. .its("cur_list")
  142. .then((list) => {
  143. expect(list.view_name).to.equal("Report");
  144. });
  145. });
  146. });
  147. it("Force Route to default view from app/{doctype}", () => {
  148. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", {
  149. view: "Report",
  150. force_reroute: true,
  151. }).then(() => {
  152. cy.visit("/app/event");
  153. cy.wait(500);
  154. cy.window()
  155. .its("cur_list")
  156. .then((list) => {
  157. expect(list.view_name).to.equal("Report");
  158. });
  159. });
  160. });
  161. it("Force Route to default view from app/{doctype}/view", () => {
  162. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", {
  163. view: "Report",
  164. force_reroute: true,
  165. }).then(() => {
  166. cy.visit("/app/event/view");
  167. cy.wait(500);
  168. cy.window()
  169. .its("cur_list")
  170. .then((list) => {
  171. expect(list.view_name).to.equal("Report");
  172. });
  173. });
  174. });
  175. it("Force Route to default view from app/{doctype}/view", () => {
  176. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", {
  177. view: "Report",
  178. force_reroute: true,
  179. }).then(() => {
  180. cy.visit("/app/event/view/list");
  181. cy.wait(500);
  182. cy.window()
  183. .its("cur_list")
  184. .then((list) => {
  185. expect(list.view_name).to.equal("Report");
  186. });
  187. });
  188. });
  189. it("Validate Route History for Default View", () => {
  190. cy.call("xhiveframework.tests.ui_test_helpers.setup_default_view", { view: "Report" }).then(() => {
  191. cy.visit("/app/event");
  192. cy.visit("/app/event/view/list");
  193. cy.location("pathname").should("eq", "/app/event/view/list");
  194. cy.go("back");
  195. cy.location("pathname").should("eq", "/app/event");
  196. });
  197. });
  198. it("Route to Form", () => {
  199. const test_user = cy.config("testUser");
  200. cy.visit(`/app/user/${test_user}`);
  201. cy.window()
  202. .its("cur_frm")
  203. .then((frm) => {
  204. expect(frm.doc.name).to.equal(test_user);
  205. });
  206. });
  207. it("Route to Website Workspace", () => {
  208. cy.visit("/app/website");
  209. cy.get(".title-text").should("contain", "Website");
  210. });
  211. });