collabora-online/cypress_test/integration_tests/mobile/impress/annotation_spec.js

68 lines
2.2 KiB
JavaScript

/* global describe it cy beforeEach require */
var helper = require('../../common/helper');
var mobileHelper = require('../../common/mobile_helper');
describe(['tagmobile'], 'Annotation tests.', function() {
var newFileName;
beforeEach(function() {
newFileName = helper.setupAndLoadDocument('impress/annotation.odp');
mobileHelper.enableEditingMobile();
});
it('Saving comment.', function() {
mobileHelper.insertComment();
mobileHelper.selectHamburgerMenuItem(['File', 'Save']);
helper.reloadDocument(newFileName,'impress');
mobileHelper.enableEditingMobile();
mobileHelper.openCommentWizard();
cy.cGet('#mobile-wizard .wizard-comment-box .cool-annotation-content')
.should('have.text', 'some text');
});
it('Modifying comment.', function() {
mobileHelper.insertComment();
mobileHelper.selectAnnotationMenuItem('Modify');
cy.cGet('.cool-annotation-table').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text', 'some text');
cy.cGet('#input-modal-input').type('modified');
cy.cGet('#response-ok').click();
cy.cGet('#toolbar-up #comment_wizard').click();
cy.cGet('#annotation-content-area-1').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text', 'some textmodified');
});
it('Remove comment.', function() {
mobileHelper.insertComment();
cy.cGet('.leaflet-marker-icon.annotation-marker').should('be.visible');
cy.cGet('#mobile-wizard .wizard-comment-box .cool-annotation-content').should('have.text', 'some text');
mobileHelper.selectAnnotationMenuItem('Remove');
cy.cGet('#mobile-wizard .wizard-comment-box .cool-annotation-content').should('not.exist');
cy.cGet('.leaflet-marker-icon.annotation-marker').should('not.exist');
});
it('Try to insert empty comment.', function() {
mobileHelper.openInsertionWizard();
cy.cGet('body').contains('.menu-entry-with-icon', 'Comment').click();
cy.cGet('.cool-annotation-table').should('exist');
cy.cGet('#input-modal-input').should('have.text', '');
cy.cGet('#response-ok').click();
cy.cGet('.cool-annotation-content-wrapper.wizard-comment-box').should('not.exist');
cy.cGet('#mobile-wizard .wizard-comment-box .cool-annotation-content').should('not.exist');
});
});