[Libreoffice-commits] online.git: cypress_test/integration_tests

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 18 09:15:11 UTC 2020


 cypress_test/integration_tests/common/helper.js               |    6 ++-
 cypress_test/integration_tests/common/impress.js              |    4 ++
 cypress_test/integration_tests/mobile/writer/writer_helper.js |   20 +---------
 3 files changed, 12 insertions(+), 18 deletions(-)

New commits:
commit 6e70407ba1a24c8a83b466d4556dea37317ac502
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Mon Mar 16 16:27:00 2020 -0400
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Mar 18 10:14:53 2020 +0100

    cypress: reuse select-all helper
    
    Change-Id: I96a695dd96c07ab977ea0814117c642923e2f4db
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90648
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/cypress_test/integration_tests/common/helper.js b/cypress_test/integration_tests/common/helper.js
index 849b71cab..664e5f202 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -94,8 +94,12 @@ function selectAllText() {
 
 	cy.log('Select all text');
 
+	// Trigger select all
 	cy.get('textarea.clipboard')
-		.type('{ctrl}a').wait(300);
+		.type('{ctrl}a');
+
+	cy.get('.leaflet-marker-icon')
+		.should('exist');
 }
 
 // Clear all text by selecting all and deleting.
diff --git a/cypress_test/integration_tests/common/impress.js b/cypress_test/integration_tests/common/impress.js
index d6463fafc..6e1e59c55 100644
--- a/cypress_test/integration_tests/common/impress.js
+++ b/cypress_test/integration_tests/common/impress.js
@@ -54,6 +54,10 @@ function typeTextAndVerify(text, expected) {
 
 	helper.selectAllText();
 
+	//FIXME: Should retry the next check instead of
+	// an unreliable sleep, but for now this will do.
+	cy.wait(600);
+
 	helper.expectTextForClipboard(expected);
 }
 
diff --git a/cypress_test/integration_tests/mobile/writer/writer_helper.js b/cypress_test/integration_tests/mobile/writer/writer_helper.js
index a80d1e89c..e9e9ef59b 100644
--- a/cypress_test/integration_tests/mobile/writer/writer_helper.js
+++ b/cypress_test/integration_tests/mobile/writer/writer_helper.js
@@ -96,26 +96,12 @@ function clearMobileWizardState() {
 
 function selectAllMobile() {
 	// Remove selection if exist
+	//FIXME: this also gives the focus to the Writer doc,
+	// which shouldn't be needed (i.e. should have focus already).
 	cy.get('#document-container')
 		.type('{downarrow}');
-	cy.get('.leaflet-marker-icon')
-		.should('not.exist');
 
-	// Enable editing if it's in read-only mode
-	cy.get('#mobile-edit-button')
-		.then(function(button) {
-			if (button.css('display') !== 'none') {
-				cy.get('#mobile-edit-button')
-					.click();
-			}
-		});
-
-	// Trigger select all
-	cy.get('textarea.clipboard')
-		.type('{ctrl}a');
-
-	cy.get('.leaflet-marker-icon')
-		.should('exist');
+	helper.selectAllText();
 }
 
 module.exports.copyTextToClipboard = copyTextToClipboard;


More information about the Libreoffice-commits mailing list