[Libreoffice-commits] online.git: Branch 'feature/cypress_master' - 3 commits - cypress_test/integration_tests

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 29 13:48:26 UTC 2020


 cypress_test/integration_tests/mobile/apply_paragraph_properties_spec.js |  504 ++++++++++
 cypress_test/integration_tests/mobile/insert_field_spec.js               |  181 +++
 cypress_test/integration_tests/mobile/insert_formatting_mark_spec.js     |  194 +++
 cypress_test/integration_tests/mobile/insert_object_spec.js              |   35 
 4 files changed, 879 insertions(+), 35 deletions(-)

New commits:
commit d7a3551a1987cc95868a8984fa185a3421ff7920
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jan 29 14:46:30 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 29 14:46:30 2020 +0100

    cypress: mobile: Test applying paragraph properties.
    
    Change-Id: Icee81a71dcbdd7888f77e8cd53d7f0b9234ea94c

diff --git a/cypress_test/integration_tests/mobile/apply_paragraph_properties_spec.js b/cypress_test/integration_tests/mobile/apply_paragraph_properties_spec.js
new file mode 100644
index 000000000..1660bec7e
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/apply_paragraph_properties_spec.js
@@ -0,0 +1,504 @@
+/* global describe it cy beforeEach require expect afterEach*/
+
+var helper = require('../common/helper');
+
+describe('Apply paragraph properties.', function() {
+	beforeEach(function() {
+		helper.loadTestDoc('simple.odt', true);
+
+		// Click on edit button
+		cy.get('#mobile-edit-button').click();
+
+		// Open mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.should('not.have.class', 'disabled')
+			.click();
+
+		// Open paragraph properties
+		cy.get('#Paragraph')
+			.click();
+	});
+
+	afterEach(function() {
+		cy.get('.closemobile').click();
+		cy.wait(200); // wait some time to actually release the document
+	});
+
+	function generateTextHTML() {
+		// Do a new selection
+		cy.get('#document-container').click();
+		cy.get('.leaflet-marker-icon')
+			.should('not.exist');
+
+		cy.wait(200);
+
+		cy.get('body').type('{shift}{home}');
+		cy.get('.leaflet-marker-icon');
+
+		cy.wait(200);
+
+		// 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;
+				cy.get('body').rightclick(XPos, YPos);
+			});
+
+		// Execute copy
+		cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon .context-menu-link')
+			.contains('Copy')
+			.click();
+
+		// Close warning about clipboard operations
+		cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+			.click();
+	}
+
+	it('Apply left alignment.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change alignment
+		cy.get('#CenterPara')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('have.attr', 'align', 'center');
+
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Open mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		// Open paragraph properties
+		cy.get('#Paragraph')
+			.click();
+
+		// Change alignment
+		cy.get('#LeftPara')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('have.attr', 'align', 'left');
+	});
+
+	it('Apply center alignment.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change alignment
+		cy.get('#CenterPara')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('have.attr', 'align', 'center');
+	});
+
+	it('Apply right alignment.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change alignment
+		cy.get('#RightPara')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('have.attr', 'align', 'right');
+	});
+
+	it('Apply justify alignment.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change alignment
+		cy.get('#JustifyPara')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('have.attr', 'align', 'justify');
+	});
+
+	it('Change writing direction.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change writing mode
+		cy.get('#ParaRightToLeft')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('have.attr', 'dir', 'rtl');
+
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Open mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		// Open paragraph properties
+		cy.get('#Paragraph')
+			.click();
+
+		// Change writing mode
+		cy.get('#ParaLeftToRight')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.should('not.have.attr', 'dir');
+	});
+
+	it('Apply default bulleting.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		cy.get('#DefaultBullet')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container ul li p')
+			.should('exist');
+	});
+
+	it('Apply default numbering.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		cy.get('#DefaultNumbering')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container ol li p')
+			.should('exist');
+	});
+
+	it('Apply background color.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change background color
+		cy.get('#BackgroundColor')
+			.click();
+
+		cy.get('#color-picker-2-basic-color-5')
+			.click();
+
+		cy.get('#color-picker-2-tint-3')
+			.click();
+
+		cy.get('#mobile-wizard-back')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['background']).to.be.equal('rgb(0, 255, 0)');
+			});
+	});
+
+	it('Increase / decrease para spacing.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Increase para spacing
+		cy.get('#ParaspaceIncrease')
+			.click();
+		cy.get('#ParaspaceIncrease')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-top']).to.be.equal('0.08in');
+				expect(item[0].style['margin-bottom']).to.be.equal('0.08in');
+			});
+
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Open mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		// Open paragraph properties
+		cy.get('#Paragraph')
+			.click();
+
+		// Decrease para spacing
+		cy.get('#ParaspaceDecrease')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-top']).to.be.equal('0.04in');
+				expect(item[0].style['margin-bottom']).to.be.equal('0.04in');
+			});
+	});
+
+	it('Change para spacing via combobox.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Check para spacing current value
+		cy.get('#aboveparaspacing .spinfield')
+			.should('have.attr', 'value', '0.0');
+		cy.get('#belowparaspacing .spinfield')
+			.should('have.attr', 'value', '0.0');
+
+		// Change spacing
+		cy.get('#aboveparaspacing .sinfieldcontrols .plus')
+			.click();
+		cy.get('#aboveparaspacing .spinfield')
+			.should('have.attr', 'value', '0.02');
+		cy.get('#aboveparaspacing .sinfieldcontrols .plus')
+			.click();
+		cy.get('#aboveparaspacing .spinfield')
+			.should('have.attr', 'value', '0.04');
+		cy.get('#aboveparaspacing .sinfieldcontrols .plus')
+			.click();
+		cy.get('#aboveparaspacing .spinfield')
+			.should('have.attr', 'value', '0.06');
+
+		cy.get('#belowparaspacing .sinfieldcontrols .plus')
+			.click();
+		cy.get('#belowparaspacing .spinfield')
+			.should('have.attr', 'value', '0.02');
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-top']).to.be.equal('0.06in');
+				expect(item[0].style['margin-bottom']).to.be.equal('0.02in');
+			});
+	});
+
+	it('Increase / decrease indent.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Increase indent
+		cy.get('#IncrementIndent')
+			.click();
+		cy.get('#IncrementIndent')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-left']).to.be.equal('0.98in');
+			});
+
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Open mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		// Open paragraph properties
+		cy.get('#Paragraph')
+			.click();
+
+		// Decrease indent
+		cy.get('#DecrementIndent')
+			.click();
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-left']).to.be.equal('0.49in');
+			});
+	});
+
+	it('Apply before text indent.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change indent
+		cy.get('#beforetextindent .sinfieldcontrols .plus')
+			.click();
+		cy.get('#beforetextindent .spinfield')
+			.should('have.attr', 'value', '0.02');
+		cy.get('#beforetextindent .sinfieldcontrols .plus')
+			.click();
+		cy.get('#beforetextindent .spinfield')
+			.should('have.attr', 'value', '0.04');
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-left']).to.be.equal('0.04in');
+			});
+	});
+
+	it('Apply after text indent.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Change indent
+		cy.get('#aftertextindent .sinfieldcontrols .plus')
+			.click();
+		cy.get('#aftertextindent .spinfield')
+			.should('have.attr', 'value', '0.02');
+		cy.get('#aftertextindent .sinfieldcontrols .plus')
+			.click();
+		cy.get('#aftertextindent .spinfield')
+			.should('have.attr', 'value', '0.04');
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['margin-right']).to.be.equal('0.04in');
+			});
+	});
+
+	it('Apply first line indent.', function() {
+		// Select text
+		cy.get('#document-container').dblclick();
+		cy.get('.leaflet-marker-icon');
+
+		// Increase firstline indent
+		cy.get('#firstlineindent .sinfieldcontrols .plus')
+			.click();
+		cy.get('#firstlineindent .spinfield')
+			.should('have.attr', 'value', '0.02');
+		cy.get('#firstlineindent .sinfieldcontrols .plus')
+			.click();
+		cy.get('#firstlineindent .spinfield')
+			.should('have.attr', 'value', '0.04');
+
+		// Close mobile wizard
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].style['text-indent']).to.be.equal('0.04in');
+			});
+	});
+});
commit e5d480873b94c3a99b672d2733740fd13f35a4ff
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jan 29 12:57:54 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 29 13:06:19 2020 +0100

    cypress: mobile: test formatting mark insertion.
    
    Change-Id: Ib3619e6830f25d7c78e369d714e0c4de6a47244b

diff --git a/cypress_test/integration_tests/mobile/insert_formatting_mark_spec.js b/cypress_test/integration_tests/mobile/insert_formatting_mark_spec.js
new file mode 100644
index 000000000..76a68f62e
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/insert_formatting_mark_spec.js
@@ -0,0 +1,194 @@
+/* global describe it cy beforeEach require expect afterEach*/
+
+var helper = require('../common/helper');
+
+describe('Insert formatting mark via insertion wizard.', function() {
+	beforeEach(function() {
+		helper.loadTestDoc('simple.odt', true);
+
+		// Click on edit button
+		cy.get('#mobile-edit-button').click();
+
+		// Open insertion wizard
+		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
+			.should('not.have.class', 'disabled')
+			.click();
+	});
+
+	afterEach(function() {
+		cy.get('.closemobile').click();
+		cy.wait(200); // wait some time to actually release the document
+	});
+
+	function generateTextHTML() {
+		// Do a new selection
+		cy.get('#document-container').click();
+		cy.get('.leaflet-marker-icon')
+			.should('not.exist');
+
+		cy.wait(200);
+
+		cy.get('body').type('{shift}{home}');
+		cy.get('.leaflet-marker-icon');
+
+		cy.wait(200);
+
+		// 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;
+				cy.get('body').rightclick(XPos, YPos);
+			});
+
+		// Execute copy
+		cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon .context-menu-link')
+			.contains('Copy')
+			.click();
+
+		// Close warning about clipboard operations
+		cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+			.click();
+	}
+
+	it('Insert non-breaking space.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('Non-breaking space')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u00a0');
+			});
+	});
+
+	it('Insert non-breaking hyphen.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('Non-breaking hyphen')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u2011');
+			});
+	});
+
+	it('Insert soft hyphen.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('Soft hyphen')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u00ad');
+			});
+	});
+
+	it('Insert no-width optional break.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('No-width optional break')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u200b');
+			});
+	});
+
+	it('Insert no-width no break.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('No-width no break')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u2060');
+			});
+	});
+
+	it('Insert left-to-right mark.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('Left-to-right mark')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u200e');
+			});
+	});
+
+	it('Insert right-to-left mark.', function() {
+		// Open formatting marks
+		cy.get('.sub-menu-title')
+			.contains('Formatting Mark')
+			.click();
+
+		// Do the insertion
+		cy.get('.menu-entry-no-icon')
+			.contains('Right-to-left mark')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p')
+			.then(function(item) {
+				expect(item).to.have.lengthOf(1);
+				expect(item[0].innerText).to.have.string('\u200f');
+			});
+	});
+});
diff --git a/cypress_test/integration_tests/mobile/insert_object_spec.js b/cypress_test/integration_tests/mobile/insert_object_spec.js
index 2754fbd00..6b9001894 100644
--- a/cypress_test/integration_tests/mobile/insert_object_spec.js
+++ b/cypress_test/integration_tests/mobile/insert_object_spec.js
@@ -238,23 +238,4 @@ describe('Insert objects via insertion wizard.', function() {
 				expect(svg[0].getBBox().height).to.be.greaterThan(0);
 			});
 	});
-
-	it('Insert formatting mark.', function() {
-		// Open formatting marks
-		cy.get('.sub-menu-title')
-			.contains('Formatting Mark')
-			.click();
-
-		// Do the insertion
-		cy.get('.menu-entry-no-icon')
-			.contains('Non-breaking space')
-			.should('be.visible')
-			.click();
-
-		// Do a selection to see something is inserted
-		cy.get('body').type('{shift}{leftarrow}');
-		cy.get('.leaflet-marker-icon')
-			.should('exist')
-			.should('have.length', 2);
-	});
 });
commit 0fb5cb10e21937a6d964f1ac0487f6904c4b0a99
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jan 29 12:57:39 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 29 12:57:39 2020 +0100

    cypress: mobile: test field insertion.
    
    Change-Id: Ie7618436c57a30ef4282c042ff04262f55e0b17c

diff --git a/cypress_test/integration_tests/mobile/insert_field_spec.js b/cypress_test/integration_tests/mobile/insert_field_spec.js
new file mode 100644
index 000000000..65e4b732f
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/insert_field_spec.js
@@ -0,0 +1,181 @@
+/* global describe it cy beforeEach require expect afterEach*/
+
+var helper = require('../common/helper');
+
+describe('Insert fields via insertion wizard.', function() {
+	beforeEach(function() {
+		helper.loadTestDoc('simple.odt', true);
+
+		// Click on edit button
+		cy.get('#mobile-edit-button').click();
+
+		// Open insertion wizard
+		cy.get('#tb_actionbar_item_insertion_mobile_wizard')
+			.should('not.have.class', 'disabled')
+			.click();
+	});
+
+	afterEach(function() {
+		cy.get('.closemobile').click();
+		cy.wait(200); // wait some time to actually release the document
+	});
+
+	function generateTextHTML() {
+		// Do a new selection
+		cy.get('#document-container').click();
+		cy.get('.leaflet-marker-icon')
+			.should('not.exist');
+
+		cy.wait(200);
+
+		cy.get('body').type('{shift}{home}');
+		cy.get('.leaflet-marker-icon');
+
+		cy.wait(200);
+
+		// 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;
+				cy.get('body').rightclick(XPos, YPos);
+			});
+
+		// Execute copy
+		cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon .context-menu-link')
+			.contains('Copy')
+			.click();
+
+		// Close warning about clipboard operations
+		cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+			.click();
+	}
+
+	it('Insert page number field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('Page Number')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'PAGE')
+			.contains('1');
+	});
+
+	it('Insert page count field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('Page Count')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'DOCSTAT')
+			.contains('1');
+	});
+
+	it('Insert date field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('Date')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'DATETIME')
+			.should('have.attr', 'sdnum', '1033;1033;MM/DD/YY');
+	});
+
+	it('Insert time field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('Time')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'DATETIME')
+			.should('have.attr', 'sdnum', '1033;1033;HH:MM:SS AM/PM');
+	});
+
+	it('Insert title field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('Title')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'DOCINFO')
+			.should('have.attr', 'subtype', 'TITLE');
+	});
+
+	it('Insert author field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('First Author')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'DOCINFO')
+			.should('have.attr', 'subtype', 'CREATE')
+			.should('have.attr', 'format', 'AUTHOR');
+	});
+
+	it('Insert subject field.', function() {
+		// Open fields submenu
+		cy.get('.sub-menu-title')
+			.contains('More Fields...')
+			.click();
+
+		// Insert field
+		cy.get('.menu-entry-with-icon')
+			.contains('Subject')
+			.click();
+
+		generateTextHTML();
+
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'type', 'DOCINFO')
+			.should('have.attr', 'subtype', 'THEME');
+	});
+});
diff --git a/cypress_test/integration_tests/mobile/insert_object_spec.js b/cypress_test/integration_tests/mobile/insert_object_spec.js
index 7de023130..2754fbd00 100644
--- a/cypress_test/integration_tests/mobile/insert_object_spec.js
+++ b/cypress_test/integration_tests/mobile/insert_object_spec.js
@@ -66,22 +66,6 @@ describe('Insert objects via insertion wizard.', function() {
 			.should('have.length', 2);
 	});
 
-	it('Insert field.', function() {
-		// Open fields submenu
-		cy.get('.sub-menu-title')
-			.contains('More Fields...')
-			.click();
-		cy.get('.menu-entry-with-icon')
-			.contains('Page Number')
-			.click();
-
-		// Do a selection to see something is inserted
-		cy.get('body').type('{shift}{leftarrow}');
-		cy.get('.leaflet-marker-icon')
-			.should('exist')
-			.should('have.length', 2);
-	});
-
 	it('Insert header.', function() {
 		// Get the blinking cursor pos
 		cy.get('#document-container').type('xxxx');


More information about the Libreoffice-commits mailing list