You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

90 lines
3.9 KiB

  1. context('Workspace 2.0', () => {
  2. before(() => {
  3. cy.visit('/login');
  4. cy.login();
  5. cy.visit('/app/website');
  6. });
  7. it('Navigate to page from sidebar', () => {
  8. cy.visit('/app/build');
  9. cy.get('.codex-editor__redactor .ce-block');
  10. cy.get('.sidebar-item-container[item-name="Settings"]').first().click();
  11. cy.location('pathname').should('eq', '/app/settings');
  12. });
  13. it('Create Private Page', () => {
  14. cy.get('.codex-editor__redactor .ce-block');
  15. cy.get('.custom-actions button[data-label="Create%20Workspace"]').click();
  16. cy.fill_field('title', 'Test Private Page', 'Data');
  17. cy.fill_field('icon', 'edit', 'Icon');
  18. cy.get_open_dialog().find('.modal-header').click();
  19. cy.get_open_dialog().find('.btn-primary').click();
  20. // check if sidebar item is added in pubic section
  21. cy.get('.sidebar-item-container[item-name="Test Private Page"]').should('have.attr', 'item-public', '0');
  22. cy.get('.standard-actions .btn-primary[data-label="Save Customizations"]').click();
  23. cy.wait(300);
  24. cy.get('.sidebar-item-container[item-name="Test Private Page"]').should('have.attr', 'item-public', '0');
  25. cy.wait(500);
  26. cy.get('.codex-editor__redactor .ce-block');
  27. cy.get('.standard-actions .btn-secondary[data-label=Edit]').click();
  28. });
  29. it('Add New Block', () => {
  30. cy.get('.codex-editor__redactor .ce-block');
  31. cy.get('.custom-actions .inner-group-button[data-label="Add%20Block"]').click();
  32. cy.get('.custom-actions .inner-group-button .dropdown-menu .block-menu-item-label').contains('Heading').click();
  33. cy.get(":focus").type('Header');
  34. cy.get(".ce-block:last").find('.ce-header').should('exist');
  35. cy.get('.custom-actions .inner-group-button[data-label="Add%20Block"]').click();
  36. cy.get('.custom-actions .inner-group-button .dropdown-menu .block-menu-item-label').contains('Text').click();
  37. cy.get(":focus").type('Paragraph text');
  38. cy.get(".ce-block:last").find('.ce-paragraph').should('exist');
  39. });
  40. it('Delete A Block', () => {
  41. cy.get(".ce-block:last").find('.delete-paragraph').click();
  42. cy.get(".ce-block:last").find('.ce-paragraph').should('not.exist');
  43. });
  44. it('Shrink and Expand A Block', () => {
  45. cy.get(".ce-block:last").find('.tune-btn').click();
  46. cy.get('.ce-settings--opened .ce-shrink-button').click();
  47. cy.get(".ce-block:last").should('have.class', 'col-11');
  48. cy.get('.ce-settings--opened .ce-shrink-button').click();
  49. cy.get(".ce-block:last").should('have.class', 'col-10');
  50. cy.get('.ce-settings--opened .ce-shrink-button').click();
  51. cy.get(".ce-block:last").should('have.class', 'col-9');
  52. cy.get('.ce-settings--opened .ce-expand-button').click();
  53. cy.get(".ce-block:last").should('have.class', 'col-10');
  54. cy.get('.ce-settings--opened .ce-expand-button').click();
  55. cy.get(".ce-block:last").should('have.class', 'col-11');
  56. cy.get('.ce-settings--opened .ce-expand-button').click();
  57. cy.get(".ce-block:last").should('have.class', 'col-12');
  58. });
  59. it('Change Header Text Size', () => {
  60. cy.get('.ce-settings--opened .cdx-settings-button[data-level="3"]').click();
  61. cy.get(".ce-block:last").find('.widget-head h3').should('exist');
  62. cy.get('.ce-settings--opened .cdx-settings-button[data-level="4"]').click();
  63. cy.get(".ce-block:last").find('.widget-head h4').should('exist');
  64. cy.get('.standard-actions .btn-primary[data-label="Save Customizations"]').click();
  65. });
  66. it('Delete Private Page', () => {
  67. cy.get('.codex-editor__redactor .ce-block');
  68. cy.get('.standard-actions .btn-secondary[data-label=Edit]').click();
  69. cy.get('.sidebar-item-container[item-name="Test Private Page"]').find('.sidebar-item-control .delete-page').click();
  70. cy.wait(300);
  71. cy.get('.modal-footer > .standard-actions > .btn-modal-primary:visible').first().click();
  72. cy.get('.standard-actions .btn-primary[data-label="Save Customizations"]').click();
  73. cy.get('.codex-editor__redactor .ce-block');
  74. cy.get('.sidebar-item-container[item-name="Test Private Page"]').should('not.exist');
  75. });
  76. });