cypress_test/Makefile.am | 1 cypress_test/integration_tests/mobile/writer/apply_font_spec.js | 70 ++++++ cypress_test/integration_tests/mobile/writer/styles_spec.js | 102 ---------- dev/null |binary 4 files changed, 70 insertions(+), 103 deletions(-)
New commits: commit 68924966c07043d1fdb631a4b35ae6645df9ca64 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Fri Mar 6 14:37:56 2020 +0100 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Fri Mar 6 15:19:34 2020 +0100 cypress: mobile: merge styles tests to font tests. There is not much more we can test about styles, since now we have only an apply style button. Change-Id: I92a1a6dc60701743af44928966475cf4471b317b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90108 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 13a769f08..5e7c13c7e 100644 --- a/cypress_test/Makefile.am +++ b/cypress_test/Makefile.am @@ -43,7 +43,6 @@ MOBILE_TEST_FILES= \ writer/mobile_wizard_state_spec.js \ writer/shape_properties_spec.js \ writer/spellchecking_spec.js \ - writer/styles_spec.js \ writer/table_properties_spec.js \ writer/toolbar_spec.js diff --git a/cypress_test/data/mobile/writer/styles.odt b/cypress_test/data/mobile/writer/styles.odt deleted file mode 100644 index f7494e82f..000000000 Binary files a/cypress_test/data/mobile/writer/styles.odt and /dev/null differ diff --git a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js index 4c38617e9..d5b9071ad 100644 --- a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js +++ b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js @@ -22,6 +22,45 @@ describe('Apply font changes.', function() { helper.afterAll(); }); + function applyStyle(styleName) { + // Do a new selection + helper.selectAllMobile(); + + // Open mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .should('not.have.class', 'disabled') + .click(); + + // Change font name + cy.get('#applystyle') + .click(); + + cy.wait(200); + + cy.get('#mobile-wizard-back') + .should('be.visible'); + + cy.get('.mobile-wizard.ui-combobox-text') + .contains(styleName) + .scrollIntoView(); + + cy.wait(200); + + cy.get('.mobile-wizard.ui-combobox-text') + .contains(styleName) + .click(); + + // Combobox entry contains the selected font name + if (styleName !== 'Clear formatting') { + cy.get('#applystyle .ui-header-right .entry-value') + .contains(styleName); + } + + // Close mobile wizard + cy.get('#tb_actionbar_item_mobile_wizard') + .click(); + } + it('Apply font name.', function() { // Change font name cy.get('#fontnamecombobox') @@ -285,5 +324,36 @@ describe('Apply font changes.', function() { cy.get('#Spacing') .should('not.exist'); }); + + it('Apply style.', function() { + // Apply Title style + applyStyle('Title'); + + helper.copyTextToClipboard(); + + cy.get('#copy-paste-container p font') + .should('have.attr', 'face', 'Liberation Sans, sans-serif'); + cy.get('#copy-paste-container p font font') + .should('have.attr', 'style', 'font-size: 28pt'); + + // Clear formatting + applyStyle('Clear formatting'); + + helper.copyTextToClipboard(); + + cy.get('#copy-paste-container p') + .should('have.attr', 'style', 'margin-bottom: 0in; line-height: 100%'); + }); + + it('New style and update style items are hidden.', function() { + cy.get('#applystyle') + .should('exist'); + + cy.get('#StyleUpdateByExample') + .should('not.exist'); + + cy.get('#StyleNewByExample') + .should('not.exist'); + }); }); diff --git a/cypress_test/integration_tests/mobile/writer/styles_spec.js b/cypress_test/integration_tests/mobile/writer/styles_spec.js deleted file mode 100644 index ec8eb9263..000000000 --- a/cypress_test/integration_tests/mobile/writer/styles_spec.js +++ /dev/null @@ -1,102 +0,0 @@ -/* global describe it cy beforeEach require afterEach*/ - -var helper = require('../../common/helper'); - -describe('Apply/modify styles.', function() { - beforeEach(function() { - helper.beforeAllMobile('styles.odt', 'writer'); - - // Click on edit button - cy.get('#mobile-edit-button').click(); - }); - - afterEach(function() { - helper.afterAll(); - }); - - function applyStyle(styleName) { - // Do a new selection - helper.selectAllMobile(); - - // Open mobile wizard - cy.get('#tb_actionbar_item_mobile_wizard') - .should('not.have.class', 'disabled') - .click(); - - // Change font name - cy.get('#applystyle') - .click(); - - cy.wait(200); - - cy.get('#mobile-wizard-back') - .should('be.visible'); - - cy.get('.mobile-wizard.ui-combobox-text') - .contains(styleName) - .scrollIntoView(); - - cy.wait(200); - - cy.get('.mobile-wizard.ui-combobox-text') - .contains(styleName) - .click(); - - // Combobox entry contains the selected font name - if (styleName !== 'Clear formatting') { - cy.get('#applystyle .ui-header-right .entry-value') - .contains(styleName); - } - - // Close mobile wizard - cy.get('#tb_actionbar_item_mobile_wizard') - .click(); - } - - it('Apply new style.', function() { - // Apply Title style - applyStyle('Title'); - - helper.copyTextToClipboard(); - - cy.get('#copy-paste-container p font') - .should('have.attr', 'face', 'Liberation Sans, sans-serif'); - cy.get('#copy-paste-container p font font') - .should('have.attr', 'style', 'font-size: 28pt'); - }); - - it('Clear style.', function() { - // Apply Title style - applyStyle('Title'); - - helper.copyTextToClipboard(); - - cy.get('#copy-paste-container p font') - .should('have.attr', 'face', 'Liberation Sans, sans-serif'); - cy.get('#copy-paste-container p font font') - .should('have.attr', 'style', 'font-size: 28pt'); - - // Clear formatting - applyStyle('Clear formatting'); - - helper.copyTextToClipboard(); - - cy.get('#copy-paste-container p') - .should('have.attr', 'style', 'margin-bottom: 0in; line-height: 100%'); - }); - - it('New style and update style items are hidden.', function() { - // Open mobile wizard - cy.get('#tb_actionbar_item_mobile_wizard') - .click(); - - cy.get('#applystyle') - .should('exist'); - - cy.get('#StyleUpdateByExample') - .should('not.exist'); - - cy.get('#StyleNewByExample') - .should('not.exist'); - }); -}); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits