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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 7 11:50:25 UTC 2020


 cypress_test/integration_tests/common/helper.js                                 |   89 ---------
 cypress_test/integration_tests/common/impress.js                                |   36 ---
 cypress_test/integration_tests/common/mobile_helper.js                          |   92 ++++++++++
 cypress_test/integration_tests/mobile/calc/apply_font_spec.js                   |    5 
 cypress_test/integration_tests/mobile/calc/calc_helper.js                       |    6 
 cypress_test/integration_tests/mobile/calc/focus_spec.js                        |    9 
 cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js             |    5 
 cypress_test/integration_tests/mobile/calc/number_format_spec.js                |    7 
 cypress_test/integration_tests/mobile/calc/spellchecking_spec.js                |    5 
 cypress_test/integration_tests/mobile/impress/impress_focus_spec.js             |    9 
 cypress_test/integration_tests/mobile/impress/impress_helper.js                 |   39 ++++
 cypress_test/integration_tests/mobile/impress/spellchecking_spec.js             |   11 -
 cypress_test/integration_tests/mobile/writer/apply_font_spec.js                 |    5 
 cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js |    5 
 cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js             |    5 
 cypress_test/integration_tests/mobile/writer/focus_spec.js                      |   29 +--
 cypress_test/integration_tests/mobile/writer/insert_field_spec.js               |    5 
 cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js     |    5 
 cypress_test/integration_tests/mobile/writer/insert_object_spec.js              |    5 
 cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js        |   15 -
 cypress_test/integration_tests/mobile/writer/shape_properties_spec.js           |    5 
 cypress_test/integration_tests/mobile/writer/spellchecking_spec.js              |    7 
 cypress_test/integration_tests/mobile/writer/table_properties_spec.js           |    5 
 cypress_test/integration_tests/mobile/writer/toolbar_spec.js                    |   19 +-
 cypress_test/integration_tests/mobile/writer/writer_helper.js                   |    8 
 cypress_test/support/index.js                                                   |    2 
 26 files changed, 230 insertions(+), 203 deletions(-)

New commits:
commit b045fa90f281304ce3ed1a4c736b5209f695d146
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Apr 7 11:22:38 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Apr 7 13:50:07 2020 +0200

    cypress: mobile: create a separate mobile helper file.
    
    Change-Id: I3d57a8a691f8085db12b00e7b508295ce8f33a26
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91807
    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 d5f110056..acaa71927 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -45,21 +45,6 @@ function loadTestDoc(fileName, subFolder, mobile) {
 	// Wait for the document to fully load
 	cy.get('.leaflet-tile-loaded', {timeout : 10000});
 }
-
-// Enable editing if we are in read-only mode.
-function enableEditingMobile() {
-	cy.get('#mobile-edit-button')
-		.then(function(button) {
-			if (button.css('display') !== 'none') {
-				cy.get('#mobile-edit-button')
-					.click();
-			}
-		});
-
-	cy.get('#tb_actionbar_item_mobile_wizard')
-		.should('not.have.class', 'disabled');
-}
-
 // Assert that NO keyboard input is accepted (i.e. keyboard should be HIDDEN).
 function assertNoKeyboardInput() {
 	cy.window().then(win => {
@@ -143,12 +128,6 @@ function expectTextForClipboard(expectedPlainText) {
 	});
 }
 
-function beforeAllMobile(fileName, subFolder) {
-	loadTestDoc(fileName, subFolder, true);
-
-	detectLOCoreVersion();
-}
-
 function afterAll(fileName) {
 	// Make sure that the document is closed
 	cy.visit('http://admin:admin@localhost:' +
@@ -162,72 +141,7 @@ function afterAll(fileName) {
 		.should('not.contain.text', fileName);
 }
 
-function detectLOCoreVersion() {
-	if (Cypress.env('LO_CORE_VERSION') === undefined) {
-		// Open hamburger menu
-		pushHamburgerMenuIconMobile();
-
-		// Open about dialog
-		cy.get('.ui-header.level-0 .menu-entry-with-icon')
-			.contains('About')
-			.click();
-
-		cy.get('.vex-content')
-			.should('exist');
-
-		// Get the version
-		cy.get('#lokit-version')
-			.then(function(items) {
-				expect(items).have.lengthOf(1);
-				if (items[0].textContent.includes('Collabora') &&
-				    items[0].textContent.includes('6.2')) {
-					Cypress.env('LO_CORE_VERSION', 'cp-6-2');}
-				else {
-					Cypress.env('LO_CORE_VERSION', 'master');
-				}
-			});
-
-		// Close about dialog
-		cy.get('.vex-close')
-			.click({force : true});
-
-		cy.get('.vex-content')
-			.should('not.exist');
-	}
-}
-
-function longPressOnDocument(posX, posY) {
-	cy.get('.leaflet-pane.leaflet-map-pane')
-		.then(function(items) {
-			expect(items).have.length(1);
-
-			var eventOptions = {
-				force: true,
-				button: 0,
-				pointerType: 'mouse',
-				x: posX - items[0].getBoundingClientRect().left,
-				y: posY - items[0].getBoundingClientRect().top
-			};
-
-			cy.get('.leaflet-pane.leaflet-map-pane')
-				.trigger('pointerdown', eventOptions)
-				.trigger('pointermove', eventOptions);
-
-			// This value is set in Map.TouchGesture.js.
-			cy.wait(500);
-
-			cy.get('.leaflet-pane.leaflet-map-pane')
-				.trigger('pointerup', eventOptions);
-		});
-}
-
-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;
 module.exports.assertNoKeyboardInput = assertNoKeyboardInput;
 module.exports.assertHaveKeyboardInput = assertHaveKeyboardInput;
@@ -236,6 +150,3 @@ module.exports.clearAllText = clearAllText;
 module.exports.getTextForClipboard = getTextForClipboard;
 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/common/impress.js b/cypress_test/integration_tests/common/impress.js
index 00064c096..8031b9eca 100644
--- a/cypress_test/integration_tests/common/impress.js
+++ b/cypress_test/integration_tests/common/impress.js
@@ -1,4 +1,4 @@
-/* global cy require expect*/
+/* global cy require*/
 
 var helper = require('./helper');
 
@@ -60,40 +60,6 @@ function typeTextAndVerify(text, expected) {
 
 	helper.expectTextForClipboard(expected);
 }
-
-function copyShapeContentToClipboard() {
-	// TODO: this fails on assertHaveKeyboardInput()
-	// assertInTextEditMode();
-
-	helper.selectAllText(false);
-
-	// Open context menu
-	cy.get('.leaflet-marker-icon')
-		.then(function(marker) {
-			expect(marker).to.have.lengthOf(2);
-			var XPos = (marker[0].getBoundingClientRect().right + marker[1].getBoundingClientRect().left) / 2;
-			var YPos = marker[0].getBoundingClientRect().top - 5;
-			helper.longPressOnDocument(XPos, YPos);
-		});
-
-	cy.get('#mobile-wizard')
-		.should('be.visible');
-
-	// Execute copy
-	cy.get('.ui-header.level-0.mobile-wizard.ui-widget .context-menu-link .menu-entry-with-icon', {timeout : 10000})
-		.contains('Copy')
-		.click();
-
-	// Close warning about clipboard operations
-	cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
-		.click();
-
-	// Wait until it's closed
-	cy.get('.vex-overlay')
-		.should('not.exist');
-}
-
 module.exports.assertNotInTextEditMode = assertNotInTextEditMode;
 module.exports.assertInTextEditMode = assertInTextEditMode;
 module.exports.typeTextAndVerify = typeTextAndVerify;
-module.exports.copyShapeContentToClipboard = copyShapeContentToClipboard;
diff --git a/cypress_test/integration_tests/common/mobile_helper.js b/cypress_test/integration_tests/common/mobile_helper.js
new file mode 100644
index 000000000..796d7d8a1
--- /dev/null
+++ b/cypress_test/integration_tests/common/mobile_helper.js
@@ -0,0 +1,92 @@
+/* global cy Cypress expect require*/
+
+var helper = require('./helper');
+
+// Enable editing if we are in read-only mode.
+function enableEditingMobile() {
+	cy.get('#mobile-edit-button')
+		.then(function(button) {
+			if (button.css('display') !== 'none') {
+				cy.get('#mobile-edit-button')
+					.click();
+			}
+		});
+
+	cy.get('#tb_actionbar_item_mobile_wizard')
+		.should('not.have.class', 'disabled');
+}
+
+function beforeAllMobile(fileName, subFolder) {
+	helper.loadTestDoc(fileName, subFolder, true);
+
+	detectLOCoreVersion();
+}
+
+function detectLOCoreVersion() {
+	if (Cypress.env('LO_CORE_VERSION') === undefined) {
+		// Open hamburger menu
+		pushHamburgerMenuIconMobile();
+
+		// Open about dialog
+		cy.get('.ui-header.level-0 .menu-entry-with-icon')
+			.contains('About')
+			.click();
+
+		cy.get('.vex-content')
+			.should('exist');
+
+		// Get the version
+		cy.get('#lokit-version')
+			.then(function(items) {
+				expect(items).have.lengthOf(1);
+				if (items[0].textContent.includes('Collabora') &&
+				    items[0].textContent.includes('6.2')) {
+					Cypress.env('LO_CORE_VERSION', 'cp-6-2');}
+				else {
+					Cypress.env('LO_CORE_VERSION', 'master');
+				}
+			});
+
+		// Close about dialog
+		cy.get('.vex-close')
+			.click({force : true});
+
+		cy.get('.vex-content')
+			.should('not.exist');
+	}
+}
+
+function longPressOnDocument(posX, posY) {
+	cy.get('.leaflet-pane.leaflet-map-pane')
+		.then(function(items) {
+			expect(items).have.length(1);
+
+			var eventOptions = {
+				force: true,
+				button: 0,
+				pointerType: 'mouse',
+				x: posX - items[0].getBoundingClientRect().left,
+				y: posY - items[0].getBoundingClientRect().top
+			};
+
+			cy.get('.leaflet-pane.leaflet-map-pane')
+				.trigger('pointerdown', eventOptions)
+				.trigger('pointermove', eventOptions);
+
+			// This value is set in Map.TouchGesture.js.
+			cy.wait(500);
+
+			cy.get('.leaflet-pane.leaflet-map-pane')
+				.trigger('pointerup', eventOptions);
+		});
+}
+
+function pushHamburgerMenuIconMobile() {
+	cy.get('#toolbar-hamburger .main-menu-btn-icon')
+		.click({force: true});
+}
+
+module.exports.enableEditingMobile = enableEditingMobile;
+module.exports.beforeAllMobile = beforeAllMobile;
+module.exports.longPressOnDocument = longPressOnDocument;
+module.exports.pushHamburgerMenuIconMobile = pushHamburgerMenuIconMobile;
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 c54cbcfe3..d9edb2638 100644
--- a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach Cypress*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Apply font changes.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('apply_font.ods', 'calc');
+		mobileHelper.beforeAllMobile('apply_font.ods', 'calc');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		calcHelper.clickOnFirstCell();
 
diff --git a/cypress_test/integration_tests/mobile/calc/calc_helper.js b/cypress_test/integration_tests/mobile/calc/calc_helper.js
index d6bd1d334..25155ec73 100644
--- a/cypress_test/integration_tests/mobile/calc/calc_helper.js
+++ b/cypress_test/integration_tests/mobile/calc/calc_helper.js
@@ -1,10 +1,10 @@
 /* global cy expect require Cypress*/
 
-var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 
 function clickOnFirstCell(firstClick = true, dblClick = false) {
 	// Enable editing if it's in read-only mode
-	helper.enableEditingMobile();
+	mobileHelper.enableEditingMobile();
 
 	// Use the tile's edge to find the first cell's position
 	cy.get('.leaflet-tile-container')
@@ -41,7 +41,7 @@ function copyContentToClipboard() {
 			expect(items).to.have.lengthOf(1);
 			var XPos = items[0].getBoundingClientRect().right + 10;
 			var YPos = items[0].getBoundingClientRect().top + 10;
-			helper.longPressOnDocument(XPos, YPos);
+			mobileHelper.longPressOnDocument(XPos, YPos);
 		});
 
 	cy.get('#mobile-wizard')
diff --git a/cypress_test/integration_tests/mobile/calc/focus_spec.js b/cypress_test/integration_tests/mobile/calc/focus_spec.js
index c7c6d766d..04c53d868 100644
--- a/cypress_test/integration_tests/mobile/calc/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/focus_spec.js
@@ -1,11 +1,12 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Calc focus tests', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('focus.ods', 'calc');
+		mobileHelper.beforeAllMobile('focus.ods', 'calc');
 	});
 
 	afterEach(function() {
@@ -14,7 +15,7 @@ describe('Calc focus tests', function() {
 
 	it('Basic document focus.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Body has the focus -> can't type in the document
 		cy.document().its('activeElement.tagName')
@@ -47,7 +48,7 @@ describe('Calc focus tests', function() {
 
 	it('Focus on second tap.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Body has the focus -> can't type in the document
 		cy.document().its('activeElement.tagName')
@@ -73,7 +74,7 @@ describe('Calc focus tests', function() {
 
 	it('Formula-bar focus', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Body has the focus -> can't type in the document
 		cy.document().its('activeElement.tagName')
diff --git a/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
index 1f045440d..132949338 100644
--- a/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Calc insertion wizard.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('insertion_wizard.ods', 'calc');
+		mobileHelper.beforeAllMobile('insertion_wizard.ods', 'calc');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		calcHelper.clickOnFirstCell();
 
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 03fef04bb..c9e343087 100644
--- a/cypress_test/integration_tests/mobile/calc/number_format_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach Cypress*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Apply number formatting.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('number_format.ods', 'calc');
+		mobileHelper.beforeAllMobile('number_format.ods', 'calc');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		calcHelper.clickOnFirstCell();
 
@@ -401,4 +402,4 @@ describe('Apply number formatting.', function() {
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1000');
 	});
-});
\ No newline at end of file
+});
diff --git a/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js b/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
index b1a564bca..379221e58 100644
--- a/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
@@ -1,11 +1,12 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Calc spell checking menu.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('spellchecking.ods', 'calc');
+		mobileHelper.beforeAllMobile('spellchecking.ods', 'calc');
 
 		// Click on edit button
 		cy.get('#mobile-edit-button')
@@ -42,7 +43,7 @@ describe('Calc spell checking menu.', function() {
 				// Step into edit mode again
 				calcHelper.dblClickOnFirstCell();
 
-				helper.longPressOnDocument(XPos, YPos);
+				mobileHelper.longPressOnDocument(XPos, YPos);
 			});
 
 		cy.get('#mobile-wizard-content')
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 a33bede16..58198e6a5 100644
--- a/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
@@ -1,11 +1,12 @@
 /* global describe it cy beforeEach require afterEach expect */
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var impress = require('../../common/impress');
 
 describe('Impress focus tests', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('focus.odp', 'impress');
+		mobileHelper.beforeAllMobile('focus.odp', 'impress');
 	});
 
 	afterEach(function() {
@@ -14,7 +15,7 @@ describe('Impress focus tests', function() {
 
 	it('Select text box, no editing', function() {
 
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		impress.assertNotInTextEditMode();
 
@@ -54,7 +55,7 @@ describe('Impress focus tests', function() {
 
 	it('Double-click to edit', function() {
 
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		impress.assertNotInTextEditMode();
 
@@ -82,7 +83,7 @@ describe('Impress focus tests', function() {
 
 	it('Single-click to edit', function() {
 
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		impress.assertNotInTextEditMode();
 
diff --git a/cypress_test/integration_tests/mobile/impress/impress_helper.js b/cypress_test/integration_tests/mobile/impress/impress_helper.js
new file mode 100644
index 000000000..ce0d54f88
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/impress/impress_helper.js
@@ -0,0 +1,39 @@
+/* global cy require expect*/
+
+var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
+
+function copyShapeContentToClipboard() {
+	// TODO: this fails on assertHaveKeyboardInput()
+	// assertInTextEditMode();
+
+	helper.selectAllText(false);
+
+	// Open context menu
+	cy.get('.leaflet-marker-icon')
+		.then(function(marker) {
+			expect(marker).to.have.lengthOf(2);
+			var XPos = (marker[0].getBoundingClientRect().right + marker[1].getBoundingClientRect().left) / 2;
+			var YPos = marker[0].getBoundingClientRect().top - 5;
+			mobileHelper.longPressOnDocument(XPos, YPos);
+		});
+
+	cy.get('#mobile-wizard')
+		.should('be.visible');
+
+	// Execute copy
+	cy.get('.ui-header.level-0.mobile-wizard.ui-widget .context-menu-link .menu-entry-with-icon', {timeout : 10000})
+		.contains('Copy')
+		.click();
+
+	// Close warning about clipboard operations
+	cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+		.click();
+
+	// Wait until it's closed
+	cy.get('.vex-overlay')
+		.should('not.exist');
+}
+
+
+module.exports.copyShapeContentToClipboard = copyShapeContentToClipboard;
diff --git a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
index d4cbaa256..c14193292 100644
--- a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
-var impress = require('../../common/impress');
+var mobileHelper = require('../../common/mobile_helper');
+var impressHelper = require('./impress_helper');
 
 describe('Spell checking menu.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('spellchecking.odp', 'impress');
+		mobileHelper.beforeAllMobile('spellchecking.odp', 'impress');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
@@ -52,7 +53,7 @@ describe('Spell checking menu.', function() {
 				cy.get('.leaflet-marker-icon')
 					.should('not.exist');
 
-				helper.longPressOnDocument(XPos, YPos);
+				mobileHelper.longPressOnDocument(XPos, YPos);
 			});
 
 		cy.get('#mobile-wizard-content')
@@ -66,7 +67,7 @@ describe('Spell checking menu.', function() {
 			.contains('hello')
 			.click();
 
-		impress.copyShapeContentToClipboard();
+		impressHelper.copyShapeContentToClipboard();
 
 		cy.get('#copy-paste-container pre')
 			.then(function(item) {
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 1f0ba1d2a..4d3bffb3e 100644
--- a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach Cypress*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Apply font changes.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('apply_font.odt', 'writer');
+		mobileHelper.beforeAllMobile('apply_font.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Do a new selection
 		writerHelper.selectAllMobile();
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 54198d491..7c48476cb 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
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require expect afterEach Cypress*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Apply paragraph properties.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('apply_paragraph_properties.odt', 'writer');
+		mobileHelper.beforeAllMobile('apply_paragraph_properties.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Do a selection
 		writerHelper.selectAllMobile();
diff --git a/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js b/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js
index a0c484eba..36c2e1744 100644
--- a/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Pushing bottom toolbar items.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('bottom_toolbar.odt', 'writer');
+		mobileHelper.beforeAllMobile('bottom_toolbar.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Do a new selection
 		writerHelper.selectAllMobile();
diff --git a/cypress_test/integration_tests/mobile/writer/focus_spec.js b/cypress_test/integration_tests/mobile/writer/focus_spec.js
index 84e2635a3..6ce2658fb 100644
--- a/cypress_test/integration_tests/mobile/writer/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/focus_spec.js
@@ -1,10 +1,11 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 
 describe('Focus tests', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('focus.odt', 'writer');
+		mobileHelper.beforeAllMobile('focus.odt', 'writer');
 	});
 
 	afterEach(function() {
@@ -13,7 +14,7 @@ describe('Focus tests', function() {
 
 	it('Basic document focus.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Body has the focus -> can't type in the document
 		cy.document().its('activeElement.tagName')
@@ -30,7 +31,7 @@ describe('Focus tests', function() {
 
 	it('Focus with a vex dialog.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Open comment insertion dialog
 		cy.get('#tb_actionbar_item_insertcomment')
@@ -54,7 +55,7 @@ describe('Focus tests', function() {
 
 	it('Focus with opened mobile wizard.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click in the document
 		cy.get('#document-container')
@@ -87,7 +88,7 @@ describe('Focus tests', function() {
 
 	it('Focus inside mobile wizard.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Open mobile wizard
 		cy.get('#tb_actionbar_item_mobile_wizard')
@@ -119,7 +120,7 @@ describe('Focus tests', function() {
 
 	it('Focus after insertion.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Open insertion mobile wizard
 		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
@@ -147,7 +148,7 @@ describe('Focus tests', function() {
 
 	it('Shape related focus.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Open insertion mobile wizard
 		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
@@ -207,7 +208,7 @@ describe('Focus tests', function() {
 
 	it('Focus with hamburger menu.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click in the document
 		cy.get('#document-container')
@@ -218,14 +219,14 @@ describe('Focus tests', function() {
 			.should('be.eq', 'clipboard');
 
 		// Open hamburger menu
-		helper.pushHamburgerMenuIconMobile();
+		mobileHelper.pushHamburgerMenuIconMobile();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
 			.should('be.eq', 'BODY');
 
 		// Close hamburger menu
-		helper.pushHamburgerMenuIconMobile();
+		mobileHelper.pushHamburgerMenuIconMobile();
 
 		// No focus
 		cy.document().its('activeElement.tagName')
@@ -234,7 +235,7 @@ describe('Focus tests', function() {
 
 	it('Focus after applying font change.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click in the document
 		cy.get('#document-container')
@@ -280,7 +281,7 @@ describe('Focus tests', function() {
 
 	it('Apply bold, check keyboard.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Grab focus to the document
 		cy.get('#document-container')
@@ -309,7 +310,7 @@ describe('Focus tests', function() {
 
 	it('Apply italic, check keyboard.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Grab focus to the document
 		cy.get('#document-container')
@@ -338,7 +339,7 @@ describe('Focus tests', function() {
 
 	it('Apply underline, check keyboard.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Grab focus to the document
 		cy.get('#document-container')
diff --git a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
index d17a33dac..c924b7e43 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Insert fields via insertion wizard.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('insert_field.odt', 'writer');
+		mobileHelper.beforeAllMobile('insert_field.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Open insertion wizard
 		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
diff --git a/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js b/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js
index 2c1c35ed8..07a600d44 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require expect afterEach*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Insert formatting mark via insertion wizard.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('insert_formatting_mark.odt', 'writer');
+		mobileHelper.beforeAllMobile('insert_formatting_mark.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Open insertion wizard
 		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
diff --git a/cypress_test/integration_tests/mobile/writer/insert_object_spec.js b/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
index 398fcc1d9..ab938168f 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require expect afterEach Cypress*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Insert objects via insertion wizard.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('insert_object.odt', 'writer');
+		mobileHelper.beforeAllMobile('insert_object.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
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 a3c091704..b2c541759 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
@@ -1,10 +1,11 @@
 /* global describe it cy beforeEach require afterEach*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 
 describe('Mobile wizard state tests', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('mobile_wizard_state.odt', 'writer');
+		mobileHelper.beforeAllMobile('mobile_wizard_state.odt', 'writer');
 	});
 
 	afterEach(function() {
@@ -13,7 +14,7 @@ describe('Mobile wizard state tests', function() {
 
 	it('Open and close mobile wizard by toolbar item.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click on mobile wizard toolbar item
 		cy.get('#tb_actionbar_item_mobile_wizard')
@@ -52,7 +53,7 @@ describe('Mobile wizard state tests', function() {
 
 	it('Close mobile wizard by hamburger menu.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click on mobile wizard toolbar item
 		cy.get('#tb_actionbar_item_mobile_wizard')
@@ -65,12 +66,12 @@ describe('Mobile wizard state tests', function() {
 			.should('have.class', 'checked');
 
 		// Open hamburger menu
-		helper.pushHamburgerMenuIconMobile();
+		mobileHelper.pushHamburgerMenuIconMobile();
 		cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon')
 			.contains('About');
 
 		// Close hamburger menu
-		helper.pushHamburgerMenuIconMobile();
+		mobileHelper.pushHamburgerMenuIconMobile();
 		// Mobile wizard is closed
 		cy.get('#mobile-wizard')
 			.should('not.be.visible');
@@ -87,7 +88,7 @@ describe('Mobile wizard state tests', function() {
 
 	it('Close mobile wizard by context wizard.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click on mobile wizard toolbar item
 		cy.get('#tb_actionbar_item_mobile_wizard')
@@ -99,7 +100,7 @@ describe('Mobile wizard state tests', function() {
 			.should('have.class', 'checked');
 
 		// Open context wizard by right click on document
-		helper.longPressOnDocument(40, 40);
+		mobileHelper.longPressOnDocument(40, 40);
 		cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon')
 			.contains('Paste');
 
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 12a07f534..7383a209b 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -1,16 +1,17 @@
 /* global describe it cy beforeEach require afterEach Cypress*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Change shape properties via mobile wizard.', function() {
 	var defaultGeometry = 'M 1965,4863 L 7957,10855 1965,10855 1965,4863 1965,4863 Z';
 
 	beforeEach(function() {
-		helper.beforeAllMobile('shape_properties.odt', 'writer');
+		mobileHelper.beforeAllMobile('shape_properties.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		writerHelper.selectAllMobile();
 
diff --git a/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js b/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
index 36df0e2c3..8ac815018 100644
--- a/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
@@ -1,14 +1,15 @@
 /* global describe it cy beforeEach require afterEach expect*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Spell checking menu.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('spellchecking.odt', 'writer');
+		mobileHelper.beforeAllMobile('spellchecking.odt', 'writer');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
@@ -39,7 +40,7 @@ describe('Spell checking menu.', function() {
 
 				var XPos = startPos.right + 10;
 				var YPos = endPos.top - 10;
-				helper.longPressOnDocument(XPos, YPos);
+				mobileHelper.longPressOnDocument(XPos, YPos);
 			});
 
 		cy.get('#mobile-wizard-content')
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 25ea31e0c..412771855 100644
--- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
@@ -1,11 +1,12 @@
 /* global describe it cy require afterEach expect Cypress beforeEach*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Change table properties / layout via mobile wizard.', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('table_properties.odt', 'writer');
+		mobileHelper.beforeAllMobile('table_properties.odt', 'writer');
 	});
 
 	afterEach(function() {
@@ -16,7 +17,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		helper.loadTestDoc(testFile, 'writer', true);
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 	}
 
 	function openTablePanel() {
diff --git a/cypress_test/integration_tests/mobile/writer/toolbar_spec.js b/cypress_test/integration_tests/mobile/writer/toolbar_spec.js
index b9b804813..4453abcf7 100644
--- a/cypress_test/integration_tests/mobile/writer/toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/toolbar_spec.js
@@ -1,10 +1,11 @@
 /* global describe it cy beforeEach require afterEach*/
 
 var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 
 describe('Toolbar tests', function() {
 	beforeEach(function() {
-		helper.beforeAllMobile('toolbar.odt', 'writer');
+		mobileHelper.beforeAllMobile('toolbar.odt', 'writer');
 	});
 
 	afterEach(function() {
@@ -17,7 +18,7 @@ describe('Toolbar tests', function() {
 			.should('have.class', 'disabled');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Button should be enabled now
 		cy.get('#tb_actionbar_item_mobile_wizard')
@@ -30,7 +31,7 @@ describe('Toolbar tests', function() {
 			.should('have.class', 'disabled');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Button should be enabled now
 		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
@@ -43,7 +44,7 @@ describe('Toolbar tests', function() {
 			.should('have.class', 'disabled');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Button should be enabled now
 		cy.get('#tb_actionbar_item_insertcomment')
@@ -56,7 +57,7 @@ describe('Toolbar tests', function() {
 			.should('have.class', 'disabled');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Button should be still disabled
 		cy.get('#tb_actionbar_item_undo')
@@ -76,7 +77,7 @@ describe('Toolbar tests', function() {
 			.should('have.class', 'disabled');
 
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Button should be still disabled
 		cy.get('#tb_actionbar_item_redo')
@@ -101,7 +102,7 @@ describe('Toolbar tests', function() {
 
 	it('Open and close mobile wizard by toolbar item.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click on mobile wizard toolbar item
 		cy.get('#tb_actionbar_item_mobile_wizard')
@@ -128,7 +129,7 @@ describe('Toolbar tests', function() {
 
 	it('Open and close insertion mobile wizard by toolbar item.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click on toolbar item
 		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
@@ -164,7 +165,7 @@ describe('Toolbar tests', function() {
 
 	it('Open insert comment dialog by toolbar item.', function() {
 		// Click on edit button
-		helper.enableEditingMobile();
+		mobileHelper.enableEditingMobile();
 
 		// Click on toolbar item
 		cy.get('#tb_actionbar_item_insertcomment')
diff --git a/cypress_test/integration_tests/mobile/writer/writer_helper.js b/cypress_test/integration_tests/mobile/writer/writer_helper.js
index 74c5ece92..43665d30d 100644
--- a/cypress_test/integration_tests/mobile/writer/writer_helper.js
+++ b/cypress_test/integration_tests/mobile/writer/writer_helper.js
@@ -1,6 +1,6 @@
 /* global cy expect require*/
 
-var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
 
 function copyTextToClipboard() {
 	// Do a new selection
@@ -12,7 +12,7 @@ function copyTextToClipboard() {
 			expect(marker).to.have.lengthOf(2);
 			var XPos = (marker[0].getBoundingClientRect().right + marker[1].getBoundingClientRect().left) / 2;
 			var YPos = marker[0].getBoundingClientRect().top - 5;
-			helper.longPressOnDocument(XPos, YPos);
+			mobileHelper.longPressOnDocument(XPos, YPos);
 		});
 
 	cy.get('#mobile-wizard')
@@ -50,7 +50,7 @@ function copyTableToClipboard() {
 
 			var XPos = startPos.right + 10;
 			var YPos = (startPos.top + endPos.top) / 2;
-			helper.longPressOnDocument(XPos, YPos);
+			mobileHelper.longPressOnDocument(XPos, YPos);
 		});
 
 	cy.get('#mobile-wizard')
@@ -80,7 +80,7 @@ function selectAllMobile() {
 		.should('not.exist');
 
 	// Open hamburger menu
-	helper.pushHamburgerMenuIconMobile();
+	mobileHelper.pushHamburgerMenuIconMobile();
 	cy.get('#mobile-wizard')
 		.should('be.visible', {timeout : 10000});
 
diff --git a/cypress_test/support/index.js b/cypress_test/support/index.js
index 2a2b1f1d5..1c6833720 100644
--- a/cypress_test/support/index.js
+++ b/cypress_test/support/index.js
@@ -1,4 +1,4 @@
 /* global require */
 
 require('cypress-failed-log');
-require('./commands');
+import './commands';


More information about the Libreoffice-commits mailing list