modal-for-page-operation.spec.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. context('Modal for page operation', () => {
  2. const ssPrefix = 'modal-for-page-operation-';
  3. beforeEach(() => {
  4. // login
  5. cy.fixture("user-admin.json").then(user => {
  6. cy.login(user.username, user.password);
  7. });
  8. });
  9. it("PageCreateModal is shown successfully", () => {
  10. cy.visit('/me');
  11. cy.getByTestid('newPageBtn').click();
  12. cy.getByTestid('page-create-modal').should('be.visible').screenshot(`${ssPrefix}-open`);
  13. cy.getByTestid('row-create-page-under-below').find('input.form-control').clear().type('/new-page');
  14. cy.getByTestid('btn-create-page-under-below').click();
  15. cy.getByTestid('page-editor').should('be.visible');
  16. cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
  17. });
  18. it('PageDeleteModal is shown successfully', () => {
  19. cy.visit('/Sandbox/Bootstrap4');
  20. cy.get('#grw-subnav-container').within(() => {
  21. cy.getByTestid('open-page-item-control-btn').click();
  22. cy.getByTestid('open-page-delete-modal-btn').click();
  23. });
  24. cy.getByTestid('page-delete-modal').should('be.visible').screenshot(`${ssPrefix}-delete-bootstrap4`);
  25. });
  26. it('PageDuplicateModal is shown successfully', () => {
  27. cy.visit('/Sandbox/Bootstrap4', { });
  28. cy.get('#grw-subnav-container').within(() => {
  29. cy.getByTestid('open-page-item-control-btn').click();
  30. cy.getByTestid('open-page-duplicate-modal-btn').click();
  31. });
  32. cy.getByTestid('page-duplicate-modal').should('be.visible').screenshot(`${ssPrefix}-duplicate-bootstrap4`);
  33. });
  34. it('PageMoveRenameModal is shown successfully', () => {
  35. cy.visit('/Sandbox/Bootstrap4', { });
  36. cy.get('#grw-subnav-container').within(() => {
  37. cy.getByTestid('open-page-item-control-btn').click();
  38. cy.getByTestid('open-page-move-rename-modal-btn').click();
  39. });
  40. cy.getByTestid('page-rename-modal').should('be.visible').screenshot(`${ssPrefix}-rename-bootstrap4`);
  41. });
  42. });