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.
 
 
 
 
 
 

58 lines
1.5 KiB

  1. context("Awesome Bar", () => {
  2. before(() => {
  3. cy.visit("/login");
  4. cy.login();
  5. cy.visit("/app/website");
  6. });
  7. beforeEach(() => {
  8. cy.get(".navbar .navbar-home").click();
  9. cy.findByPlaceholderText("Search or type a command (Ctrl + G)").clear();
  10. });
  11. it("navigates to doctype list", () => {
  12. cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type("todo", {
  13. delay: 700,
  14. });
  15. cy.get(".awesomplete").findByRole("listbox").should("be.visible");
  16. cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type("{enter}", {
  17. delay: 700,
  18. });
  19. cy.get(".title-text").should("contain", "To Do");
  20. cy.location("pathname").should("eq", "/app/todo");
  21. });
  22. it("find text in doctype list", () => {
  23. cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type(
  24. "test in todo{enter}",
  25. { delay: 700 }
  26. );
  27. cy.get(".title-text").should("contain", "To Do");
  28. cy.findByPlaceholderText("ID").should("have.value", "%test%");
  29. cy.clear_filters();
  30. });
  31. it("navigates to new form", () => {
  32. cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type(
  33. "new blog post{enter}",
  34. { delay: 700 }
  35. );
  36. cy.get(".title-text:visible").should("have.text", "New Blog Post");
  37. });
  38. it("calculates math expressions", () => {
  39. cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type(
  40. "55 + 32{downarrow}{enter}",
  41. { delay: 700 }
  42. );
  43. cy.get(".modal-title").should("contain", "Result");
  44. cy.get(".msgprint").should("contain", "55 + 32 = 87");
  45. });
  46. });