cypress_test/data/mobile/writer/hamburger_menu.odt |binary cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js | 93 +++++++++- 2 files changed, 87 insertions(+), 6 deletions(-)
New commits: commit b9b4b6e5ef5fb123690ab7535926a772b029eb89 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Tue Jun 16 15:38:59 2020 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Wed Jun 17 16:51:04 2020 +0200 cypress: add tests for Formmating marks / spellchecking menus (writer, mobile) We use the tile images to check whether something appears on the tiles. In case of formatting marks it's the blue space indicators. In case of spell checking it's the red underlining. Change-Id: If57c3e8759e0c8cabfc6bb858af9519ddd662156 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96523 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/cypress_test/data/mobile/writer/hamburger_menu.odt b/cypress_test/data/mobile/writer/hamburger_menu.odt index bc1afc2f0..feb8f09cc 100644 Binary files a/cypress_test/data/mobile/writer/hamburger_menu.odt and b/cypress_test/data/mobile/writer/hamburger_menu.odt differ diff --git a/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js index 7ad042a2c..d70e11c60 100644 --- a/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js +++ b/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js @@ -18,6 +18,27 @@ describe('Trigger hamburger menu options.', function() { helper.afterAll(testFileName); }); + function hideText() { + // Change text color to white to hide text. + writerMobileHelper.selectAllMobile(); + + mobileHelper.openMobileWizard(); + + cy.get('#FontColor') + .click(); + + mobileHelper.selectFromColorPalette(0, 0, 7); + + // End remove spell checking red lines + mobileHelper.openHamburgerMenu(); + + cy.contains('.menu-entry-with-icon', 'View') + .click(); + + cy.contains('.menu-entry-with-icon', 'Automatic Spell Checking') + .click(); + } + it('Download as PDF', function() { mobileHelper.openHamburgerMenu(); @@ -650,31 +671,91 @@ describe('Trigger hamburger menu options.', function() { // Selected counts cy.get('#selectwords') - .should('have.text', '61'); + .should('have.text', '106'); cy.get('#selectchars') - .should('have.text', '689'); + .should('have.text', '1,174'); cy.get('#selectcharsnospaces') - .should('have.text', '629'); + .should('have.text', '1,069'); cy.get('#selectcjkchars') .should('have.text', '0'); // General counts cy.get('#docwords') - .should('have.text', '61'); + .should('have.text', '106'); cy.get('#docchars') - .should('have.text', '689'); + .should('have.text', '1,174'); cy.get('#doccharsnospaces') - .should('have.text', '629'); + .should('have.text', '1,069'); cy.get('#doccjkchars') .should('have.text', '0'); }); + it('Show formatting marks.', function() { + // Hide text so the center tile is full white. + hideText(); + + var centerTile = '.leaflet-tile-loaded[style=\'width: 256px; height: 256px; left: 255px; top: 261px;\']'; + helper.imageShouldBeFullWhiteOrNot(centerTile, true); + + // Enable it first -> spaces will be visible. + mobileHelper.openHamburgerMenu(); + + cy.contains('.menu-entry-with-icon', 'View') + .click(); + + cy.contains('.menu-entry-with-icon', 'Formatting Marks') + .click(); + + helper.imageShouldBeFullWhiteOrNot(centerTile, false); + + // Then disable it again. + mobileHelper.openHamburgerMenu(); + + cy.contains('.menu-entry-with-icon', 'View') + .click(); + + cy.contains('.menu-entry-with-icon', 'Formatting Marks') + .click(); + + helper.imageShouldBeFullWhiteOrNot(centerTile, true); + }); + + it('Automatic spell checking.', function() { + // Hide text so the center tile is full white. + hideText(); + + var centerTile = '.leaflet-tile-loaded[style=\'width: 256px; height: 256px; left: 255px; top: 261px;\']'; + helper.imageShouldBeFullWhiteOrNot(centerTile, true); + + // Enable it first. + mobileHelper.openHamburgerMenu(); + + cy.contains('.menu-entry-with-icon', 'View') + .click(); + + cy.contains('.menu-entry-with-icon', 'Automatic Spell Checking') + .click(); + + helper.imageShouldBeFullWhiteOrNot(centerTile, false); + + // Then disable it again. + mobileHelper.openHamburgerMenu(); + + cy.contains('.menu-entry-with-icon', 'View') + .click(); + + cy.contains('.menu-entry-with-icon', 'Automatic Spell Checking') + .click(); + + helper.imageShouldBeFullWhiteOrNot(centerTile, true); + }); + it('Check version information.', function() { mobileHelper.openHamburgerMenu(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits