cypress_test/data/mobile/calc/focus.ods                   |binary
 cypress_test/data/mobile/calc/insertion_wizard.ods        |binary
 cypress_test/data/mobile/calc/spellchecking.ods           |binary
 cypress_test/integration_tests/mobile/calc/calc_helper.js |   35 ++++++--------
 cypress_test/integration_tests/mobile/calc/focus_spec.js  |    4 -
 5 files changed, 17 insertions(+), 22 deletions(-)

New commits:
commit 17464beec3dc5064e4eadbf8a179d6810870dbbb
Author:     Tamás Zolnai <[email protected]>
AuthorDate: Sat Apr 4 12:08:15 2020 +0200
Commit:     Tamás Zolnai <[email protected]>
CommitDate: Sat Apr 4 12:24:29 2020 +0200

    cypress: mobile: fix calc test documents.
    
    After this commit:
    9374a2883537d41d6994e5a77fd45bb5fbe9a0d7
    
    The view jumps to the cell cursor, so we should have
    the cell cursor at the first column to avoid view
    change after opening the document.
    
    Change-Id: Ie577ab932496a5506e69b84bf7ff362d98950e92
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91682
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Tamás Zolnai <[email protected]>

diff --git a/cypress_test/data/mobile/calc/insertion_wizard.ods 
b/cypress_test/data/mobile/calc/insertion_wizard.ods
index 4c86f1a9d..31dbedba9 100644
Binary files a/cypress_test/data/mobile/calc/insertion_wizard.ods and 
b/cypress_test/data/mobile/calc/insertion_wizard.ods differ
diff --git a/cypress_test/data/mobile/calc/spellchecking.ods 
b/cypress_test/data/mobile/calc/spellchecking.ods
index 431abff4e..d020226f0 100644
Binary files a/cypress_test/data/mobile/calc/spellchecking.ods and 
b/cypress_test/data/mobile/calc/spellchecking.ods differ
commit d55bb5e32b8ea3655f3436307353fe087f6f6003
Author:     Tamás Zolnai <[email protected]>
AuthorDate: Fri Apr 3 20:58:39 2020 +0200
Commit:     Tamás Zolnai <[email protected]>
CommitDate: Sat Apr 4 12:24:23 2020 +0200

    cypress: mobile: fix 'Focus on second tap.' test.
    
    The actual problem was with the test document.
    The selected cell was in the fourth column and
    the view jumpped to it. So I moved the cell cursor
    into the first column, so there will no jump when
    opening the document.
    
    Plus reworked clickOnFirstCell() a bit.
    
    Change-Id: Ic132d1ef5392c1653060f84caa6c39f2033f8598
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91661
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Tamás Zolnai <[email protected]>

diff --git a/cypress_test/data/mobile/calc/focus.ods 
b/cypress_test/data/mobile/calc/focus.ods
index ab2f20975..68532d2ff 100644
Binary files a/cypress_test/data/mobile/calc/focus.ods and 
b/cypress_test/data/mobile/calc/focus.ods differ
diff --git a/cypress_test/integration_tests/mobile/calc/calc_helper.js 
b/cypress_test/integration_tests/mobile/calc/calc_helper.js
index 0fd771dad..d6bd1d334 100644
--- a/cypress_test/integration_tests/mobile/calc/calc_helper.js
+++ b/cypress_test/integration_tests/mobile/calc/calc_helper.js
@@ -2,7 +2,7 @@
 
 var helper = require('../../common/helper');
 
-function clickOnFirstCell() {
+function clickOnFirstCell(firstClick = true, dblClick = false) {
        // Enable editing if it's in read-only mode
        helper.enableEditingMobile();
 
@@ -12,30 +12,25 @@ function clickOnFirstCell() {
                        expect(items).to.have.lengthOf(1);
                        var XPos = items[0].getBoundingClientRect().right + 10;
                        var YPos = items[0].getBoundingClientRect().top + 10;
-                       cy.get('body')
-                               .click(XPos, YPos);
+                       if (dblClick) {
+                               cy.get('body')
+                                       .dblclick(XPos, YPos);
+                       } else {
+                               cy.get('body')
+                                       .click(XPos, YPos);
+                       }
                });
 
-       cy.get('.spreadsheet-cell-resize-marker')
-               .should('exist');
+       if (firstClick && !dblClick)
+               cy.get('.spreadsheet-cell-resize-marker')
+                       .should('exist');
+       else
+               cy.get('.leaflet-cursor.blinking-cursor')
+                       .should('exist');
 }
 
 function dblClickOnFirstCell() {
-       // Enable editing if it's in read-only mode
-       helper.enableEditingMobile();
-
-       // Use the tile's edge to find the first cell's position
-       cy.get('.leaflet-tile-container')
-               .then(function(items) {
-                       expect(items).to.have.lengthOf(1);
-                       var XPos = items[0].getBoundingClientRect().right + 10;
-                       var YPos = items[0].getBoundingClientRect().top + 10;
-                       cy.get('body')
-                               .dblclick(XPos, YPos);
-               });
-
-       cy.get('.leaflet-cursor.blinking-cursor')
-               .should('exist');
+       clickOnFirstCell(false, true);
 }
 
 function copyContentToClipboard() {
diff --git a/cypress_test/integration_tests/mobile/calc/focus_spec.js 
b/cypress_test/integration_tests/mobile/calc/focus_spec.js
index 481d61165..c7c6d766d 100644
--- a/cypress_test/integration_tests/mobile/calc/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/focus_spec.js
@@ -45,7 +45,7 @@ describe('Calc focus tests', function() {
                        .should('be.eq', 'clipboard');
        });
 
-       it.skip('Focus on second tap.', function() {
+       it('Focus on second tap.', function() {
                // Click on edit button
                helper.enableEditingMobile();
 
@@ -64,7 +64,7 @@ describe('Calc focus tests', function() {
                        .should('be.eq', 'BODY');
 
                // Second tap on the same cell
-               calcHelper.clickOnFirstCell();
+               calcHelper.clickOnFirstCell(false);
 
                // Document has the focus
                cy.document().its('activeElement.className')
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to