|
| 1 | +describe('sticky menu visibility Test', () => { |
| 2 | + beforeEach(() => { |
| 3 | + cy.intercept('GET', `/**/*?expand*`).as('content'); |
| 4 | + cy.autologin(); |
| 5 | + cy.createContent({ |
| 6 | + contentType: 'Document', |
| 7 | + contentId: 'my-page', |
| 8 | + contentTitle: 'My Page', |
| 9 | + }); |
| 10 | + cy.createContent({ |
| 11 | + contentType: 'Image', |
| 12 | + contentId: 'my-image', |
| 13 | + contentTitle: 'My Image', |
| 14 | + }); |
| 15 | + cy.createContent({ |
| 16 | + contentType: 'Document', |
| 17 | + contentId: 'my-page-test', |
| 18 | + contentTitle: 'My Page Test', |
| 19 | + }); |
| 20 | + cy.visit('/my-page'); |
| 21 | + cy.wait('@content'); |
| 22 | + }); |
| 23 | + it('create sticky menu items and check if it is hidden in settings/controlpanel and visible elsewhere', () => { |
| 24 | + cy.navigate('/edit'); |
| 25 | + cy.get('#metadataform-fieldset-sticky_menu').should('exist'); |
| 26 | + cy.get('.field-wrapper-sticky_menu .add-item-button-wrapper') |
| 27 | + .should('exist') |
| 28 | + .dblclick(); |
| 29 | + cy.get('.olw-item-wrapper.active').should('exist'); |
| 30 | + cy.get('.olw-item-wrapper.active [id^="field-title-"]') |
| 31 | + .should('exist') |
| 32 | + .type('My Link'); |
| 33 | + cy.get( |
| 34 | + '.olw-item-wrapper.active [class*="field-wrapper-icon-"] .objectbrowser-field button.ui.button.action', |
| 35 | + ) |
| 36 | + .should('exist') |
| 37 | + .click(); |
| 38 | + cy.findByLabelText('Search SVG').click(); |
| 39 | + cy.get('.ui.input.search').type('My Image'); |
| 40 | + cy.findByLabelText('Select My Image').dblclick(); |
| 41 | + |
| 42 | + cy.get('.olw-item-wrapper.active [id^="field-alt-"]') |
| 43 | + .should('exist') |
| 44 | + .type('My Link Test'); |
| 45 | + |
| 46 | + cy.get( |
| 47 | + '.olw-item-wrapper.active [class*="field-wrapper-href-"] .objectbrowser-field button.ui.button.action', |
| 48 | + ) |
| 49 | + .should('exist') |
| 50 | + .click(); |
| 51 | + cy.findByLabelText('Search SVG').click(); |
| 52 | + cy.get('.ui.input.search').type('My Page Test'); |
| 53 | + cy.findByLabelText('Select My Page Test').dblclick(); |
| 54 | + |
| 55 | + cy.get('.theme-color-picker.field-wrapper-sticky_menu_color input') |
| 56 | + .click() |
| 57 | + .type('#000000'); |
| 58 | + cy.get( |
| 59 | + '.theme-color-picker.field-wrapper-sticky_menu_foreground_color input', |
| 60 | + ) |
| 61 | + .click() |
| 62 | + .type('#ffffff'); |
| 63 | + |
| 64 | + cy.get('#toolbar-save').click(); |
| 65 | + cy.wait('@content'); |
| 66 | + |
| 67 | + //Test if sticky menu is visible on normal page |
| 68 | + cy.get('.sticky-menu').should('be.visible'); |
| 69 | + |
| 70 | + //Test if sticky menu is not visible on settings and control panel pages |
| 71 | + cy.visit('/my-page/historyview'); |
| 72 | + cy.get('.sticky-menu').should('not.be.visible'); |
| 73 | + |
| 74 | + cy.visit('/my-page/aliases'); |
| 75 | + cy.get('.sticky-menu').should('not.be.visible'); |
| 76 | + |
| 77 | + cy.visit('/my-page/sharing'); |
| 78 | + cy.get('.sticky-menu').should('not.be.visible'); |
| 79 | + |
| 80 | + cy.visit('/my-page/links-to-item'); |
| 81 | + cy.get('.sticky-menu').should('not.be.visible'); |
| 82 | + |
| 83 | + cy.visit('/controlpanel/usergroupmembership'); |
| 84 | + cy.get('.sticky-menu').should('not.be.visible'); |
| 85 | + }); |
| 86 | +}); |
0 commit comments