cypress_test/integration_tests/mobile/calc/alignment_options_spec.js |  109 
+++++++++-
 1 file changed, 107 insertions(+), 2 deletions(-)

New commits:
commit 2fb4a9a1a824bc2bfc65ab8ce0ee73e1f36052b6
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Fri Apr 17 14:33:28 2020 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Fri Apr 17 16:16:00 2020 +0200

    cypress: mobile: add more test for text alignment options in calc.
    
    Change-Id: Ib3f92d879cdf5bc5a54ba4fa005b3da05737d580
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92449
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>

diff --git 
a/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js 
b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
index 2b1995aa0..bcc5170fa 100644
--- a/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
@@ -1,4 +1,4 @@
-/* global describe it cy beforeEach require afterEach*/
+/* global describe it cy beforeEach require afterEach expect*/
 
 import 'cypress-wait-until';
 
@@ -27,7 +27,7 @@ describe('Change alignment settings.', function() {
 
                helper.initAliasToNegative('currentTextPos');
 
-               cy.get('.leaflet-selection-marker-start')
+               cy.get('.leaflet-selection-marker-end')
                        .invoke('offset')
                        .its('left')
                        .as('currentTextPos');
@@ -266,4 +266,109 @@ describe('Change alignment settings.', function() {
                                });
                });
        });
+
+       it('Enable text wrapping.', function() {
+               helper.initAliasToNegative('originalTextPos');
+
+               getTextPosForFirstCell();
+               cy.get('@currentTextPos')
+                       .as('originalTextPos');
+
+               cy.get('@currentTextPos')
+                       .should('be.greaterThan', 0);
+
+               openAlignmentPaneForFirstCell();
+
+               cy.get('input#wraptext')
+                       .should('not.have.prop', 'checked', true);
+
+               cy.get('input#wraptext')
+                       .click();
+
+               cy.get('input#wraptext')
+                       .should('have.prop', 'checked', true);
+
+               // We use the text position as indicator
+               cy.waitUntil(function() {
+                       getTextPosForFirstCell();
+
+                       return cy.get('@currentTextPos')
+                               .then(function(currentTextPos) {
+                                       cy.get('@originalTextPos')
+                                               .then(function(originalTextPos) 
{
+                                                       return originalTextPos 
> currentTextPos;
+                                               });
+                               });
+               });
+       });
+
+       it('Apply stacked option.', function() {
+               openAlignmentPaneForFirstCell();
+
+               cy.get('input#stacked')
+                       .should('not.have.prop', 'checked', true);
+
+               cy.get('input#stacked')
+                       .click();
+
+               cy.get('input#stacked')
+                       .should('have.prop', 'checked', true);
+
+               cy.wait(500);
+
+               // TODO: we don't have a good indicator here
+               // neither the text position nor the clipboard container does 
not help here.
+       });
+
+       it('Merge cells.', function() {
+               // Select the full row
+               cy.get('.spreadsheet-header-rows')
+                       .then(function(items) {
+                               expect(items).to.have.lengthOf(1);
+
+                               var XPos = 
(items[0].getBoundingClientRect().right + 
items[0].getBoundingClientRect().left) / 2;
+                               var YPos = items[0].getBoundingClientRect().top 
+ 10;
+                               cy.get('body')
+                                       .click(XPos, YPos);
+                       });
+
+               cy.get('.spreadsheet-cell-resize-marker')
+                       .should('exist');
+
+               // Even after we get the cell row selection the merge cell 
options is still enabled
+               // So we open mobile wizard again and again until merge cells 
get the right state
+               mobileHelper.openMobileWizard();
+               cy.waitUntil(function() {
+                       mobileHelper.closeMobileWizard();
+                       mobileHelper.openMobileWizard();
+
+                       cy.get('#ScAlignmentPropertyPanel')
+                               .click();
+
+                       cy.get('#AlignLeft')
+                               .should('be.visible');
+
+                       return cy.get('input#mergecells')
+                               .then(function(items) {
+                                       expect(items).to.have.lengthOf(1);
+                                       return 
!items[0].hasAttribute('disabled');
+                               });
+               });
+
+               // Click merge cells
+               cy.get('input#mergecells')
+                       .should('not.have.prop', 'checked', true);
+
+               cy.get('input#mergecells')
+                       .click();
+
+               cy.get('input#mergecells')
+                       .should('have.prop', 'checked', true);
+
+               // Check content
+               calcHelper.copyContentToClipboard();
+
+               cy.get('#copy-paste-container table td')
+                       .should('have.attr', 'colspan', '1024');
+       });
 });
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to