open-presentation-modal.spec.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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('PresentationModal 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. cy.get('.grw-presentation-modal').should('be.visible')
  25. cy.screenshot(`${ssPrefix}-opne-top`, { capture: 'viewport' });
  26. });
  27. it('PresentationModal for "/Sandbox/Bootstrap4" is shown successfully', () => {
  28. cy.visit('/Sandbox/Bootstrap4');
  29. cy.get('#grw-subnav-container').within(() => {
  30. cy.getByTestid('open-page-item-control-btn').click({force: true})
  31. cy.getByTestid('open-presentation-modal-btn').click({force: true})
  32. });
  33. cy.get('.grw-presentation-modal').should('be.visible')
  34. cy.screenshot(`${ssPrefix}-open-bootstrap4`, { capture: 'viewport' });
  35. });
  36. it('PresentationModal for /Sandbox/Bootstrap4#Cards" is shown successfully', () => {
  37. cy.visit('/Sandbox/Bootstrap4#Cards');
  38. cy.get('#grw-subnav-container').within(() => {
  39. cy.getByTestid('open-page-item-control-btn').click({force: true})
  40. cy.getByTestid('open-presentation-modal-btn').click({force: true})
  41. });
  42. cy.get('.grw-presentation-modal').should('be.visible')
  43. cy.screenshot(`${ssPrefix}-open-bootstrap4-with-ancker-link`, { capture: 'viewport' });
  44. });
  45. });