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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 23 19:18:23 UTC 2020


 cypress_test/integration_tests/common/helper.js                          |    9 +++++++--
 cypress_test/integration_tests/mobile/writer/focus_spec.js               |    6 ++----
 cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js |    6 +++---
 cypress_test/integration_tests/mobile/writer/shape_properties_spec.js    |    5 +++++
 cypress_test/integration_tests/mobile/writer/writer_helper.js            |    9 +++------
 5 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 823207f244a95db8ef7c950a1cbd0a968bf573b6
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 23 18:26:00 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 23 20:18:09 2020 +0100

    cypress: mobile: fix-up shape related tests.
    
    Change-Id: Icbb0812e5c2446dc04010d11a79e692e89104f9f
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90932
    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/mobile/writer/shape_properties_spec.js b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
index 1bce30aac..a064538bd 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -44,6 +44,11 @@ describe('Change shape properties via mobile wizard.', function() {
 	});
 
 	function triggerNewSVG() {
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+		cy.get('#mobile-wizard')
+			.should('not.be.visible');
+
 		writerHelper.clearMobileWizardState();
 
 		cy.get('#tb_actionbar_item_mobile_wizard')
commit efa7d4a08a93678367f141249f6501f13e25d2b6
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 23 18:17:08 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Mar 23 20:17:59 2020 +0100

    cypress: mobile: better way of pushing hamburger menu button.
    
    Change-Id: Ifa4ebc3e490dddcdeee476c368b33a3cedd6ef17
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90931
    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 02a4cbdda..71ab8a92c 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -163,8 +163,7 @@ function afterAll(fileName) {
 function detectLOCoreVersion() {
 	if (Cypress.env('LO_CORE_VERSION') === undefined) {
 		// Open hamburger menu
-		cy.get('#toolbar-hamburger')
-			.click();
+		pushHamburgerMenuIconMobile();
 
 		// Open about dialog
 		cy.get('.ui-header.level-0 .menu-entry-with-icon')
@@ -220,6 +219,11 @@ function longPressOnDocument(posX, posY) {
 		});
 }
 
+function pushHamburgerMenuIconMobile() {
+	cy.get('#toolbar-hamburger .main-menu-btn-icon')
+		.click({force: true});
+}
+
 module.exports.loadTestDoc = loadTestDoc;
 module.exports.enableEditingMobile = enableEditingMobile;
 module.exports.assertCursorAndFocus = assertCursorAndFocus;
@@ -232,3 +236,4 @@ module.exports.expectTextForClipboard = expectTextForClipboard;
 module.exports.afterAll = afterAll;
 module.exports.beforeAllMobile = beforeAllMobile;
 module.exports.longPressOnDocument = longPressOnDocument;
+module.exports.pushHamburgerMenuIconMobile = pushHamburgerMenuIconMobile;
diff --git a/cypress_test/integration_tests/mobile/writer/focus_spec.js b/cypress_test/integration_tests/mobile/writer/focus_spec.js
index 268324c58..14c0e65db 100644
--- a/cypress_test/integration_tests/mobile/writer/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/focus_spec.js
@@ -213,16 +213,14 @@ describe('Focus tests', function() {
 			.should('be.eq', 'clipboard');
 
 		// Open hamburger menu
-		cy.get('#toolbar-hamburger')
-			.click();
+		helper.pushHamburgerMenuIconMobile();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
 			.should('be.eq', 'BODY');
 
 		// Close hamburger menu
-		cy.get('#toolbar-hamburger')
-			.click();
+		helper.pushHamburgerMenuIconMobile();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
diff --git a/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js b/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js
index 15f9c4ab0..9f4fbc0bb 100644
--- a/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js
@@ -50,7 +50,7 @@ describe('Mobile wizard state tests', function() {
 			.should('have.class', 'checked');
 	});
 
-	it('Close mobile wizard by hamburger menu.', function() {
+	it.only('Close mobile wizard by hamburger menu.', function() {
 		// Click on edit button
 		helper.enableEditingMobile();
 
@@ -65,12 +65,12 @@ describe('Mobile wizard state tests', function() {
 			.should('have.class', 'checked');
 
 		// Open hamburger menu
-		cy.get('#toolbar-hamburger').click();
+		helper.pushHamburgerMenuIconMobile();
 		cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon')
 			.contains('About');
 
 		// Close hamburger menu
-		cy.get('#toolbar-hamburger').click();
+		helper.pushHamburgerMenuIconMobile();
 		// Mobile wizard is closed
 		cy.get('#mobile-wizard')
 			.should('not.be.visible');
diff --git a/cypress_test/integration_tests/mobile/writer/writer_helper.js b/cypress_test/integration_tests/mobile/writer/writer_helper.js
index 0e2385a51..943b9ef38 100644
--- a/cypress_test/integration_tests/mobile/writer/writer_helper.js
+++ b/cypress_test/integration_tests/mobile/writer/writer_helper.js
@@ -80,8 +80,7 @@ function copyTableToClipboard() {
 // which will be detached from DOM.
 function clearMobileWizardState() {
 	// Open hamburger menu
-	cy.get('#toolbar-hamburger')
-		.click();
+	helper.pushHamburgerMenuIconMobile();
 
 	cy.get('#mobile-wizard-content')
 		.should('be.visible');
@@ -90,8 +89,7 @@ function clearMobileWizardState() {
 		.contains('About', {timeout: 10000});
 
 	// Close hamburger menu
-	cy.get('#toolbar-hamburger')
-		.click();
+	helper.pushHamburgerMenuIconMobile();
 }
 
 function selectAllMobile() {
@@ -104,8 +102,7 @@ function selectAllMobile() {
 		.should('not.exist');
 
 	// Open hamburger menu
-	cy.get('#toolbar-hamburger')
-		.click();
+	helper.pushHamburgerMenuIconMobile();
 	cy.get('#mobile-wizard')
 		.should('be.visible', {timeout : 10000});
 


More information about the Libreoffice-commits mailing list