access-to-page.spec.ts 792 B

123456789101112131415161718192021222324252627282930313233
  1. const ssPrefix = 'access-to-page-';
  2. context('Access to page', () => {
  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('/Sandbox is successfully loaded', () => {
  19. cy.visit('/Sandbox', { });
  20. cy.screenshot(`${ssPrefix}-sandbox`, { capture: 'viewport' });
  21. });
  22. it('/Sandbox with anchor hash is successfully loaded', () => {
  23. cy.visit('/Sandbox#Headers');
  24. cy.screenshot(`${ssPrefix}-sandbox-headers`, { capture: 'viewport' });
  25. });
  26. });