cypress_test/integration_tests/mobile/writer/table_properties_spec.js | 41 ++++------ 1 file changed, 20 insertions(+), 21 deletions(-)
New commits: commit 7de5068426628df13d5b7d033a6d014664c0fa5a Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Tue Feb 18 16:25:22 2020 +0100 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Tue Feb 18 18:27:32 2020 +0100 cypress: mobile: Update table reated tests. There is no focus any more after selecting the table, so we need to use a different method for moving the cursor in the first cell. Change-Id: I9d03337d7cb710224a892472f0989896d2e03024 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88971 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js index 249dc413d..fed1ff70c 100644 --- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js +++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js @@ -22,6 +22,19 @@ describe('Change table properties / layout via mobile wizard.', function() { .should('not.have.class', 'disabled'); } + function moveCursorToFirstCell() { + helper.selectAllMobile(); + + cy.get('.blinking-cursor') + .then(function(cursor) { + expect(cursor).to.have.lengthOf(1) ; + var posX = cursor[0].getBoundingClientRect().right + 10; + var posY = cursor[0].getBoundingClientRect().top + 10; + cy.get('body') + .click(posX, posY); + }); + } + it('Insert row before.', function() { // TODO: Select all does not work with core/master // Table panel layout is also broken @@ -295,9 +308,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{shift}{downarrow}{rightarrow}'); @@ -408,9 +419,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table_with_text.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{leftarrow}{shift}{downarrow}{downarrow}{downarrow}{rightarrow}'); @@ -444,9 +453,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table_with_text.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{leftarrow}{shift}{downarrow}{downarrow}{downarrow}{rightarrow}'); @@ -490,9 +497,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table_with_text.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{leftarrow}{shift}{downarrow}{downarrow}{downarrow}{rightarrow}'); @@ -536,9 +541,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table_with_text.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{leftarrow}{shift}{downarrow}{downarrow}{downarrow}{rightarrow}'); @@ -577,9 +580,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table_with_text.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{leftarrow}{shift}{downarrow}{downarrow}{downarrow}{rightarrow}'); @@ -621,9 +622,7 @@ describe('Change table properties / layout via mobile wizard.', function() { before('table_with_text.odt'); - // Select All + left arrow -> we have the cursor in the table - helper.selectAllMobile(); - cy.get('body').type('{leftarrow}'); + moveCursorToFirstCell(); cy.get('body').type('{leftarrow}{shift}{downarrow}{downarrow}{downarrow}{rightarrow}'); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits