cypress_test/integration_tests/mobile/impress/spellchecking_spec.js | 34 ++-------- 1 file changed, 10 insertions(+), 24 deletions(-)
New commits: commit dd20af0f9c68c78cca77e19918e3e1a495666b87 Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Mon Jun 22 13:25:48 2020 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Mon Jun 22 16:04:43 2020 +0200 cypress: stabilize impress/spellchecking_spec.js test. Change-Id: I56af585641cf9c19d1546ec4df999a68f119301c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96857 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js index 2a16ef837..808f0a879 100644 --- a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js +++ b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js @@ -28,31 +28,18 @@ describe('Spell checking menu.', function() { .dblclick(XPos, YPos); }); - cy.get('.leaflet-cursor.blinking-cursor') - .should('exist'); + cy.get('textarea.clipboard') + .type('{leftArrow}'); - helper.selectAllText(false); + cy.get('.leaflet-marker-icon') + .should('not.exist'); // Open context menu - cy.get('.leaflet-marker-icon') - .then(function(markers) { - expect(markers.length).to.have.greaterThan(1); - for (var i = 0; i < markers.length; i++) { - if (markers[i].classList.contains('leaflet-selection-marker-start')) { - var XPos = markers[i].getBoundingClientRect().right + 10; - } else if (markers[i].classList.contains('leaflet-selection-marker-end')) { - var YPos = markers[i].getBoundingClientRect().top - 10; - } - } - - cy.get('.leaflet-cursor.blinking-cursor') - .should('exist'); - - // Remove selection - cy.get('body') - .type('{leftarrow}'); - cy.get('.leaflet-marker-icon') - .should('not.exist'); + cy.get('g path.leaflet-interactive') + .then(function(shape) { + expect(shape.length).to.be.equal(1); + var XPos = (shape[0].getBoundingClientRect().left + shape[0].getBoundingClientRect().right) / 2; + var YPos = (shape[0].getBoundingClientRect().top + shape[0].getBoundingClientRect().bottom) / 2; mobileHelper.longPressOnDocument(XPos, YPos); }); @@ -69,8 +56,7 @@ describe('Spell checking menu.', function() { helper.selectAllText(false); - cy.get('#copy-paste-container pre') - .should('contain.text', 'hello'); + helper.expectTextForClipboard('hello'); }); it('Ignore all.', function() { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits