summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2020-07-10 13:49:14 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2020-07-10 18:30:13 +0200
commit4fd2d2c56a4df1caf75fa6f87b6dff55fff42215 (patch)
treeeb9da1de66b1788e34848ecf5aba99a603aa9dfc
parentsplit-panes: use document coordinates for paths in "fixed" svg container (diff)
downloadonline-4fd2d2c56a4df1caf75fa6f87b6dff55fff42215.tar.gz
online-4fd2d2c56a4df1caf75fa6f87b6dff55fff42215.zip
cypress: some more tests for impress's hamburger menu (mobile).
Change-Id: I3eb5afe1e67911b71e3152181c38eb2a2f9016f9 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98524 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js107
-rw-r--r--cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js7
2 files changed, 113 insertions, 1 deletions
diff --git a/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js
index 8f870fe839..51dc9e68eb 100644
--- a/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js
@@ -360,4 +360,111 @@ describe('Trigger hamburger menu options.', function() {
cy.get('.leaflet-selection-marker-start')
.should('be.visible');
});
+
+ it('Full Screen.', function() {
+ before('hamburger_menu.odp');
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Full Screen')
+ .click();
+
+ // TODO: We can't hit the actual full screen from cypress
+ cy.wait(500);
+ });
+
+ it('Automatic spell checking.', function() {
+ before('hamburger_menu.odp');
+
+ // Add a spelling error to the shape
+ impressMobileHelper.selectTextShapeInTheCenter();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition tspan')
+ .should('have.text', 'X');
+
+ // Type a new character
+ dblclickOnShape();
+
+ cy.get('textarea.clipboard')
+ .type('qqqqqq');
+
+ impressMobileHelper.triggerNewSVGForShapeInTheCenter();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition tspan')
+ .should('have.text', 'Xqqqqqq');
+
+ // Make everything white on tile
+ impressMobileHelper.selectTextOfShape();
+
+ mobileHelper.openMobileWizard();
+
+ helper.clickOnIdle('#TextPropertyPanel');
+
+ cy.get('#Bold')
+ .should('be.visible');
+
+ helper.clickOnIdle('#Color');
+
+ mobileHelper.selectFromColorPalette(0, 0, 7);
+
+ mobileHelper.closeMobileWizard();
+
+ impressMobileHelper.removeShapeSelection();
+
+ var preiew = '.preview-frame:nth-of-type(2) img';
+ helper.imageShouldBeFullWhiteOrNot(preiew, false);
+
+ // Disable automatic spell checking
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Automatic Spell Checking')
+ .click();
+
+ helper.imageShouldBeFullWhiteOrNot(preiew, true);
+ });
+
+ it('Fullscreen presentation.', function() {
+ before('hamburger_menu.odp');
+
+ cy.get('iframe.leaflet-slideshow')
+ .should('not.exist');
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Fullscreen presentation')
+ .click();
+
+ cy.get('iframe.leaflet-slideshow')
+ .should('exist');
+ });
+
+ it('Check version information.', function() {
+ before('hamburger_menu.odp');
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'About')
+ .click();
+
+ cy.get('.vex-content')
+ .should('exist');
+
+ // Check the version
+ if (helper.getLOVersion() === 'master') {
+ cy.contains('#lokit-version', 'LibreOffice')
+ .should('exist');
+ } else if (helper.getLOVersion() === 'cp-6-2' ||
+ helper.getLOVersion() === 'cp-6-4')
+ {
+ cy.contains('#lokit-version', 'Collabora Office')
+ .should('exist');
+ }
+
+ // Close about dialog
+ cy.get('.vex-close')
+ .click({force : true});
+
+ cy.get('.vex-content')
+ .should('not.exist');
+ });
});
diff --git a/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js b/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js
index 24f2caade3..90702bd90a 100644
--- a/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js
+++ b/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js
@@ -40,7 +40,7 @@ function selectTextOfShape() {
helper.selectAllText(false);
}
-function triggerNewSVGForShapeInTheCenter() {
+function removeShapeSelection() {
// Remove selection first with clicking next to the rotate handler
cy.get('.transform-handler--rotate')
.then(function(items) {
@@ -57,6 +57,10 @@ function triggerNewSVGForShapeInTheCenter() {
cy.get('.leaflet-drag-transform-marker')
.should('not.exist');
+}
+
+function triggerNewSVGForShapeInTheCenter() {
+ removeShapeSelection();
// If we click too fast on the shape again
// then it steps into edit mode, might be a bug
@@ -69,3 +73,4 @@ function triggerNewSVGForShapeInTheCenter() {
module.exports.selectTextShapeInTheCenter = selectTextShapeInTheCenter;
module.exports.triggerNewSVGForShapeInTheCenter = triggerNewSVGForShapeInTheCenter;
module.exports.selectTextOfShape = selectTextOfShape;
+module.exports.removeShapeSelection = removeShapeSelection;