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.

theme_switcher_dialog.js 805 B

2 years ago
1234567891011121314151617181920212223242526272829
  1. context("Theme Switcher Shortcut", () => {
  2. before(() => {
  3. cy.login();
  4. cy.visit("/app");
  5. });
  6. beforeEach(() => {
  7. cy.reload();
  8. });
  9. it("Check Toggle", () => {
  10. cy.open_theme_dialog("{ctrl+shift+g}");
  11. cy.get(".modal-backdrop").should("exist");
  12. cy.get(".theme-grid > div").first().click();
  13. cy.close_theme("{ctrl+shift+g}");
  14. cy.get(".modal-backdrop").should("not.exist");
  15. });
  16. it("Check Enter", () => {
  17. cy.open_theme_dialog("{ctrl+shift+g}");
  18. cy.get(".theme-grid > div").first().click();
  19. cy.close_theme("{enter}");
  20. cy.get(".modal-backdrop").should("not.exist");
  21. });
  22. });
  23. Cypress.Commands.add("open_theme_dialog", (shortcut_keys) => {
  24. cy.get("body").type(shortcut_keys);
  25. });
  26. Cypress.Commands.add("close_theme", (shortcut_keys) => {
  27. cy.get(".modal-header").type(shortcut_keys);
  28. });