libreoffice-online/cypress_test/integration_tests/common/writer_helper.js
Tamás Zolnai 9ec53994f2 cypress: simplify selectAllText() helper method.
We use this method in various contexts, where it's not
necessary that we have the cursor of the focus. Focus can
be tested in focus related tests.

Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: Ic27de45917657d4ac1734565d81d5bbf190ad333
2021-02-05 16:38:23 +01:00

24 lines
566 B
JavaScript

/* global cy require*/
var helper = require('./helper');
function selectAllTextOfDoc() {
cy.log('Select all text of Writer document - start.');
// Remove selection if exist
cy.get('.leaflet-marker-pane')
.then(function(body) {
if (body.find('.leaflet-selection-marker-start').length !== 0) {
helper.typeIntoDocument('{downarrow}');
}
});
cy.get('.leaflet-selection-marker-start')
.should('not.exist');
helper.selectAllText();
cy.log('Select all text of Writer document - end.');
}
module.exports.selectAllTextOfDoc = selectAllTextOfDoc;