open-presentation-modal.spec.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. context('Open presentation modal', () => {
  2. const ssPrefix = 'access-to-presentation-modal-';
  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('PageCreateModal for "/" is shown successfully', () => {
  19. cy.visit('/');
  20. cy.get('#grw-subnav-container').within(() => {
  21. cy.getByTestid('open-page-item-control-btn').click({force: true})
  22. cy.getByTestid('open-presentation-modal-btn').click({force: true})
  23. });
  24. // eslint-disable-next-line cypress/no-unnecessary-waiting
  25. cy.wait(1500);
  26. cy.screenshot(`${ssPrefix}-opne-top`, { capture: 'viewport' });
  27. });
  28. it('PageCreateModal for "/Sandbox/Bootstrap4" is shown successfully', () => {
  29. cy.visit('/Sandbox/Bootstrap4');
  30. cy.get('#grw-subnav-container').within(() => {
  31. cy.getByTestid('open-page-item-control-btn').click({force: true})
  32. cy.getByTestid('open-presentation-modal-btn').click({force: true})
  33. });
  34. // eslint-disable-next-line cypress/no-unnecessary-waiting
  35. cy.wait(1500);
  36. cy.screenshot(`${ssPrefix}-open-bootstrap4`, { capture: 'viewport' });
  37. });
  38. it('PageCreateModal for /Sandbox/Bootstrap4#Cards" is shown successfully', () => {
  39. cy.visit('/Sandbox/Bootstrap4#Cards');
  40. cy.get('#grw-subnav-container').within(() => {
  41. cy.getByTestid('open-page-item-control-btn').click({force: true})
  42. cy.getByTestid('open-presentation-modal-btn').click({force: true})
  43. });
  44. // eslint-disable-next-line cypress/no-unnecessary-waiting
  45. cy.wait(1500);
  46. cy.screenshot(`${ssPrefix}-open-bootstrap4-with-ancker-link`, { capture: 'viewport' });
  47. });
  48. });