cypress_test/integration_tests/common/helper.js                       |   22 
++++++++++
 cypress_test/integration_tests/mobile/writer/shape_properties_spec.js |   14 
+-----
 2 files changed, 25 insertions(+), 11 deletions(-)

New commits:
commit 248fa4f21f2bd780ed9d03d7009835d1ef69806b
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Tue Feb 18 17:44:58 2020 +0100
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Tue Feb 18 18:33:57 2020 +0100

    cypress: mobile: Introduce a method to workaround wrong mobile wizard 
content.
    
    Change-Id: I59ceb56f049378c3e236822b0059d0413e107b95
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88973
    Tested-by: Tamás Zolnai <tamas.zol...@collabora.com>
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>

diff --git a/cypress_test/integration_tests/common/helper.js 
b/cypress_test/integration_tests/common/helper.js
index 8560880eb..388423ac2 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -206,6 +206,27 @@ function longPressOnDocument(posX, posY) {
                });
 }
 
+// Use this method when a test openes the same mobile
+// wizard more times during a test.
+// Recent issue with this scenario is that the mobile
+// wizard is opened first with an old content, then
+// when the sidebar's state arrives the wizard is
+// rerendered again which might cause a test failure
+// because the test finds the old HTML item
+// which will be detached from DOM.
+function clearMobileWizardState() {
+       // Open hamburger menu
+       cy.get('#toolbar-hamburger')
+               .click();
+
+       cy.get('.ui-header.level-0 .menu-entry-with-icon')
+               .contains('About');
+
+       // Close hamburger menu
+       cy.get('#toolbar-hamburger')
+               .click();
+}
+
 module.exports.loadTestDoc = loadTestDoc;
 module.exports.selectAllMobile = selectAllMobile;
 module.exports.copyTextToClipboard = copyTextToClipboard;
@@ -213,3 +234,4 @@ module.exports.copyTableToClipboard = copyTableToClipboard;
 module.exports.afterAll = afterAll;
 module.exports.beforeAllMobile = beforeAllMobile;
 module.exports.longPressOnDocument = longPressOnDocument;
+module.exports.clearMobileWizardState = clearMobileWizardState;
diff --git 
a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js 
b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
index 6f808ab75..27965cd68 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -31,11 +31,7 @@ describe('Change shape properties via mobile wizard.', 
function() {
        });
 
        function triggerNewSVG() {
-               // Reopen mobile wizard
-               cy.get('#tb_actionbar_item_mobile_wizard')
-                       .click();
-               cy.get('#mobile-wizard')
-                       .should('not.be.visible');
+               helper.clearMobileWizardState();
 
                cy.get('#tb_actionbar_item_mobile_wizard')
                        .click();
@@ -281,11 +277,7 @@ describe('Change shape properties via mobile wizard.', 
function() {
                cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g 
path[fill="none"]')
                        .should('have.attr', 'stroke-width', '141');
 
-               // Reopen mobile wizard
-               cy.get('#tb_actionbar_item_mobile_wizard')
-                       .click();
-               cy.get('#mobile-wizard')
-                       .should('not.be.visible');
+               helper.clearMobileWizardState();
 
                cy.get('#tb_actionbar_item_mobile_wizard')
                        .click();
@@ -317,7 +309,7 @@ describe('Change shape properties via mobile wizard.', 
function() {
                cy.get('#tb_actionbar_item_mobile_wizard')
                        .click();
 
-               // Change line color
+               // Change line transparency
                cy.get('#LinePropertyPanel')
                        .click();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to