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.

пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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"]').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('.ce-block').click().type('{enter}');
  31. cy.get('.block-list-container .block-list-item').contains('Heading').click();
  32. cy.get(":focus").type('Header');
  33. cy.get(".ce-block:last").find('.ce-header').should('exist');
  34. cy.get('.ce-block:last').click().type('{enter}');
  35. cy.get('.block-list-container .block-list-item').contains('Text').click();
  36. cy.get(":focus").type('Paragraph text');
  37. cy.get(".ce-block:last").find('.ce-paragraph').should('exist');
  38. });
  39. it('Delete A Block', () => {
  40. cy.get(":focus").click();
  41. cy.get('.paragraph-control .setting-btn').click();
  42. cy.get('.paragraph-control .dropdown-item').contains('Delete').click();
  43. cy.get(".ce-block:last").find('.ce-paragraph').should('not.exist');
  44. });
  45. it('Shrink and Expand A Block', () => {
  46. cy.get(":focus").click();
  47. cy.get('.ce-block:last .setting-btn').click();
  48. cy.get('.ce-block:last .dropdown-item').contains('Shrink').click();
  49. cy.get(".ce-block:last").should('have.class', 'col-xs-11');
  50. cy.get('.ce-block:last .dropdown-item').contains('Shrink').click();
  51. cy.get(".ce-block:last").should('have.class', 'col-xs-10');
  52. cy.get('.ce-block:last .dropdown-item').contains('Shrink').click();
  53. cy.get(".ce-block:last").should('have.class', 'col-xs-9');
  54. cy.get('.ce-block:last .dropdown-item').contains('Expand').click();
  55. cy.get(".ce-block:last").should('have.class', 'col-xs-10');
  56. cy.get('.ce-block:last .dropdown-item').contains('Expand').click();
  57. cy.get(".ce-block:last").should('have.class', 'col-xs-11');
  58. cy.get('.ce-block:last .dropdown-item').contains('Expand').click();
  59. cy.get(".ce-block:last").should('have.class', 'col-xs-12');
  60. cy.get('.standard-actions .btn-primary[data-label="Save"]').click();
  61. });
  62. it('Delete Private Page', () => {
  63. cy.get('.codex-editor__redactor .ce-block');
  64. cy.get('.standard-actions .btn-secondary[data-label=Edit]').click();
  65. cy.get('.sidebar-item-container[item-name="Test Private Page"]')
  66. .find('.sidebar-item-control .setting-btn').click();
  67. cy.get('.sidebar-item-container[item-name="Test Private Page"]')
  68. .find('.dropdown-item[title="Delete Workspace"]').click({force: true});
  69. cy.wait(300);
  70. cy.get('.modal-footer > .standard-actions > .btn-modal-primary:visible').first().click();
  71. cy.get('.standard-actions .btn-primary[data-label="Save"]').click();
  72. cy.get('.codex-editor__redactor .ce-block');
  73. cy.get('.sidebar-item-container[item-name="Test Private Page"]').should('not.exist');
  74. });
  75. });