switch-sidebar-contents.spec.ts 909 B

123456789101112131415161718192021222324252627282930313233
  1. context('Access to page', () => {
  2. const ssPrefix = 'switch-sidebar-content';
  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('PageTree is successfully shown', () => {
  19. cy.visit('/');
  20. // eslint-disable-next-line cypress/no-unnecessary-waiting
  21. cy.wait(1000);
  22. cy.getByTestid('sidebar-pagetree').click();
  23. cy.screenshot(`${ssPrefix}-pagetree-before-load`, { capture: 'viewport' });
  24. // eslint-disable-next-line cypress/no-unnecessary-waiting
  25. cy.wait(1500);
  26. cy.screenshot(`${ssPrefix}-pagetree-after-load`, { capture: 'viewport' });
  27. });
  28. });