cypress_test/integration_tests/common/helper.js                  |   16 
++++++++++
 cypress_test/integration_tests/desktop/writer/form_field_spec.js |    4 --
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 8aab73a4e21caebbda514cbaaa176249c0784fc7
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Mon Aug 10 16:25:56 2020 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Tue Aug 11 12:09:14 2020 +0200

    cypress: wait for the sidebar after load in dekstop tests.
    
    The sidebar is opened after the document is opened.
    Opening the sidebar affects the whole layout, so better
    to wait until it's finished before we start to interact
    with the document.
    
    Change-Id: I15537e8823d1c6c80fb586eb3560103b9173f37c
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100442
    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/common/helper.js 
b/cypress_test/integration_tests/common/helper.js
index 5201f34fe..51abe98a6 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -56,6 +56,22 @@ function loadTestDoc(fileName, subFolder, noFileCopy) {
        // Wait for the document to fully load
        cy.get('.leaflet-tile-loaded', {timeout : 
Cypress.config('defaultCommandTimeout') * 2.0});
 
+       // Wait for the sidebar to open.
+       doIfOnDesktop(function() {
+               cy.get('#sidebar-panel')
+                       .should('be.visible');
+
+               // Check that the document does not take the whole window width.
+               cy.window()
+                       .then(function(win) {
+                               cy.get('#document-container')
+                                       .should(function(doc) {
+                                               expect(doc).to.have.lengthOf(1);
+                                               
expect(doc[0].getBoundingClientRect().right).to.be.lessThan(win.innerWidth * 
0.95);
+                                       });
+                       });
+       });
+
        cy.log('Loading test document - end.');
 }
 
diff --git a/cypress_test/integration_tests/desktop/writer/form_field_spec.js 
b/cypress_test/integration_tests/desktop/writer/form_field_spec.js
index cd8dcb9e7..0f6c44390 100644
--- a/cypress_test/integration_tests/desktop/writer/form_field_spec.js
+++ b/cypress_test/integration_tests/desktop/writer/form_field_spec.js
@@ -9,10 +9,6 @@ describe('Form field button tests.', function() {
                testFileName = fileName;
                helper.beforeAll(fileName, 'writer');
 
-               // Wait for the sidebar to change the zoom level by load
-               cy.get('#tb_actionbar_item_zoom .w2ui-tb-caption')
-                       .should('not.have.text', '100');
-
                cy.get('#document-container')
                        .click();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to