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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue May 26 11:45:29 UTC 2020


 cypress_test/integration_tests/desktop/calc/focus_spec.js                       |    6 
 cypress_test/integration_tests/desktop/impress/slide_operations_spec.js         |    6 
 cypress_test/integration_tests/desktop/writer/copy_paste_spec.js                |    6 
 cypress_test/integration_tests/desktop/writer/form_field_spec.js                |   29 ++--
 cypress_test/integration_tests/desktop/writer/shape_operations_spec.js          |    5 
 cypress_test/integration_tests/mobile/calc/alignment_options_spec.js            |    6 
 cypress_test/integration_tests/mobile/calc/apply_font_spec.js                   |    6 
 cypress_test/integration_tests/mobile/calc/bottom_toolbar_spec.js               |   67 +++-------
 cypress_test/integration_tests/mobile/calc/cell_appearance_spec.js              |    6 
 cypress_test/integration_tests/mobile/calc/focus_spec.js                        |    6 
 cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js             |    6 
 cypress_test/integration_tests/mobile/calc/number_format_spec.js                |    6 
 cypress_test/integration_tests/mobile/calc/spellchecking_spec.js                |    6 
 cypress_test/integration_tests/mobile/impress/impress_focus_spec.js             |    6 
 cypress_test/integration_tests/mobile/impress/insertion_wizard_spec.js          |    6 
 cypress_test/integration_tests/mobile/impress/spellchecking_spec.js             |    6 
 cypress_test/integration_tests/mobile/writer/apply_font_spec.js                 |    6 
 cypress_test/integration_tests/mobile/writer/apply_paragraph_properties_spec.js |    6 
 cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js             |    6 
 cypress_test/integration_tests/mobile/writer/focus_spec.js                      |    6 
 cypress_test/integration_tests/mobile/writer/insert_field_spec.js               |    6 
 cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js     |    6 
 cypress_test/integration_tests/mobile/writer/insert_object_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/spellchecking_spec.js              |    6 
 cypress_test/integration_tests/mobile/writer/table_properties_spec.js           |   43 +-----
 cypress_test/integration_tests/mobile/writer/toolbar_spec.js                    |    6 
 28 files changed, 144 insertions(+), 143 deletions(-)

New commits:
commit 9e6175ed87a924ce57686a333fbde47e84cecde3
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue May 26 11:25:02 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue May 26 13:45:10 2020 +0200

    cypress: introduce a better way of handling test file name.
    
    We both need the test file name in the beforeEach and
    afterEach method, so better to write it down twice.
    This also makes easier to handle more test files
    inside one test suite.
    
    Change-Id: I407d974c949c4485ffb6712fc833c14c3a6c50c6
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94825
    Tested-by: Jenkins
    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/desktop/calc/focus_spec.js b/cypress_test/integration_tests/desktop/calc/focus_spec.js
index 4c2982d0a..649d2ceb9 100644
--- a/cypress_test/integration_tests/desktop/calc/focus_spec.js
+++ b/cypress_test/integration_tests/desktop/calc/focus_spec.js
@@ -4,15 +4,17 @@ var helper = require('../../common/helper');
 var calc = require('../../common/calc');
 
 describe('Calc focus tests', function() {
+	var testFileName = 'focus.ods';
+
 	beforeEach(function() {
-		helper.beforeAllDesktop('focus.ods', 'calc');
+		helper.beforeAllDesktop(testFileName, 'calc');
 
 		// Wait until the Formula-Bar is loaded.
 		cy.get('.inputbar_container', {timeout : 10000});
 	});
 
 	afterEach(function() {
-		helper.afterAll('focus.ods');
+		helper.afterAll(testFileName);
 	});
 
 	it('Formula-bar focus', function() {
diff --git a/cypress_test/integration_tests/desktop/impress/slide_operations_spec.js b/cypress_test/integration_tests/desktop/impress/slide_operations_spec.js
index f7031eb3f..fb490ac6c 100644
--- a/cypress_test/integration_tests/desktop/impress/slide_operations_spec.js
+++ b/cypress_test/integration_tests/desktop/impress/slide_operations_spec.js
@@ -3,12 +3,14 @@
 var helper = require('../../common/helper');
 
 describe('Slide operations', function() {
+	var testFileName = 'slide_operations.odp';
+
 	beforeEach(function() {
-		helper.loadTestDoc('slide_operations.odp', 'impress');
+		helper.loadTestDoc(testFileName, 'impress');
 	});
 
 	afterEach(function() {
-		helper.afterAll('slide_operations.odp');
+		helper.afterAll(testFileName);
 	});
 
 	function assertNumberOfSlides(slides) {
diff --git a/cypress_test/integration_tests/desktop/writer/copy_paste_spec.js b/cypress_test/integration_tests/desktop/writer/copy_paste_spec.js
index 130581675..dddbd395e 100644
--- a/cypress_test/integration_tests/desktop/writer/copy_paste_spec.js
+++ b/cypress_test/integration_tests/desktop/writer/copy_paste_spec.js
@@ -3,12 +3,14 @@
 var helper = require('../../common/helper');
 
 describe('Clipboard operations.', function() {
+	var testFileName = 'copy_paste.odt';
+
 	beforeEach(function() {
-		helper.loadTestDoc('copy_paste.odt', 'writer');
+		helper.loadTestDoc(testFileName, 'writer');
 	});
 
 	afterEach(function() {
-		helper.afterAll('copy_paste.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Copy and Paste text.', function() {
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 64e798b45..2bf7df7f3 100644
--- a/cypress_test/integration_tests/desktop/writer/form_field_spec.js
+++ b/cypress_test/integration_tests/desktop/writer/form_field_spec.js
@@ -3,18 +3,19 @@
 var helper = require('../../common/helper');
 
 describe('Form field button tests.', function() {
+	var testFileName = 'shape_operations.odt';
 
-	afterEach(function() {
-		helper.afterAll('form_field.odt', 'writer');
-	});
-
-	function before(fileName, subFolder) {
-		helper.loadTestDoc(fileName, subFolder);
+	function before(fileName) {
+		testFileName = fileName;
+		helper.loadTestDoc(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');
 	}
+	afterEach(function() {
+		helper.afterAll(testFileName, 'writer');
+	});
 
 	function buttonShouldNotExist() {
 		cy.get('.form-field-frame')
@@ -84,7 +85,7 @@ describe('Form field button tests.', function() {
 	}
 
 	it('Activate and deactivate form field button.', function() {
-		before('form_field.odt', 'writer');
+		before('form_field.odt');
 
 		// We don't have the button by default
 		buttonShouldNotExist();
@@ -115,7 +116,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Check drop down list.', function() {
-		before('form_field.odt', 'writer');
+		before('form_field.odt');
 
 		// Move the cursor next to the form field
 		cy.get('textarea.clipboard')
@@ -158,7 +159,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Test field editing', function() {
-		before('form_field.odt', 'writer');
+		before('form_field.odt');
 
 		// Move the cursor next to the form field
 		cy.get('textarea.clipboard')
@@ -221,7 +222,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Multiple form field button activation.', function() {
-		before('multiple_form_fields.odt', 'writer');
+		before('multiple_form_fields.odt');
 
 		// We don't have the button by default
 		buttonShouldNotExist();
@@ -258,7 +259,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Test drop-down field with no selection.', function() {
-		before('drop_down_form_field_noselection.odt', 'writer');
+		before('drop_down_form_field_noselection.odt');
 
 		// Move the cursor next to the form field
 		cy.get('textarea.clipboard')
@@ -271,7 +272,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Test drop-down field with no items.', function() {
-		before('drop_down_form_field_noitem.odt', 'writer');
+		before('drop_down_form_field_noitem.odt');
 
 		// Move the cursor next to the form field
 		cy.get('textarea.clipboard')
@@ -299,7 +300,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Test field button after zoom.', function() {
-		before('form_field.odt', 'writer');
+		before('form_field.odt');
 
 		// Move the cursor next to the form field
 		cy.get('textarea.clipboard')
@@ -331,7 +332,7 @@ describe('Form field button tests.', function() {
 	});
 
 	it('Test dynamic font size.', function() {
-		before('form_field.odt', 'writer');
+		before('form_field.odt');
 
 		// Move the cursor next to the form field
 		cy.get('textarea.clipboard')
diff --git a/cypress_test/integration_tests/desktop/writer/shape_operations_spec.js b/cypress_test/integration_tests/desktop/writer/shape_operations_spec.js
index 21b0a0d8c..0d3ab3d92 100644
--- a/cypress_test/integration_tests/desktop/writer/shape_operations_spec.js
+++ b/cypress_test/integration_tests/desktop/writer/shape_operations_spec.js
@@ -3,13 +3,14 @@
 var helper = require('../../common/helper');
 
 describe('Shape operations', function() {
+	var testFileName = 'shape_operations.odt';
 
 	afterEach(function() {
-		helper.afterAll('shape_operations.odt', 'writer');
+		helper.afterAll(testFileName, 'writer');
 	});
 
 	it('Insert a simple shape.', function() {
-		helper.loadTestDoc('shape_operations.odt', 'writer');
+		helper.loadTestDoc(testFileName, 'writer');
 
 		// Scroll on the up toolbar
 		cy.get('#toolbar-up .w2ui-scroll-right').click();
diff --git a/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
index 178aaf25e..649dcb672 100644
--- a/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
@@ -6,15 +6,17 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Change alignment settings.', function() {
+	var testFileName = 'alignment_options.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('alignment_options.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
-		helper.afterAll('alignment_options.ods');
+		helper.afterAll(testFileName);
 	});
 
 	function getTextPosForFirstCell() {
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 da662c6cc..4d1294ada 100644
--- a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
@@ -6,8 +6,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Apply font changes.', function() {
+	var testFileName = 'apply_font.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('apply_font.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -29,7 +31,7 @@ describe('Apply font changes.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('apply_font.ods');
+		helper.afterAll(testFileName);
 	});
 
 	it('Apply bold.', function() {
diff --git a/cypress_test/integration_tests/mobile/calc/bottom_toolbar_spec.js b/cypress_test/integration_tests/mobile/calc/bottom_toolbar_spec.js
index 5d711fbdc..16f980097 100644
--- a/cypress_test/integration_tests/mobile/calc/bottom_toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/bottom_toolbar_spec.js
@@ -1,4 +1,4 @@
-/* global describe it cy require expect */
+/* global describe it cy require expect afterEach */
 
 var helper = require('../../common/helper');
 var calc = require('../../common/calc');
@@ -6,8 +6,11 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Interact with bottom toolbar.', function() {
-	function before(fileName, subPath) {
-		mobileHelper.beforeAllMobile(fileName, subPath);
+	var testFileName;
+
+	function before(fileName) {
+		testFileName = fileName;
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -15,9 +18,9 @@ describe('Interact with bottom toolbar.', function() {
 		calc.clickOnFirstCell();
 	}
 
-	function after(fileName) {
-		helper.afterAll(fileName);
-	}
+	afterEach(function() {
+		helper.afterAll(testFileName);
+	});
 
 	function getTextPosForFirstCell() {
 		calc.dblClickOnFirstCell();
@@ -40,7 +43,7 @@ describe('Interact with bottom toolbar.', function() {
 	}
 
 	it('Apply bold.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.bold')
 			.click();
@@ -49,12 +52,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td b')
 			.should('exist');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Apply italic.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.italic')
 			.click();
@@ -63,12 +64,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td i')
 			.should('exist');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Apply underline.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.underline')
 			.click();
@@ -77,12 +76,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td u')
 			.should('exist');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Apply strikeout.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.strikeout')
 			.click();
@@ -91,12 +88,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td s')
 			.should('exist');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Apply font color.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.textcolor')
 			.click();
@@ -111,12 +106,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td font')
 			.should('have.attr', 'color', '#00FF00');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Apply highlight color.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.backcolor')
 			.click();
@@ -131,12 +124,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'bgcolor', '#00FF00');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Merge cells', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		// Select the full row
 		calcHelper.selectFirstRow();
@@ -148,12 +139,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'colspan', '1024');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Apply left/right alignment', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		// Set right aligment first
 		cy.get('.w2ui-tb-image.w2ui-icon.alignright')
@@ -174,12 +163,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'align', 'left');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Align to center.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.alignhorizontal')
 			.click();
@@ -188,12 +175,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'align', 'center');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Change to block alignment.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.alignblock')
 			.click();
@@ -202,12 +187,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'align', 'justify');
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Enable text wrapping.', function() {
-		before('bottom_toolbar.ods', 'calc');
+		before('bottom_toolbar.ods');
 
 		helper.initAliasToNegative('originalTextPos');
 
@@ -236,12 +219,10 @@ describe('Interact with bottom toolbar.', function() {
 							});
 					});
 			});
-
-		after('bottom_toolbar.ods');
 	});
 
 	it('Insert row after.', function() {
-		before('bottom_toolbar2.ods', 'calc');
+		before('bottom_toolbar2.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.insertrowsafter')
 			.click();
@@ -262,12 +243,10 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table tr:nth-of-type(3)')
 			.should('contain.text', '2');
-
-		after('bottom_toolbar2.ods');
 	});
 
 	it('Insert column after.', function() {
-		before('bottom_toolbar2.ods', 'calc');
+		before('bottom_toolbar2.ods');
 
 		cy.get('.w2ui-tb-image.w2ui-icon.insertcolumnsafter')
 			.click();
@@ -291,7 +270,5 @@ describe('Interact with bottom toolbar.', function() {
 
 		cy.get('#copy-paste-container table tr:nth-of-type(1) td:nth-of-type(3)')
 			.should('contain.text', '1');
-
-		after('bottom_toolbar2.ods');
 	});
 });
diff --git a/cypress_test/integration_tests/mobile/calc/cell_appearance_spec.js b/cypress_test/integration_tests/mobile/calc/cell_appearance_spec.js
index c15157457..59d5edab0 100644
--- a/cypress_test/integration_tests/mobile/calc/cell_appearance_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/cell_appearance_spec.js
@@ -6,15 +6,17 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Change cell appearance.', function() {
+	var testFileName = 'cell_appearance.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('cell_appearance.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
-		helper.afterAll('cell_appearance.ods');
+		helper.afterAll(testFileName);
 	});
 
 	function openAppearencePanel() {
diff --git a/cypress_test/integration_tests/mobile/calc/focus_spec.js b/cypress_test/integration_tests/mobile/calc/focus_spec.js
index 1e63dd189..07ed8d209 100644
--- a/cypress_test/integration_tests/mobile/calc/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/focus_spec.js
@@ -5,15 +5,17 @@ var mobileHelper = require('../../common/mobile_helper');
 var calc = require('../../common/calc');
 
 describe('Calc focus tests', function() {
+	var testFileName = 'focus.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('focus.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Wait until the Formula-Bar is loaded.
 		cy.get('.inputbar_container', {timeout : 10000});
 	});
 
 	afterEach(function() {
-		helper.afterAll('focus.ods');
+		helper.afterAll(testFileName);
 	});
 
 	it('Basic document focus.', function() {
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 b742d855d..330e54ab5 100644
--- a/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
@@ -6,8 +6,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Calc insertion wizard.', function() {
+	var testFileName = 'insertion_wizard.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('insertion_wizard.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -21,7 +23,7 @@ describe('Calc insertion wizard.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('insertion_wizard.ods');
+		helper.afterAll(testFileName);
 	});
 
 	it('Check existence of image insertion items.', function() {
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 6dadd5ba7..a80bf4716 100644
--- a/cypress_test/integration_tests/mobile/calc/number_format_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
@@ -6,8 +6,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Apply number formatting.', function() {
+	var testFileName = 'number_format.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('number_format.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -28,7 +30,7 @@ describe('Apply number formatting.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('number_format.ods');
+		helper.afterAll(testFileName);
 	});
 
 	function selectFormatting(formattingString) {
diff --git a/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js b/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
index 91ea24987..198603ba8 100644
--- a/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
@@ -6,15 +6,17 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcHelper = require('./calc_helper');
 
 describe('Calc spell checking menu.', function() {
+	var testFileName = 'spellchecking.ods';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('spellchecking.ods', 'calc');
+		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
-		helper.afterAll('spellchecking.ods');
+		helper.afterAll(testFileName);
 	});
 
 	function openContextMenu() {
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 0c1739bf7..e784bbc3f 100644
--- a/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/impress_focus_spec.js
@@ -5,12 +5,14 @@ var mobileHelper = require('../../common/mobile_helper');
 var impress = require('../../common/impress');
 
 describe('Impress focus tests', function() {
+	var testFileName = 'focus.odp';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('focus.odp', 'impress');
+		mobileHelper.beforeAllMobile(testFileName, 'impress');
 	});
 
 	afterEach(function() {
-		helper.afterAll('focus.odp');
+		helper.afterAll(testFileName);
 	});
 
 	it('Select text box, no editing', function() {
diff --git a/cypress_test/integration_tests/mobile/impress/insertion_wizard_spec.js b/cypress_test/integration_tests/mobile/impress/insertion_wizard_spec.js
index 0911a01f8..ea9ea3f62 100644
--- a/cypress_test/integration_tests/mobile/impress/insertion_wizard_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/insertion_wizard_spec.js
@@ -4,8 +4,10 @@ var helper = require('../../common/helper');
 var mobileHelper = require('../../common/mobile_helper');
 
 describe('Impress insertion wizard.', function() {
+	var testFileName = 'insertion_wizard.odp';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('insertion_wizard.odp', 'impress');
+		mobileHelper.beforeAllMobile(testFileName, 'impress');
 
 		mobileHelper.enableEditingMobile();
 
@@ -13,7 +15,7 @@ describe('Impress insertion wizard.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('insertion_wizard.odp');
+		helper.afterAll(testFileName);
 	});
 
 	function selectTextOfShape() {
diff --git a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
index 66bac80f5..2a16ef837 100644
--- a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
@@ -4,15 +4,17 @@ var helper = require('../../common/helper');
 var mobileHelper = require('../../common/mobile_helper');
 
 describe('Spell checking menu.', function() {
+	var testFileName = 'spellchecking.odp';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('spellchecking.odp', 'impress');
+		mobileHelper.beforeAllMobile(testFileName, 'impress');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
-		helper.afterAll('spellchecking.odp');
+		helper.afterAll(testFileName);
 	});
 
 	function openContextMenu() {
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 69d307d8f..00f16ce7c 100644
--- a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
@@ -5,8 +5,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Apply font changes.', function() {
+	var testFileName = 'apply_font.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('apply_font.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -18,7 +20,7 @@ describe('Apply font changes.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('apply_font.odt');
+		helper.afterAll(testFileName);
 	});
 
 	function applyStyle(styleName) {
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 030e91686..5354bb11e 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
@@ -5,8 +5,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Apply paragraph properties.', function() {
+	var testFileName = 'apply_paragraph_properties.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('apply_paragraph_properties.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -25,7 +27,7 @@ describe('Apply paragraph properties.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('apply_paragraph_properties.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Apply left alignment.', function() {
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 a819046e1..14b57ba65 100644
--- a/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/bottom_toolbar_spec.js
@@ -5,8 +5,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Pushing bottom toolbar items.', function() {
+	var testFileName = 'bottom_toolbar.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('bottom_toolbar.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -16,7 +18,7 @@ describe('Pushing bottom toolbar items.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('bottom_toolbar.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Apply bold.', function() {
diff --git a/cypress_test/integration_tests/mobile/writer/focus_spec.js b/cypress_test/integration_tests/mobile/writer/focus_spec.js
index e09c3c85e..156c81013 100644
--- a/cypress_test/integration_tests/mobile/writer/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/focus_spec.js
@@ -4,12 +4,14 @@ var helper = require('../../common/helper');
 var mobileHelper = require('../../common/mobile_helper');
 
 describe('Focus tests', function() {
+	var testFileName = 'focus.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('focus.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 	});
 
 	afterEach(function() {
-		helper.afterAll('focus.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Basic document focus.', function() {
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 842abfba1..1a6930bea 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
@@ -5,8 +5,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Insert fields via insertion wizard.', function() {
+	var testFileName = 'insert_field.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('insert_field.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -22,7 +24,7 @@ describe('Insert fields via insertion wizard.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('insert_field.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Insert page number field.', function() {
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 3758a6b71..bf4a2c263 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
@@ -5,8 +5,10 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Insert formatting mark via insertion wizard.', function() {
+	var testFileName = 'insert_formatting_mark.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('insert_formatting_mark.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -22,7 +24,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('insert_formatting_mark.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Insert non-breaking space.', function() {
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 0c2bb2630..2e51a718a 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
@@ -5,15 +5,17 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Insert objects via insertion wizard.', function() {
+	var testFileName = 'insert_object.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('insert_object.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
-		helper.afterAll('insert_object.odt');
+		helper.afterAll(testFileName);
 	});
 
 	function getCursorPos(offsetProperty, aliasName) {
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 1adae5376..0e86911db 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
@@ -4,12 +4,14 @@ var helper = require('../../common/helper');
 var mobileHelper = require('../../common/mobile_helper');
 
 describe('Mobile wizard state tests', function() {
+	var testFileName = 'mobile_wizard_state.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('mobile_wizard_state.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 	});
 
 	afterEach(function() {
-		helper.afterAll('mobile_wizard_state.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('Open and close mobile wizard by toolbar item.', function() {
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 d111f59b1..550f91672 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -6,9 +6,10 @@ 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';
+	var testFileName = 'shape_properties.odt';
 
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('shape_properties.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
@@ -36,7 +37,7 @@ describe('Change shape properties via mobile wizard.', function() {
 	});
 
 	afterEach(function() {
-		helper.afterAll('shape_properties.odt');
+		helper.afterAll(testFileName);
 	});
 
 	function triggerNewSVG() {
diff --git a/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js b/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
index d2cf1ed4d..8f5c9d297 100644
--- a/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
@@ -5,15 +5,17 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerHelper = require('./writer_helper');
 
 describe('Spell checking menu.', function() {
+	var testFileName = 'spellchecking.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('spellchecking.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	});
 
 	afterEach(function() {
-		helper.afterAll('spellchecking.odt');
+		helper.afterAll(testFileName);
 	});
 
 	function openContextMenu() {
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 28a792330..c082ee1f5 100644
--- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
@@ -1,17 +1,24 @@
-/* global describe it cy require expect Cypress*/
+/* global describe it cy require expect Cypress afterEach */
 
 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() {
+	var testFileName = 'spellchecking.odt';
+
 	function before(testFile) {
-		helper.loadTestDoc(testFile, 'writer', true);
+		testFileName = testFile;
+		helper.loadTestDoc(testFileName, 'writer', true);
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
 	}
 
+	afterEach(function() {
+		helper.afterAll(testFileName);
+	});
+
 	function openTablePanel() {
 		mobileHelper.openMobileWizard();
 
@@ -63,8 +70,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 			});
 		cy.get('#copy-paste-container td')
 			.should('have.length', 8);
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Insert row after.', function() {
@@ -94,8 +99,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 			});
 		cy.get('#copy-paste-container td')
 			.should('have.length', 8);
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Insert column before.', function() {
@@ -125,8 +128,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 				expect(columns[0].textContent).to.not.have.string('text');
 				expect(columns[1].textContent).to.have.string('text');
 			});
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Insert column after.', function() {
@@ -156,8 +157,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 				expect(columns[0].textContent).to.have.string('text');
 				expect(columns[1].textContent).to.not.have.string('text');
 			});
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Delete row.', function() {
@@ -187,8 +186,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 			});
 		cy.get('#copy-paste-container td')
 			.should('have.length', 4);
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Delete column.', function() {
@@ -219,8 +216,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 				expect(columns[1].textContent).to.not.have.string('text');
 				expect(columns[2].textContent).to.not.have.string('text');
 			});
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Delete table.', function() {
@@ -250,8 +245,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 				expect(markers).to.have.lengthOf(2);
 				expect(markers[0].getBoundingClientRect().top).to.equal(markers[1].getBoundingClientRect().top);
 			});
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Merge cells.', function() {
@@ -280,8 +273,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 			.should('have.length', 2);
 		cy.get('#copy-paste-container td')
 			.should('have.length', 3);
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Change row height.', function() {
@@ -310,8 +301,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		// Check row height
 		cy.get('#copy-paste-container td')
 			.should('have.attr', 'height', '125');
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Change column width.', function() {
@@ -340,8 +329,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		// Check row height
 		cy.get('#copy-paste-container td')
 			.should('have.attr', 'width', '81%');
-
-		helper.afterAll('table_properties.odt');
 	});
 
 	it('Set minimal row height.', function() {
@@ -367,8 +354,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 		// Check new row height
 		cy.get('#copy-paste-container td')
 			.should('not.have.attr', 'height');
-
-		helper.afterAll('table_with_text.odt');
 	});
 
 	it('Set optimal row height.', function() {
@@ -403,8 +388,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 						expect(items[i]).not.have.attr('height');
 				}
 			});
-
-		helper.afterAll('table_with_text.odt');
 	});
 
 	it('Distribute rows.', function() {
@@ -439,8 +422,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 						expect(items[i]).not.have.attr('height');
 				}
 			});
-
-		helper.afterAll('table_with_text.odt');
 	});
 
 	it('Set minimal column width.', function() {
@@ -464,8 +445,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 
 		cy.get('#copy-paste-container td')
 			.should('have.attr', 'width', '24');
-
-		helper.afterAll('table_with_text.odt');
 	});
 
 	it('Set optimal column width.', function() {
@@ -491,8 +470,6 @@ describe('Change table properties / layout via mobile wizard.', function() {
 			.should('have.attr', 'width', '324');
 		cy.get('#copy-paste-container td:nth-of-type(2n)')
 			.should('have.attr', 'width', '323');
-
-		helper.afterAll('table_with_text.odt');
 	});
 
 	it('Distribute columns.', function() {
@@ -516,7 +493,5 @@ describe('Change table properties / layout via mobile wizard.', function() {
 
 		cy.get('#copy-paste-container td')
 			.should('have.attr', 'width', '323');
-
-		helper.afterAll('table_with_text.odt');
 	});
 });
diff --git a/cypress_test/integration_tests/mobile/writer/toolbar_spec.js b/cypress_test/integration_tests/mobile/writer/toolbar_spec.js
index b1894e990..c4209452c 100644
--- a/cypress_test/integration_tests/mobile/writer/toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/toolbar_spec.js
@@ -4,12 +4,14 @@ var helper = require('../../common/helper');
 var mobileHelper = require('../../common/mobile_helper');
 
 describe('Toolbar tests', function() {
+	var testFileName = 'toolbar.odt';
+
 	beforeEach(function() {
-		mobileHelper.beforeAllMobile('toolbar.odt', 'writer');
+		mobileHelper.beforeAllMobile(testFileName, 'writer');
 	});
 
 	afterEach(function() {
-		helper.afterAll('toolbar.odt');
+		helper.afterAll(testFileName);
 	});
 
 	it('State of mobile wizard toolbar item.', function() {


More information about the Libreoffice-commits mailing list