2
0

access-to-page.spec.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. // collapse sidebar
  13. cy.collapseSidebar(true);
  14. });
  15. beforeEach(() => {
  16. if (connectSid != null) {
  17. cy.setCookie('connect.sid', connectSid);
  18. }
  19. });
  20. it('/Sandbox is successfully loaded', () => {
  21. cy.visit('/Sandbox', { });
  22. cy.screenshot(`${ssPrefix}-sandbox`);
  23. });
  24. it('/Sandbox with anchor hash is successfully loaded', () => {
  25. cy.visit('/Sandbox#Headers');
  26. // eslint-disable-next-line cypress/no-unnecessary-waiting
  27. cy.wait(400);
  28. cy.getByTestid('grw-fab-create-page').should('be.visible');
  29. cy.getByTestid('grw-fab-return-to-top').should('be.visible');
  30. cy.screenshot(`${ssPrefix}-sandbox-headers`);
  31. });
  32. it('/Sandbox/Math is successfully loaded', () => {
  33. cy.visit('/Sandbox/Math');
  34. cy.screenshot(`${ssPrefix}-sandbox-math`);
  35. });
  36. it('/Sandbox with edit is successfully loaded', () => {
  37. cy.visit('/Sandbox#edit');
  38. cy.screenshot(`${ssPrefix}-sandbox-edit-page`);
  39. })
  40. it('/user/admin is successfully loaded', () => {
  41. cy.visit('/user/admin', { });
  42. cy.screenshot(`${ssPrefix}-user-admin`);
  43. });
  44. });