access-to-page.spec.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. context('Access to page', () => {
  2. const ssPrefix = '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. it('/Sandbox/Math is successfully loaded', () => {
  27. cy.visit('/Sandbox/Math');
  28. cy.screenshot(`${ssPrefix}-sandbox-math`, { capture: 'viewport' });
  29. });
  30. it('/Sandbox with edit is successfully loaded', () => {
  31. cy.visit('/Sandbox#edit');
  32. cy.screenshot(`${ssPrefix}-sandbox-edit-page`, { capture: 'viewport' });
  33. })
  34. it('/user/admin is successfully loaded', () => {
  35. cy.visit('/user/admin', { });
  36. cy.screenshot(`${ssPrefix}-user-admin`, { capture: 'viewport' });
  37. });
  38. });