2
0

50-sidebar--switching-sidebar-mode.cy.ts 978 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { BlackoutGroup } from "../../support/blackout";
  2. // Blackout for recalculation of toc content hight
  3. const blackoutOverride = [
  4. ...BlackoutGroup.BASIS,
  5. ...BlackoutGroup.SIDE_CONTENTS,
  6. ];
  7. context('Switch sidebar mode', () => {
  8. const ssPrefix = 'switch-sidebar-mode-';
  9. before(() => {
  10. // login
  11. cy.fixture("user-admin.json").then(user => {
  12. cy.login(user.username, user.password);
  13. });
  14. });
  15. it('Switching sidebar mode', () => {
  16. cy.visit('/');
  17. cy.get('.grw-apperance-mode-dropdown').first().click();
  18. cy.get('[for="swSidebarMode"]').click({force: true});
  19. cy.get('.grw-sidebar-nav').should('not.be.visible');
  20. cy.screenshot(`${ssPrefix}-switch-sidebar-mode`, {
  21. blackout: blackoutOverride,
  22. });
  23. cy.get('[for="swSidebarMode"]').click({force: true});
  24. cy.get('.grw-sidebar-nav').should('be.visible');
  25. cy.screenshot(`${ssPrefix}-switch-sidebar-mode-back`, {
  26. blackout: blackoutOverride,
  27. });
  28. });
  29. });