libreoffice-online/cypress_test/integration_tests/desktop/shape_operations_spec.js

35 lines
897 B
JavaScript
Raw Normal View History

/* global describe it cy require expect afterEach*/
var helper = require('../common/helper');
describe('Shape operations', function() {
afterEach(function() {
helper.afterAll();
});
it('Insert a simple shape.', function() {
helper.loadTestDoc('shape_operations.odt');
// Scroll on the up toolbar
cy.get('#toolbar-up .w2ui-scroll-right').click();
cy.get('.w2ui-tb-image.w2ui-icon.basicshapes_ellipse')
.should('be.visible')
.click();
// Insert a rectangle
cy.get('.col.w2ui-icon.basicshapes_rectangle')
.click({force : true});
cy.get('.leaflet-pane.leaflet-overlay-pane svg g')
.should('exist');
// Check whether the rectangle was inserted as an SVG
cy.get('.leaflet-pane.leaflet-overlay-pane svg')
.then(function(svg) {
expect(svg[0].getBBox().width).to.be.greaterThan(0);
expect(svg[0].getBBox().height).to.be.greaterThan(0);
});
});
});