open-page-create-edit-template-modal.spec.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. context('Open Page presentation Template Modal', () => {
  2. const ssPrefix = 'access-to-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. // collapse sidebar
  13. cy.collapseSidebar(true);
  14. });
  15. beforeEach(() => {
  16. if (connectSid != null) {
  17. cy.setCookie('connect.sid', connectSid);
  18. }
  19. });
  20. it('PresentationModal is shown successfully', () => {
  21. cy.visit('/Sandbox/Bootstrap4', { });
  22. cy.get('#grw-subnav-container').within(() => {
  23. cy.getByTestid('open-page-item-control-btn').click();
  24. cy.getByTestid('open-presentation-modal-btn').click();
  25. });
  26. cy.getByTestid('page-presentation-modal').should('be.visible')
  27. cy.screenshot(`${ssPrefix}-open-page-presentation-bootstrap4`);
  28. });
  29. it('Moving to Template editor Page for only child pages successfully', () => {
  30. cy.visit('/Sandbox/Bootstrap4', { });
  31. cy.get('#grw-subnav-container').within(() => {
  32. cy.getByTestid('open-page-item-control-btn').click();
  33. cy.getByTestid('open-page-template-modal-btn').click();
  34. });
  35. cy.getByTestid('page-template-modal').should('be.visible')
  36. cy.screenshot(`${ssPrefix}-open-page-template-bootstrap4`);
  37. cy.getByTestid('template-button-children').click();
  38. cy.url().should('include', '/_template#edit');
  39. cy.screenshot();
  40. });
  41. it('Moving to Template editor Page including decendants successfully', () => {
  42. cy.visit('/Sandbox/Bootstrap4', { });
  43. cy.get('#grw-subnav-container').within(() => {
  44. cy.getByTestid('open-page-item-control-btn').click();
  45. cy.getByTestid('open-page-template-modal-btn').click();
  46. });
  47. cy.getByTestid('page-template-modal').should('be.visible')
  48. cy.screenshot(`${ssPrefix}-open-page-template-bootstrap4`);
  49. cy.getByTestid('template-button-decendants').click();
  50. cy.url().should('include', '/__template#edit');
  51. cy.screenshot();
  52. });
  53. });