cypress_test/Makefile.am | 1 cypress_test/data/mobile/calc/apply_font.ods |binary cypress_test/integration_tests/mobile/calc/apply_font_spec.js | 221 ++++++++++ 3 files changed, 222 insertions(+)
New commits: commit bbf31dc62aa518348553edffcf636bd20dbe98f1 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Tue Mar 10 13:26:04 2020 +0100 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Tue Mar 10 19:48:43 2020 +0100 cypress: mobile: test changing font properties in calc. Change-Id: I23b26ed9d9866bace0b8f83a7e54674d8c49d451 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90292 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am index ff1885dcc..f80fdcf39 100644 --- a/cypress_test/Makefile.am +++ b/cypress_test/Makefile.am @@ -31,6 +31,7 @@ export DISPLAY=$(if $(HEADLESS_BUILD),:$(DISPLAY_NUMBER),$(shell echo $$DISPLAY) if HAVE_LO_PATH MOBILE_TEST_FILES= \ + calc/apply_font_spec.js \ calc/focus_spec.js \ calc/insertion_wizard_spec.js \ impress/impress_focus_spec.js \ diff --git a/cypress_test/data/mobile/calc/apply_font.ods b/cypress_test/data/mobile/calc/apply_font.ods new file mode 100644 index 000000000..2e2c500fc Binary files /dev/null and b/cypress_test/data/mobile/calc/apply_font.ods differ diff --git a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js new file mode 100644 index 000000000..abd132d53 --- /dev/null +++ b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js @@ -0,0 +1,221 @@ +/* global describe it cy beforeEach require afterEach*/ + +var helper = require('../../common/helper'); +var calcHelper = require('./calc_helper'); + +describe('Apply font changes.', function() { + beforeEach(function() { + helper.beforeAllMobile('apply_font.ods', 'calc'); + + // Click on edit button + cy.get('#mobile-edit-button').click(); + + // Button should be enabled now + cy.get('#tb_actionbar_item_mobile_wizard') + .should('not.have.class', 'disabled'); + + calcHelper.clickOnFirstCell(); + + cy.get('.leaflet-marker-icon') + .should('be.visible'); + + // Open mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + cy.get('#mobile-wizard-content') + .should('not.be.empty'); + + // Open character properties + cy.get('#TextPropertyPanel') + .click(); + + cy.get('#Bold') + .should('be.visible') + .wait(100); + }); + + afterEach(function() { + helper.afterAll(); + }); + + it('Apply bold.', function() { + cy.get('#Bold') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td b') + .should('exist'); + }); + + it('Apply italic.', function() { + cy.get('#Italic') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td i') + .should('exist'); + }); + + it('Apply underline.', function() { + cy.get('#Underline') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td u') + .should('exist'); + }); + + it('Apply strikeout.', function() { + // Apply bold + cy.get('#Strikeout') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td s') + .should('exist'); + }); + + it('Apply shadowed.', function() { + // Apply bold + cy.get('#Shadowed') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + // TODO: Shadowed is not in the clipboard content. + }); + + it('Apply font name.', function() { + // Change font name + cy.get('#fontnamecombobox') + .click(); + + cy.get('.mobile-wizard.ui-combobox-text') + .contains('Linux Libertine G') + .click(); + + cy.get('#mobile-wizard-back') + .click(); + + // Combobox entry contains the selected font name + cy.get('#fontnamecombobox .ui-header-right') + .contains('Linux Libertine G'); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td font') + .should('have.attr', 'face', 'Linux Libertine G'); + }); + + it('Apply font size.', function() { + // Change font size + cy.get('#fontsizecombobox') + .click(); + + cy.get('.mobile-wizard.ui-combobox-text') + .contains('14') + .click(); + + cy.get('#mobile-wizard-back') + .click(); + + // Combobox entry contains the selected font name + cy.get('#fontsizecombobox .ui-header-right') + .contains('14'); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td font') + .should('have.attr', 'size', '4'); + }); + + it('Apply grow.', function() { + // Push grow + cy.get('#Grow') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + cy.get('#mobile-wizard-content') + .should('not.be.visible'); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td font') + .should('have.attr', 'size', '3'); + }); + + it('Apply shrink.', function() { + // Push shrink + cy.get('#Shrink') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + cy.get('#mobile-wizard-content') + .should('not.be.visible'); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td font') + .should('have.attr', 'size', '1'); + }); + + it('Apply font color.', function() { + // Change font color + cy.get('#Color') + .click(); + + cy.get('#color-picker-0-basic-color-5') + .click(); + + cy.get('#mobile-wizard-back') + .click(); + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + cy.get('#mobile-wizard-content') + .should('not.be.visible'); + + calcHelper.copyContentToClipboard(); + + cy.get('#copy-paste-container table td font') + .should('have.attr', 'color', '#00FF00'); + }); +}); + _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits