libreoffice-online/cypress_test/integration_tests/desktop/writer/image_operation_spec.js
Rash419 8a83e5c2a8 cypress: fix: input element getting detached
*waitUntilIdle make sure that element remains attached to the DOM
*removed a specific configuration for multiuser tests in makefile and
 now it follows cypress.json config

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I2bfd22ef0b4d8306b944d772e3536206a207e00c
2022-01-26 19:19:03 +05:30

55 lines
1.4 KiB
JavaScript

/* global describe it require cy afterEach beforeEach */
var helper = require('../../common/helper');
var { insertImage, deleteImage, assertImageSize } = require('../../common/desktop_helper');
describe('Image Operation Tests', function() {
var origTestFileName = 'image_operation.odt';
var testFileName;
beforeEach(function() {
testFileName = helper.beforeAll(origTestFileName, 'writer');
});
afterEach(function() {
helper.afterAll(testFileName, this.currentTest.state);
});
it('Insert Image',function() {
insertImage();
//make sure that image is in focus
cy.get('.leaflet-pane.leaflet-overlay-pane svg g.leaflet-control-buttons-disabled')
.should('exist');
deleteImage();
});
it('Resize image when keep ratio option enabled and disabled', function() {
insertImage();
//when Keep ratio is unchecked
assertImageSize(248, 63);
helper.waitUntilIdle('#selectwidth input');
cy.get('#selectwidth input').clear({force:true})
.type('3{enter}', {force:true});
helper.waitUntilIdle('#selectheight input');
cy.get('#selectheight input').clear({force:true})
.type('2{enter}', {force:true});
assertImageSize(139, 93);
//Keep ratio checked
cy.get('#ratio input').check();
helper.waitUntilIdle('#selectheight input');
cy.get('#selectheight input').clear({force:true})
.type('5{enter}', {force:true});
assertImageSize(347, 232);
});
});