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.
 
 
 
 
 
 

98 satır
3.5 KiB

  1. context("Folder Navigation", () => {
  2. before(() => {
  3. cy.visit("/login");
  4. cy.login();
  5. cy.visit("/app/file");
  6. });
  7. it("Adding Folders", () => {
  8. //Adding filter to go into the home folder
  9. cy.get(".filter-x-button").click();
  10. cy.click_filter_button();
  11. cy.get(".filter-action-buttons > .text-muted").findByText("+ Add a Filter").click();
  12. cy.get(".fieldname-select-area > .awesomplete > .form-control:last").type("Fol{enter}");
  13. cy.get(".filter-field > .form-group > .link-field > .awesomplete > .input-with-feedback")
  14. .first()
  15. .type("Home{enter}");
  16. cy.get(".filter-action-buttons > div > .btn-primary").findByText("Apply Filters").click();
  17. //Adding folder (Test Folder)
  18. cy.click_menu_button("New Folder");
  19. cy.fill_field("value", "Test Folder");
  20. cy.click_modal_primary_button("Create");
  21. });
  22. it("Navigating the nested folders, checking if the URL formed is correct, checking if the added content in the child folder is correct", () => {
  23. //Navigating inside the Attachments folder
  24. cy.clear_filters();
  25. cy.wait(500);
  26. cy.get('[title="Attachments"] > span').click();
  27. //To check if the URL formed after visiting the attachments folder is correct
  28. cy.location("pathname").should("eq", "/app/file/view/home/Attachments");
  29. cy.visit("/app/file/view/home/Attachments");
  30. //Adding folder inside the attachments folder
  31. cy.click_menu_button("New Folder");
  32. cy.fill_field("value", "Test Folder");
  33. cy.click_modal_primary_button("Create");
  34. //Navigating inside the added folder in the Attachments folder
  35. cy.wait(500);
  36. cy.get('[title="Test Folder"] > span').click();
  37. //To check if the URL is correct after visiting the Test Folder
  38. cy.location("pathname").should("eq", "/app/file/view/home/Attachments/Test%20Folder");
  39. cy.visit("/app/file/view/home/Attachments/Test%20Folder");
  40. //Adding a file inside the Test Folder
  41. cy.findByRole("button", { name: "Add File" }).eq(0).click({ force: true });
  42. cy.get(".file-uploader").findByText("Link").click();
  43. cy.get(".input-group > input.form-control:visible").as("upload_input");
  44. cy.get("@upload_input").type("https://wallpaperplay.com/walls/full/8/2/b/72402.jpg", {
  45. waitForAnimations: false,
  46. parseSpecialCharSequences: false,
  47. force: true,
  48. delay: 100,
  49. });
  50. cy.click_modal_primary_button("Upload");
  51. //To check if the added file is present in the Test Folder
  52. cy.visit("/app/file/view/home/Attachments");
  53. cy.wait(500);
  54. cy.get("span.level-item > a > span").should("contain", "Test Folder");
  55. cy.visit("/app/file/view/home/Attachments/Test%20Folder");
  56. cy.wait(500);
  57. cy.get(".list-row-container").eq(0).should("contain.text", "72402.jpg");
  58. cy.get(".list-row-checkbox").eq(0).click();
  59. cy.intercept({
  60. method: "POST",
  61. url: "api/method/xhiveframework.desk.reportview.delete_items",
  62. }).as("file_deleted");
  63. //Deleting the added file from the Test folder
  64. cy.click_action_button("Delete");
  65. cy.click_modal_primary_button("Yes");
  66. cy.wait("@file_deleted");
  67. //Deleting the Test Folder
  68. cy.visit("/app/file/view/home/Attachments");
  69. cy.get(".list-row-checkbox").eq(0).click();
  70. cy.click_action_button("Delete");
  71. cy.click_modal_primary_button("Yes");
  72. cy.wait("@file_deleted");
  73. });
  74. it("Deleting Test Folder from the home", () => {
  75. //Deleting the Test Folder added in the home directory
  76. cy.visit("/app/file/view/home");
  77. cy.get(".level-left > .list-subject > .file-select >.list-row-checkbox")
  78. .eq(0)
  79. .click({ force: true, delay: 500 });
  80. cy.click_action_button("Delete");
  81. cy.click_modal_primary_button("Yes");
  82. });
  83. });