You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 lines
2.1 KiB

  1. context("Sidebar", () => {
  2. before(() => {
  3. cy.visit("/login");
  4. cy.login();
  5. cy.visit("/app/doctype");
  6. });
  7. it('Test for checking "Assigned To" counter value, adding filter and adding & removing an assignment', () => {
  8. cy.click_sidebar_button("Assigned To");
  9. //To check if no filter is available in "Assigned To" dropdown
  10. cy.get(".empty-state").should("contain", "No filters found");
  11. cy.click_sidebar_button("Created By");
  12. //To check if "Created By" dropdown contains filter
  13. cy.get(".group-by-item > .dropdown-item").should("contain", "Me");
  14. //Assigning a doctype to a user
  15. cy.visit("/app/doctype/ToDo");
  16. cy.get(".form-assignments > .flex > .text-muted").click();
  17. cy.get_field("assign_to_me", "Check").click();
  18. cy.get(".modal-footer > .standard-actions > .btn-primary").click();
  19. cy.visit("/app/doctype");
  20. cy.click_sidebar_button("Assigned To");
  21. //To check if filter is added in "Assigned To" dropdown after assignment
  22. cy.get(".group-by-field.show > .dropdown-menu > .group-by-item > .dropdown-item").should(
  23. "contain",
  24. "1"
  25. );
  26. //To check if there is no filter added to the listview
  27. cy.get(".filter-selector > .btn").should("contain", "Filter");
  28. //To add a filter to display data into the listview
  29. cy.get(".group-by-field.show > .dropdown-menu > .group-by-item > .dropdown-item").click();
  30. //To check if filter is applied
  31. cy.click_filter_button().should("contain", "1 filter");
  32. cy.get(".fieldname-select-area > .awesomplete > .form-control").should(
  33. "have.value",
  34. "Assigned To"
  35. );
  36. cy.get(".condition").should("have.value", "like");
  37. cy.get(".filter-field > .form-group > .input-with-feedback").should(
  38. "have.value",
  39. "%Administrator%"
  40. );
  41. cy.click_filter_button();
  42. //To remove the applied filter
  43. cy.clear_filters();
  44. //To remove the assignment
  45. cy.visit("/app/doctype/ToDo");
  46. cy.get(".assignments > .avatar-group > .avatar > .avatar-frame").click();
  47. cy.get(".remove-btn").click({ force: true });
  48. cy.hide_dialog();
  49. cy.visit("/app/doctype");
  50. cy.click_sidebar_button("Assigned To");
  51. cy.get(".empty-state").should("contain", "No filters found");
  52. });
  53. });