open-page-duplicate-modal.spec.ts 962 B

1234567891011121314151617181920212223242526272829303132333435
  1. context('Open Page Duplicate Modal', () => {
  2. const ssPrefix = 'access-to-page-duplicate-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. cy.visit('/');
  19. }
  20. });
  21. it('PageDuplicateModal is shown successfully', () => {
  22. cy.visit('/Sandbox/Bootstrap4', { });
  23. cy.get('#grw-subnav-container').within(() => {
  24. cy.getByTestid('open-page-item-control-btn').click();
  25. cy.getByTestid('open-page-duplicate-modal-btn').click();
  26. });
  27. cy.getByTestid('page-duplicate-modal').should('be.visible').screenshot(`${ssPrefix}-open-bootstrap4`);
  28. });
  29. });