cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js | 73 -------- cypress_test/integration_tests/mobile/writer/focus_spec.js | 87 ++++++++++ 2 files changed, 87 insertions(+), 73 deletions(-)
New commits: commit 45886322e72cfce1ba21641cf9211497240e37b8 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Wed Mar 18 19:26:40 2020 +0100 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Thu Mar 19 12:32:52 2020 +0100 cypress: mobile: move focus related tests to focus_spec.js. Change-Id: Ib8719f6d14e578ffc0125077942c063f4b5f3f37 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90718 Tested-by: Tamás Zolnai <tamas.zol...@collabora.com> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js b/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js index fd23fd030..a0c484eba 100644 --- a/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js +++ b/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js @@ -34,30 +34,6 @@ describe('Pushing bottom toolbar items.', function() { .should('exist'); }); - it('Apply bold, check keyboard.', function() { - cy.get('#document-container') - .type('{downarrow}'); - helper.selectAllText(); - - cy.get('#tb_editbar_item_bold div table') - .should('not.have.class', 'checked'); - - cy.window().then(win => { - win.lastInputState = win.map._textInput.shouldAcceptInput(); - }); - - cy.get('#tb_editbar_item_bold') - .click(); - - cy.get('#tb_editbar_item_bold div table') - .should('have.class', 'checked'); - - cy.window().then(win => { - var acceptInput = win.map._textInput.shouldAcceptInput(); - expect(acceptInput, 'Should accept input').to.equal(win.lastInputState); - }); - }); - it('Apply italic.', function() { cy.get('#tb_editbar_item_italic div table') .should('not.have.class', 'checked'); @@ -73,31 +49,6 @@ describe('Pushing bottom toolbar items.', function() { cy.get('#copy-paste-container p i') .should('exist'); }); - - it('Apply italic, check keyboard.', function() { - cy.get('#document-container') - .type('{downarrow}'); - helper.selectAllText(); - - cy.get('#tb_editbar_item_italic div table') - .should('not.have.class', 'checked'); - - cy.window().then(win => { - win.lastInputState = win.map._textInput.shouldAcceptInput(); - }); - - cy.get('#tb_editbar_item_italic') - .click(); - - cy.get('#tb_editbar_item_italic div table') - .should('have.class', 'checked'); - - cy.window().then(win => { - var acceptInput = win.map._textInput.shouldAcceptInput(); - expect(acceptInput, 'Should accept input').to.equal(win.lastInputState); - }); - }); - it('Apply underline.', function() { cy.get('#tb_editbar_item_underline div table') .should('not.have.class', 'checked'); @@ -114,30 +65,6 @@ describe('Pushing bottom toolbar items.', function() { .should('exist'); }); - it('Apply underline, check keyboard.', function() { - cy.get('#document-container') - .type('{downarrow}'); - helper.selectAllText(); - - cy.get('#tb_editbar_item_underline div table') - .should('not.have.class', 'checked'); - - cy.window().then(win => { - win.lastInputState = win.map._textInput.shouldAcceptInput(); - }); - - cy.get('#tb_editbar_item_underline') - .click(); - - cy.get('#tb_editbar_item_underline div table') - .should('have.class', 'checked'); - - cy.window().then(win => { - var acceptInput = win.map._textInput.shouldAcceptInput(); - expect(acceptInput, 'Should accept input').to.equal(win.lastInputState); - }); - }); - it('Apply strikeout.', function() { cy.get('#tb_editbar_item_strikeout div table') .should('not.have.class', 'checked'); diff --git a/cypress_test/integration_tests/mobile/writer/focus_spec.js b/cypress_test/integration_tests/mobile/writer/focus_spec.js index f1efae3ee..268324c58 100644 --- a/cypress_test/integration_tests/mobile/writer/focus_spec.js +++ b/cypress_test/integration_tests/mobile/writer/focus_spec.js @@ -274,4 +274,91 @@ describe('Focus tests', function() { cy.document().its('activeElement.tagName') .should('be.eq', 'BODY'); }); + + it('Apply bold, check keyboard.', function() { + // Click on edit button + helper.enableEditingMobile(); + + // Grab focus to the document + cy.get('#document-container') + .type('x'); + + helper.selectAllText(); + + cy.get('#tb_editbar_item_bold div table') + .should('not.have.class', 'checked'); + + cy.window().then(win => { + win.lastInputState = win.map._textInput.shouldAcceptInput(); + }); + + cy.get('#tb_editbar_item_bold') + .click(); + + cy.get('#tb_editbar_item_bold div table') + .should('have.class', 'checked'); + + cy.window().then(win => { + var acceptInput = win.map._textInput.shouldAcceptInput(); + expect(acceptInput, 'Should accept input').to.equal(win.lastInputState); + }); + }); + + it('Apply italic, check keyboard.', function() { + // Click on edit button + helper.enableEditingMobile(); + + // Grab focus to the document + cy.get('#document-container') + .type('x'); + + helper.selectAllText(); + + cy.get('#tb_editbar_item_italic div table') + .should('not.have.class', 'checked'); + + cy.window().then(win => { + win.lastInputState = win.map._textInput.shouldAcceptInput(); + }); + + cy.get('#tb_editbar_item_italic') + .click(); + + cy.get('#tb_editbar_item_italic div table') + .should('have.class', 'checked'); + + cy.window().then(win => { + var acceptInput = win.map._textInput.shouldAcceptInput(); + expect(acceptInput, 'Should accept input').to.equal(win.lastInputState); + }); + }); + + it('Apply underline, check keyboard.', function() { + // Click on edit button + helper.enableEditingMobile(); + + // Grab focus to the document + cy.get('#document-container') + .type('x'); + + helper.selectAllText(); + + cy.get('#tb_editbar_item_underline div table') + .should('not.have.class', 'checked'); + + cy.window().then(win => { + win.lastInputState = win.map._textInput.shouldAcceptInput(); + }); + + cy.get('#tb_editbar_item_underline') + .click(); + + cy.get('#tb_editbar_item_underline div table') + .should('have.class', 'checked'); + + cy.window().then(win => { + var acceptInput = win.map._textInput.shouldAcceptInput(); + expect(acceptInput, 'Should accept input').to.equal(win.lastInputState); + }); + }); }); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits