switching-sidebar-mode.spec.ts 849 B

123456789101112131415161718192021222324252627282930313233
  1. context('Switch sidebar mode', () => {
  2. const ssPrefix = 'switch-sidebar-mode-';
  3. let connectSid: string | undefined;
  4. before(() => {
  5. // login
  6. cy.fixture("user-admin.json").then(user => {
  7. cy.login(user.username, user.password);
  8. });
  9. cy.getCookie('connect.sid').then(cookie => {
  10. connectSid = cookie?.value;
  11. });
  12. });
  13. beforeEach(() => {
  14. if (connectSid != null) {
  15. cy.setCookie('connect.sid', connectSid);
  16. }
  17. });
  18. it('Switching sidebar mode', () => {
  19. cy.visit('/');
  20. cy.get('.grw-personal-dropdown').click();
  21. cy.get('[for="swSidebarModeOnEditor"]').click();
  22. cy.screenshot(`${ssPrefix}-switch-sidebar-mode`, { capture: 'viewport' });
  23. cy.get('[for="swSidebarModeOnEditor"]').click();
  24. cy.screenshot(`${ssPrefix}-switch-sidebar-mode-back`, { capture: 'viewport' });
  25. });
  26. });