Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

87 righe
2.8 KiB

  1. const verify_attachment_visibility = (document, is_private) => {
  2. cy.visit(`/app/${document}`);
  3. const assertion = is_private ? "be.checked" : "not.be.checked";
  4. cy.findByRole("button", { name: "Attach File" }).click();
  5. cy.get_open_dialog()
  6. .find(".file-upload-area")
  7. .selectFile("cypress/fixtures/sample_image.jpg", {
  8. action: "drag-drop",
  9. });
  10. cy.get_open_dialog().findByRole("checkbox", { name: "Private" }).should(assertion);
  11. };
  12. context("Sidebar", () => {
  13. before(() => {
  14. cy.visit("/login");
  15. cy.login();
  16. return cy
  17. .window()
  18. .its("xhiveframework")
  19. .then((xhiveframework) => {
  20. return xhiveframework.call("xhiveframework.tests.ui_test_helpers.create_blog_post");
  21. });
  22. });
  23. it("Verify attachment visibility config", () => {
  24. verify_attachment_visibility("doctype/Blog Post", true);
  25. verify_attachment_visibility("blog-post/test-blog-attachment-post", false);
  26. });
  27. it('Test for checking "Assigned To" counter value, adding filter and adding & removing an assignment', () => {
  28. cy.visit("/app/doctype");
  29. cy.click_sidebar_button("Assigned To");
  30. //To check if no filter is available in "Assigned To" dropdown
  31. cy.get(".empty-state").should("contain", "No filters found");
  32. //Assigning a doctype to a user
  33. cy.visit("/app/doctype/ToDo");
  34. cy.get(".form-assignments > .flex > .text-muted").click();
  35. cy.get_field("assign_to_me", "Check").click();
  36. cy.get(".modal-footer > .standard-actions > .btn-primary").click();
  37. cy.visit("/app/doctype");
  38. cy.click_sidebar_button("Assigned To");
  39. //To check if filter is added in "Assigned To" dropdown after assignment
  40. cy.get(".group-by-field.show > .dropdown-menu > .group-by-item > .dropdown-item").should(
  41. "contain",
  42. "1"
  43. );
  44. //To check if there is no filter added to the listview
  45. cy.get(".filter-selector > .btn").should("contain", "Filter");
  46. //To add a filter to display data into the listview
  47. cy.get(".group-by-field.show > .dropdown-menu > .group-by-item > .dropdown-item").click();
  48. //To check if filter is applied
  49. cy.click_filter_button().should("contain", "1 filter");
  50. cy.get(".fieldname-select-area > .awesomplete > .form-control").should(
  51. "have.value",
  52. "Assigned To"
  53. );
  54. cy.get(".condition").should("have.value", "like");
  55. cy.get(".filter-field > .form-group > .input-with-feedback").should(
  56. "have.value",
  57. `%${cy.config("testUser")}%`
  58. );
  59. cy.click_filter_button();
  60. //To remove the applied filter
  61. cy.clear_filters();
  62. //To remove the assignment
  63. cy.visit("/app/doctype/ToDo");
  64. cy.get(".assignments > .avatar-group > .avatar > .avatar-frame").click();
  65. cy.get(".remove-btn").click({ force: true });
  66. cy.hide_dialog();
  67. cy.visit("/app/doctype");
  68. cy.click_sidebar_button("Assigned To");
  69. cy.get(".empty-state").should("contain", "No filters found");
  70. });
  71. });