libreoffice-online/cypress_test/integration_tests/common/writer_helper.js
NickWingate a70415fe7b cypress: add tests for file properties
- test document description
- write test for custom properties
    - text, duration, yes/no types
    - disabled until core implements custom props

Signed-off-by: NickWingate <nick.wingate@collabora.com>
Change-Id: If0205b90d899772ac8f7f98d4eda2cbc23117d0f
2022-08-16 16:04:22 +02:00

42 lines
1.3 KiB
JavaScript

/* global cy require*/
var helper = require('./helper');
var desktopHelper = require('./desktop_helper');
// A special text selection method for Writer. It selects
// all text of the document, but it also removes previous
// selection if exists. This selection removal is helpful,
// when we use the copy-paste-container to check the selected
// text's content, because reselection will force an update
// on this content, so we don't need to worry about testing an
// out-dated content.
function selectAllTextOfDoc() {
cy.log('Select all text of Writer document - start.');
// Remove selection if exist
cy.wait(500);
cy.get('.leaflet-marker-pane')
.then(function(body) {
if (body.find('.leaflet-selection-marker-start').length !== 0) {
helper.typeIntoDocument('{downarrow}');
cy.wait(1000);
}
});
cy.get('.leaflet-selection-marker-start')
.should('not.exist');
helper.selectAllText();
cy.log('Select all text of Writer document - end.');
}
function openFileProperties() {
desktopHelper.actionOnSelector('fileTab', (selector) => { cy.get(selector).click(); });
desktopHelper.actionOnSelector('documentProperties', (selector) => { cy.get(selector).click(); });
}
module.exports.selectAllTextOfDoc = selectAllTextOfDoc;
module.exports.openFileProperties = openFileProperties;