|
| 1 | +/* global describe it cy beforeEach require */ |
| 2 | + |
| 3 | +var helper = require('../../common/helper'); |
| 4 | +var desktopHelper = require('../../common/desktop_helper'); |
| 5 | + |
| 6 | +describe(['tagmultiuser'], 'Checkbox Widget Test', function () { |
| 7 | + |
| 8 | + beforeEach(function() { |
| 9 | + helper.setupAndLoadDocument('writer/annotation.odt',true); |
| 10 | + cy.viewport(1920,1080); |
| 11 | + desktopHelper.switchUIToNotebookbar(); |
| 12 | + }); |
| 13 | + |
| 14 | + it('Ruler Toggle', function() { |
| 15 | + // select the first client and goto view tab |
| 16 | + cy.cSetActiveFrame('#iframe1'); |
| 17 | + cy.cGet('#View-tab-label').click(); |
| 18 | + |
| 19 | + // assert ruler visibility and check the checkbox |
| 20 | + cy.cGet('#showruler').should('be.visible'); |
| 21 | + cy.cGet('#showruler').should('have.class', 'ui-checkbox'); |
| 22 | + cy.cGet('#showruler-input').should('be.visible'); |
| 23 | + cy.cGet('#showruler-input').should('not.be.checked'); |
| 24 | + cy.cGet('.cool-ruler').should('not.be.visible'); |
| 25 | + |
| 26 | + cy.cGet('#showruler-input').check({ force: true }); |
| 27 | + cy.cGet('#showruler-input').should('be.checked'); |
| 28 | + cy.cGet('.cool-ruler').should('be.visible'); |
| 29 | + |
| 30 | + // switch to the second client and assert ruler before and after reload |
| 31 | + cy.cSetActiveFrame('#iframe2'); |
| 32 | + cy.cGet('#View-tab-label').click(); |
| 33 | + cy.pause(); |
| 34 | + |
| 35 | + // ruler not visible before reload |
| 36 | + cy.cGet('#showruler').should('be.visible'); |
| 37 | + cy.cGet('#showruler').should('have.class', 'ui-checkbox'); |
| 38 | + cy.cGet('#showruler-input').should('be.visible'); |
| 39 | + cy.cGet('#showruler-input').should('not.be.checked'); |
| 40 | + cy.cGet('.cool-ruler').should('not.be.visible'); |
| 41 | + cy.pause(); |
| 42 | + |
| 43 | + // reload |
| 44 | + cy.cSetActiveFrame('#iframe2'); |
| 45 | + cy.get('#form2').submit(); |
| 46 | + cy.wait(1000); |
| 47 | + helper.documentChecks(true); |
| 48 | + cy.pause(); |
| 49 | + |
| 50 | + // ruler visible after reload |
| 51 | + cy.cGet('#View-tab-label').click(); |
| 52 | + cy.pause(); |
| 53 | + cy.cGet('#showruler-input').should('be.checked'); |
| 54 | + cy.cGet('.cool-ruler').should('be.visible'); |
| 55 | + }); |
| 56 | +}); |
0 commit comments