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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 7 13:32:34 UTC 2020


 cypress_test/integration_tests/common/mobile_helper.js                          |   36 ++++
 cypress_test/integration_tests/mobile/calc/apply_font_spec.js                   |   52 +-----
 cypress_test/integration_tests/mobile/calc/number_format_spec.js                |   61 +------
 cypress_test/integration_tests/mobile/impress/impress_focus_spec.js             |    3 
 cypress_test/integration_tests/mobile/writer/apply_font_spec.js                 |   84 +--------
 cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js |   85 ++--------
 cypress_test/integration_tests/mobile/writer/focus_spec.js                      |   37 ----
 cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js        |   61 -------
 cypress_test/integration_tests/mobile/writer/shape_properties_spec.js           |   21 --
 cypress_test/integration_tests/mobile/writer/table_properties_spec.js           |   68 ++------
 10 files changed, 132 insertions(+), 376 deletions(-)

New commits:
commit dd42ea0da7a02bdea144327bee6b66d61f41c848
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Apr 7 11:39:57 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Apr 7 15:32:16 2020 +0200

    cypress: mobile: extract openMobileWizard() and closeMobileWizard() method.
    
    Change-Id: I02e33406510ade9cfc6de5f31854cee99a7c1fc0
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91823
    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/mobile_helper.js b/cypress_test/integration_tests/common/mobile_helper.js
index 796d7d8a1..c3a077bca 100644
--- a/cypress_test/integration_tests/common/mobile_helper.js
+++ b/cypress_test/integration_tests/common/mobile_helper.js
@@ -86,7 +86,43 @@ function pushHamburgerMenuIconMobile() {
 		.click({force: true});
 }
 
+function openMobileWizard() {
+	cy.log('Opening mobile wizard - start.');
+
+	// Open mobile wizard
+	cy.get('#tb_actionbar_item_mobile_wizard')
+		.should('not.have.class', 'disabled')
+		.click();
+
+	// Mobile wizard is opened and it has content
+	cy.get('#mobile-wizard-content')
+		.should('not.be.empty');
+	cy.get('#tb_actionbar_item_mobile_wizard table')
+		.should('have.class', 'checked');
+
+	cy.log('Opening mobile wizard - end.');
+}
+
+function closeMobileWizard() {
+	cy.log('Closing mobile wizard - start.');
+
+	cy.get('#tb_actionbar_item_mobile_wizard table')
+		.should('have.class', 'checked');
+
+	cy.get('#tb_actionbar_item_mobile_wizard')
+		.click();
+
+	cy.get('#mobile-wizard')
+		.should('not.be.visible');
+	cy.get('#tb_actionbar_item_mobile_wizard table')
+		.should('not.have.class', 'checked');
+
+	cy.log('Closing mobile wizard - end.');
+}
+
 module.exports.enableEditingMobile = enableEditingMobile;
 module.exports.beforeAllMobile = beforeAllMobile;
 module.exports.longPressOnDocument = longPressOnDocument;
 module.exports.pushHamburgerMenuIconMobile = pushHamburgerMenuIconMobile;
+module.exports.openMobileWizard = openMobileWizard;
+module.exports.closeMobileWizard = closeMobileWizard;
diff --git a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
index d9edb2638..c494a07f5 100644
--- a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
@@ -17,10 +17,7 @@ describe('Apply font changes.', function() {
 			.should('be.visible');
 
 		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
+		mobileHelper.openMobileWizard();
 
 		// Open character properties
 		cy.get('#TextPropertyPanel')
@@ -38,9 +35,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Bold')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -52,10 +47,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Italic')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
+		mobileHelper.closeMobileWizard();
 		calcHelper.copyContentToClipboard();
 
 		cy.get('#copy-paste-container table td i')
@@ -66,9 +58,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Underline')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -81,9 +71,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Strikeout')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -96,9 +84,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Shadowed')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -124,9 +110,7 @@ describe('Apply font changes.', function() {
 		cy.get('#fontnamecombobox .ui-header-right')
 			.contains('Linux Libertine G');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -157,9 +141,7 @@ describe('Apply font changes.', function() {
 		cy.get('#fontsizecombobox .ui-header-right')
 			.contains('14');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -172,11 +154,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Grow')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -189,11 +167,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Shrink')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -212,11 +186,7 @@ describe('Apply font changes.', function() {
 		cy.get('#mobile-wizard-back')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
diff --git a/cypress_test/integration_tests/mobile/calc/number_format_spec.js b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
index c9e343087..4f1356e50 100644
--- a/cypress_test/integration_tests/mobile/calc/number_format_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
@@ -16,11 +16,7 @@ describe('Apply number formatting.', function() {
 		cy.get('.leaflet-marker-icon')
 			.should('be.visible');
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
+		mobileHelper.openMobileWizard();
 
 		// Open character properties
 		cy.get('#ScNumberFormatPropertyPanel')
@@ -64,9 +60,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '1');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -101,9 +95,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '1');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -130,9 +122,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '1');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -167,9 +157,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '1');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -200,9 +188,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '1');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -214,11 +200,7 @@ describe('Apply number formatting.', function() {
 
 		calcHelper.clickOnFirstCell();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
+		mobileHelper.openMobileWizard();
 
 		// Open character properties
 		cy.get('#ScNumberFormatPropertyPanel')
@@ -239,9 +221,7 @@ describe('Apply number formatting.', function() {
 		//cy.get('#category .ui-header-left')
 		//	.should('have.text', 'Number');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -269,9 +249,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '0');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -295,9 +273,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '0');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -321,9 +297,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '1');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -344,9 +318,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '0');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
@@ -367,10 +339,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '0');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
+		mobileHelper.closeMobileWizard();
 		calcHelper.copyContentToClipboard();
 
 		cy.get('#copy-paste-container table td')
@@ -390,9 +359,7 @@ describe('Apply number formatting.', function() {
 		cy.get('#leadingzeroes input')
 			.should('have.attr', 'value', '0');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		calcHelper.copyContentToClipboard();
 
diff --git a/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js b/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
index 58198e6a5..75b5e9b64 100644
--- a/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
@@ -19,9 +19,6 @@ describe('Impress focus tests', function() {
 
 		impress.assertNotInTextEditMode();
 
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.should('not.have.class', 'disabled');
-
 		// Body has the focus -> can't type in the document
 		cy.document().its('activeElement.tagName')
 			.should('be.eq', 'BODY');
diff --git a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
index 4d3bffb3e..d09a2e384 100644
--- a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
@@ -14,10 +14,7 @@ describe('Apply font changes.', function() {
 		// Do a new selection
 		writerHelper.selectAllMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.should('not.have.class', 'disabled')
-			.click();
+		mobileHelper.openMobileWizard();
 	});
 
 	afterEach(function() {
@@ -28,10 +25,7 @@ describe('Apply font changes.', function() {
 		// Do a new selection
 		writerHelper.selectAllMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.should('not.have.class', 'disabled')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		// Change font name
 		cy.get('#applystyle')
@@ -50,9 +44,7 @@ describe('Apply font changes.', function() {
 				.contains(styleName);
 		}
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 	}
 
 	it('Apply font name.', function() {
@@ -74,9 +66,7 @@ describe('Apply font changes.', function() {
 		cy.get('#fontnamecombobox .ui-header-right')
 			.contains('Linux Libertine G');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -107,9 +97,7 @@ describe('Apply font changes.', function() {
 		cy.get('#fontsizecombobox .ui-header-right')
 			.contains('36');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -122,9 +110,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Bold')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -137,9 +123,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Italic')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -152,11 +136,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Underlineimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -169,11 +149,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Strikeoutimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -186,11 +162,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Shadowedimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -202,11 +174,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Growimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -219,11 +187,7 @@ describe('Apply font changes.', function() {
 		cy.get('#Shrinkimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -245,11 +209,7 @@ describe('Apply font changes.', function() {
 		cy.get('#mobile-wizard-back')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -271,11 +231,7 @@ describe('Apply font changes.', function() {
 		cy.get('#mobile-wizard-back')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -288,11 +244,7 @@ describe('Apply font changes.', function() {
 		cy.get('#SuperScriptimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -305,11 +257,7 @@ describe('Apply font changes.', function() {
 		cy.get('#SubScriptimg')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard-content')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
diff --git a/cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js b/cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js
index 7c48476cb..7a604b802 100644
--- a/cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js
@@ -14,10 +14,7 @@ describe('Apply paragraph properties.', function() {
 		// Do a selection
 		writerHelper.selectAllMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.should('not.have.class', 'disabled')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		// Open paragraph properties
 		cy.get('#Paragraph')
@@ -45,9 +42,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#LeftParaimg')
 			.should('have.class', 'selected');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -60,9 +55,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#CenterPara')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -75,9 +68,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#RightPara')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -90,9 +81,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#JustifyPara')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -105,9 +94,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#ParaRightToLeft')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -117,9 +104,7 @@ describe('Apply paragraph properties.', function() {
 		// Select text
 		writerHelper.selectAllMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		// Open paragraph properties
 		cy.get('#Paragraph')
@@ -129,9 +114,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#ParaLeftToRight')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -148,9 +131,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#DefaultBullet')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -167,9 +148,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#DefaultNumbering')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -196,9 +175,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#mobile-wizard-back')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -216,9 +193,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#ParaspaceIncrease')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -232,9 +207,7 @@ describe('Apply paragraph properties.', function() {
 		// Select text
 		writerHelper.selectAllMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		// Open paragraph properties
 		cy.get('#Paragraph')
@@ -244,9 +217,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#ParaspaceDecrease')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -284,9 +255,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#belowparaspacing .spinfield')
 			.should('have.attr', 'value', '0.02');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -305,9 +274,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#IncrementIndent')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -320,9 +287,7 @@ describe('Apply paragraph properties.', function() {
 		// Select text
 		writerHelper.selectAllMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		// Open paragraph properties
 		cy.get('#Paragraph')
@@ -332,9 +297,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#DecrementIndent')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -356,9 +319,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#beforetextindent .spinfield')
 			.should('have.attr', 'value', '0.04');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -380,9 +341,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#aftertextindent .spinfield')
 			.should('have.attr', 'value', '0.04');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
@@ -404,9 +363,7 @@ describe('Apply paragraph properties.', function() {
 		cy.get('#firstlineindent .spinfield')
 			.should('have.attr', 'value', '0.04');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTextToClipboard();
 
diff --git a/cypress_test/integration_tests/mobile/writer/focus_spec.js b/cypress_test/integration_tests/mobile/writer/focus_spec.js
index 6ce2658fb..5991f9b90 100644
--- a/cypress_test/integration_tests/mobile/writer/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/focus_spec.js
@@ -65,21 +65,13 @@ describe('Focus tests', function() {
 		cy.document().its('activeElement.className')
 			.should('be.eq', 'clipboard');
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.should('not.have.class', 'disabled')
-			.click();
-
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
+		mobileHelper.openMobileWizard();
 
 		// Body should have the focus (no focus on document)
 		cy.document().its('activeElement.tagName')
 			.should('be.eq', 'BODY');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
@@ -90,12 +82,7 @@ describe('Focus tests', function() {
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
+		mobileHelper.openMobileWizard();
 
 		// Open paragraph properties
 		cy.get('#Paragraph')
@@ -109,9 +96,7 @@ describe('Focus tests', function() {
 		cy.document().its('activeElement.className')
 			.should('be.eq', 'spinfield');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
@@ -245,12 +230,7 @@ describe('Focus tests', function() {
 		cy.document().its('activeElement.className')
 			.should('be.eq', 'clipboard');
 
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
+		mobileHelper.openMobileWizard();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
@@ -267,12 +247,7 @@ describe('Focus tests', function() {
 		cy.document().its('activeElement.tagName')
 			.should('be.eq', 'BODY');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('not.have.class', 'checked');
+		mobileHelper.closeMobileWizard();
 
 		// 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 b2c541759..18b260f39 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
@@ -16,54 +16,20 @@ describe('Mobile wizard state tests', function() {
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 
-		// Click on mobile wizard toolbar item
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		// Mobile wizard is opened and it has any content
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('have.class', 'checked');
-
-		// Toolbar button is checked
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('have.class', 'checked');
-
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		// Mobile wizard is closed
-		cy.get('#mobile-wizard')
-			.should('not.be.visible');
+		mobileHelper.openMobileWizard();
 
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('not.have.class', 'checked');
+		// Close mobile wizard
+		mobileHelper.closeMobileWizard();
 
 		// Open mobile wizard again
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		// Mobile wizard is opened and it has any content
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('have.class', 'checked');
+		mobileHelper.openMobileWizard();
 	});
 
 	it('Close mobile wizard by hamburger menu.', function() {
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 
-		// Click on mobile wizard toolbar item
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		// Mobile wizard is opened and it has any content
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('have.class', 'checked');
+		mobileHelper.openMobileWizard();
 
 		// Open hamburger menu
 		mobileHelper.pushHamburgerMenuIconMobile();
@@ -77,27 +43,14 @@ describe('Mobile wizard state tests', function() {
 			.should('not.be.visible');
 
 		// Open mobile wizard again
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		cy.get('#mobile-wizard-content')
-			.should('not.be.empty');
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('have.class', 'checked');
+		mobileHelper.openMobileWizard();
 	});
 
 	it('Close mobile wizard by context wizard.', function() {
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 
-		// Click on mobile wizard toolbar item
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		// Mobile wizard is opened and it has any content
-		cy.get('#Character');
-		cy.get('#tb_actionbar_item_mobile_wizard table')
-			.should('have.class', 'checked');
+		mobileHelper.openMobileWizard();
 
 		// Open context wizard by right click on document
 		mobileHelper.longPressOnDocument(40, 40);
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 7383a209b..7b744bea6 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -45,10 +45,7 @@ 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');
+		mobileHelper.closeMobileWizard();
 
 		// Change width
 		openPosSizePanel();
@@ -57,16 +54,11 @@ describe('Change shape properties via mobile wizard.', function() {
 			.should('be.visible')
 			.click();
 
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-		cy.get('#mobile-wizard')
-			.should('not.be.visible');
+		mobileHelper.closeMobileWizard();
 	}
 
 	function openPosSizePanel() {
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		cy.get('#PosSizePropertyPanel')
 			.click();
@@ -77,12 +69,7 @@ describe('Change shape properties via mobile wizard.', function() {
 	}
 
 	function openLinePropertyPanel() {
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
-
-		cy.get('#mobile-wizard')
-			.should('be.visible');
+		mobileHelper.openMobileWizard();
 
 		cy.get('#LinePropertyPanel')
 			.click();
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 412771855..a12152d23 100644
--- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
@@ -21,9 +21,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 	}
 
 	function openTablePanel() {
-		// Open mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.openMobileWizard();
 
 		// Open table panel
 		cy.get('#TableEditPanel')
@@ -62,9 +60,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-row-resize-marker')
 			.should('have.length', 4);
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -95,9 +91,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-row-resize-marker')
 			.should('have.length', 4);
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -128,9 +122,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-column-resize-marker')
 			.should('have.length', 4);
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -161,9 +153,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-column-resize-marker')
 			.should('have.length', 4);
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -194,9 +184,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-row-resize-marker')
 			.should('have.length', 2);
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -227,9 +215,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-column-resize-marker')
 			.should('not.exist');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -261,9 +247,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('.leaflet-marker-icon.table-column-resize-marker')
 			.should('not.exist');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		// Do a new selection
 		writerHelper.selectAllMobile();
@@ -295,9 +279,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#MergeCells')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -329,9 +311,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#rowheight .spinfield')
 			.should('have.attr', 'value', '1.4');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -361,9 +341,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#columnwidth .spinfield')
 			.should('have.attr', 'value', '5.6');
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -390,9 +368,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#SetMinimalRowHeight')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -418,9 +394,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#SetOptimalRowHeight')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -456,9 +430,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#DistributeRows')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -494,9 +466,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#SetMinimalColumnWidth')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -527,9 +497,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#SetOptimalColumnWidth')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 
@@ -563,9 +531,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		cy.get('#DistributeColumns')
 			.click();
 
-		// Close mobile wizard
-		cy.get('#tb_actionbar_item_mobile_wizard')
-			.click();
+		mobileHelper.closeMobileWizard();
 
 		writerHelper.copyTableToClipboard();
 


More information about the Libreoffice-commits mailing list