switch-sidebar-contents.spec.ts 844 B

12345678910111213141516171819202122232425262728293031
  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. cy.getByTestid('grw-sidebar-nav-primary-page-tree').click();
  21. cy.screenshot(`${ssPrefix}-pagetree-before-load`, { capture: 'viewport' });
  22. // eslint-disable-next-line cypress/no-unnecessary-waiting
  23. cy.wait(1500);
  24. cy.screenshot(`${ssPrefix}-pagetree-after-load`, { capture: 'viewport' });
  25. });
  26. });