cypress_test/integration_tests/mobile/writer/table_properties_spec.js |   41 
++++------
 1 file changed, 18 insertions(+), 23 deletions(-)

New commits:
commit 8a8a00b3a0472ff93c81901a95f10f23d91210d2
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Sun Apr 26 11:14:08 2020 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Sun Apr 26 12:07:38 2020 +0200

    cypress: mobile: then(callbackFn) -> should(callbackFn)
    
    It's better to use should, when we need an indicator.
    
    Change-Id: I5d1fe825fdd6b20f98ce179c7cb6260ec0966928
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92918
    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 d709a1ac7..727bf194d 100644
--- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
@@ -56,8 +56,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
 
                // Check rows / columns
                cy.get('#copy-paste-container tr')
-                       .should('have.length', 4)
-                       .then(function(rows) {
+                       .should(function(rows) {
+                               expect(rows).to.have.lengthOf(4);
                                
expect(rows[0].textContent).to.not.have.string('text');
                                
expect(rows[1].textContent).to.have.string('text');
                        });
@@ -87,8 +87,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
 
                // Check rows / columns
                cy.get('#copy-paste-container tr')
-                       .should('have.length', 4)
-                       .then(function(rows) {
+                       .should(function(rows) {
+                               expect(rows).to.have.lengthOf(4);
                                
expect(rows[0].textContent).to.have.string('text');
                                
expect(rows[1].textContent).to.not.have.string('text');
                        });
@@ -120,8 +120,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
                cy.get('#copy-paste-container tr')
                        .should('have.length', 3);
                cy.get('#copy-paste-container td')
-                       .should('have.length', 9)
-                       .then(function(columns) {
+                       .should(function(columns) {
+                               expect(columns).to.have.lengthOf(9);
                                
expect(columns[0].textContent).to.not.have.string('text');
                                
expect(columns[1].textContent).to.have.string('text');
                        });
@@ -151,8 +151,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
                cy.get('#copy-paste-container tr')
                        .should('have.length', 3);
                cy.get('#copy-paste-container td')
-                       .should('have.length', 9)
-                       .then(function(columns) {
+                       .should(function(columns) {
+                               expect(columns).to.have.lengthOf(9);
                                
expect(columns[0].textContent).to.have.string('text');
                                
expect(columns[1].textContent).to.not.have.string('text');
                        });
@@ -180,10 +180,10 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
 
                // Check rows / columns
                cy.get('#copy-paste-container tr')
-                       .should('have.length', 2)
-                       .then(function(columns) {
-                               
expect(columns[0].textContent).to.not.have.string('text');
-                               
expect(columns[1].textContent).to.not.have.string('text');
+                       .should(function(rows) {
+                               expect(rows).to.have.lengthOf(2);
+                               
expect(rows[0].textContent).to.not.have.string('text');
+                               
expect(rows[1].textContent).to.not.have.string('text');
                        });
                cy.get('#copy-paste-container td')
                        .should('have.length', 4);
@@ -213,8 +213,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
                cy.get('#copy-paste-container tr')
                        .should('have.length', 3);
                cy.get('#copy-paste-container td')
-                       .should('have.length', 3)
-                       .then(function(columns) {
+                       .should(function(columns) {
+                               expect(columns).to.have.lengthOf(3);
                                
expect(columns[0].textContent).to.not.have.string('text');
                                
expect(columns[1].textContent).to.not.have.string('text');
                                
expect(columns[2].textContent).to.not.have.string('text');
@@ -246,7 +246,7 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
 
                // Check markers are in the same row (we have text selection 
only)
                cy.get('.leaflet-marker-icon')
-                       .then(function(markers) {
+                       .should(function(markers) {
                                expect(markers).to.have.lengthOf(2);
                                
expect(markers[0].getBoundingClientRect().top).to.equal(markers[1].getBoundingClientRect().top);
                        });
@@ -397,8 +397,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
                        .should('not.have.attr', 'height');
 
                cy.get('#copy-paste-container td')
-                       .then(function(items) {
-                               expect(items).have.lengthOf(6);
+                       .should(function(items) {
+                               expect(items).to.have.lengthOf(6);
                                for (var i = 0; i < items.length; i++) {
                                        if (i == 0 || i == 4)
                                                
expect(items[i]).have.attr('height', '33');
@@ -432,13 +432,8 @@ describe('Change table properties / layout via mobile 
wizard.', function() {
                writerHelper.selectAllMobile();
 
                // Check new row height
-               cy.get('#copy-paste-container td:nth-of-type(1n)')
-                       .should('have.attr', 'height');
-               cy.get('#copy-paste-container td:nth-of-type(2n)')
-                       .should('not.have.attr', 'height');
-
                cy.get('#copy-paste-container td')
-                       .then(function(items) {
+                       .should(function(items) {
                                expect(items).have.lengthOf(6);
                                for (var i = 0; i < items.length; i++) {
                                        if (i == 0 || i == 4)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to