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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 11:58:43 UTC 2020


 cypress_test/integration_tests/common/mobile_helper.js                 |   10 ++
 cypress_test/integration_tests/mobile/calc/apply_font_spec.js          |    8 -
 cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js      |    7 -
 cypress_test/integration_tests/mobile/impress/apply_font_shape_spec.js |   41 +++-------
 cypress_test/integration_tests/mobile/impress/apply_font_text_spec.js  |   37 +++------
 cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js   |    7 -
 6 files changed, 43 insertions(+), 67 deletions(-)

New commits:
commit 1d39969a9ae9fa2b1b38c3a805d4a2b2f830bfe1
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Aug 3 06:24:11 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Aug 3 13:58:24 2020 +0200

    cypress: extract openTextPropertiesPanel() method.
    
    Change-Id: I14f424d3141d596f982cda349df786dd8940b6c1
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99977
    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/common/mobile_helper.js b/cypress_test/integration_tests/common/mobile_helper.js
index 8aaa1f8af..9875b29d9 100644
--- a/cypress_test/integration_tests/common/mobile_helper.js
+++ b/cypress_test/integration_tests/common/mobile_helper.js
@@ -203,6 +203,15 @@ function selectFromColorPalette(paletteNum, groupNum, colorNum) {
 	cy.log('Selecting a color from the color palette - end.');
 }
 
+function openTextPropertiesPanel() {
+	openMobileWizard();
+
+	helper.clickOnIdle('#TextPropertyPanel');
+
+	cy.get('#Bold')
+		.should('be.visible');
+}
+
 module.exports.enableEditingMobile = enableEditingMobile;
 module.exports.longPressOnDocument = longPressOnDocument;
 module.exports.openHamburgerMenu = openHamburgerMenu;
@@ -213,3 +222,4 @@ module.exports.executeCopyFromContextMenu = executeCopyFromContextMenu;
 module.exports.openInsertionWizard = openInsertionWizard;
 module.exports.closeInsertionWizard = closeInsertionWizard;
 module.exports.selectFromColorPalette = selectFromColorPalette;
+module.exports.openTextPropertiesPanel = openTextPropertiesPanel;
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 3dca28d9c..c04b45370 100644
--- a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
@@ -19,14 +19,8 @@ describe('Apply font changes.', function() {
 		cy.get('.leaflet-marker-icon')
 			.should('be.visible');
 
-		// Open mobile wizard
-		mobileHelper.openMobileWizard();
-
 		// Open character properties
-		helper.clickOnIdle('#TextPropertyPanel');
-
-		cy.get('#Bold')
-			.should('be.visible');
+		mobileHelper.openTextPropertiesPanel();
 	});
 
 	afterEach(function() {
diff --git a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
index 298d520d7..7b71b3c16 100644
--- a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
@@ -875,12 +875,7 @@ describe('Trigger hamburger menu options.', function() {
 
 		mobileHelper.closeMobileWizard();
 
-		mobileHelper.openMobileWizard();
-
-		helper.clickOnIdle('#TextPropertyPanel');
-
-		cy.get('#Bold')
-			.should('be.visible');
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Color');
 
diff --git a/cypress_test/integration_tests/mobile/impress/apply_font_shape_spec.js b/cypress_test/integration_tests/mobile/impress/apply_font_shape_spec.js
index f75166055..e7a235586 100644
--- a/cypress_test/integration_tests/mobile/impress/apply_font_shape_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/apply_font_shape_spec.js
@@ -24,17 +24,8 @@ describe('Apply font on selected shape.', function() {
 		impressMobileHelper.triggerNewSVGForShapeInTheCenter();
 	}
 
-	function openTextPropertiesPanel() {
-		mobileHelper.openMobileWizard();
-
-		helper.clickOnIdle('#TextPropertyPanel');
-
-		cy.get('.ui-content.level-0.mobile-wizard')
-			.should('be.visible');
-	}
-
 	it('Apply bold on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Bold');
 
@@ -45,7 +36,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Apply italic on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Italic');
 
@@ -56,7 +47,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Apply underline on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Underline');
 
@@ -67,7 +58,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Apply strikeout on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Strikeout');
 
@@ -78,7 +69,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Apply shadowed on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Shadowed');
 
@@ -89,7 +80,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Change font name of text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#fontnamecombobox');
 
@@ -107,7 +98,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Change font size of text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('have.attr', 'font-size', '635px');
@@ -128,7 +119,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Grow font size of text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('have.attr', 'font-size', '635px');
@@ -142,7 +133,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Shrink font size of text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('have.attr', 'font-size', '635px');
@@ -159,7 +150,7 @@ describe('Apply font on selected shape.', function() {
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition tspan')
 			.should('have.attr', 'fill', 'rgb(0,0,0)');
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('not.have.attr', 'font-color');
@@ -175,7 +166,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Apply highlight on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('not.have.attr', 'font-color');
@@ -191,14 +182,14 @@ describe('Apply font on selected shape.', function() {
 
 		// TODO: highlight color is not in the SVG
 		// At least check the mobile wizard's state
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('#CharBackColor .color-sample-selected')
 			.should('have.attr', 'style', 'background-color: rgb(204, 0, 0);');
 	});
 
 	it('Apply superscript on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition')
 			.should('have.attr', 'y', '3495');
@@ -216,7 +207,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Apply subscript on text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition')
 			.should('have.attr', 'y', '3495');
@@ -234,7 +225,7 @@ describe('Apply font on selected shape.', function() {
 	});
 
 	it('Clear direct formatting of text shape.', function() {
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		// Change the font size first
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
@@ -248,7 +239,7 @@ describe('Apply font on selected shape.', function() {
 			.should('have.attr', 'font-size', '705px');
 
 		// Remove direct formatting
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#clearFormatting');
 
diff --git a/cypress_test/integration_tests/mobile/impress/apply_font_text_spec.js b/cypress_test/integration_tests/mobile/impress/apply_font_text_spec.js
index ad667d6df..add3efd84 100644
--- a/cypress_test/integration_tests/mobile/impress/apply_font_text_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/apply_font_text_spec.js
@@ -24,19 +24,10 @@ describe('Apply font on selected text.', function() {
 		impressMobileHelper.triggerNewSVGForShapeInTheCenter();
 	}
 
-	function openTextPropertiesPanel() {
-		mobileHelper.openMobileWizard();
-
-		helper.clickOnIdle('#TextPropertyPanel');
-
-		cy.get('.ui-content.level-0.mobile-wizard')
-			.should('be.visible');
-	}
-
 	it('Apply bold on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Bold');
 
@@ -49,7 +40,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply italic on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Italic');
 
@@ -62,7 +53,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply underline on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Underline');
 
@@ -75,7 +66,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply strikeout on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Strikeout');
 
@@ -88,7 +79,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply shadowed on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Shadowed');
 
@@ -101,7 +92,7 @@ describe('Apply font on selected text.', function() {
 	it('Change font name of selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#fontnamecombobox');
 
@@ -121,7 +112,7 @@ describe('Apply font on selected text.', function() {
 	it('Change font size of selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('have.attr', 'font-size', '635px');
@@ -144,7 +135,7 @@ describe('Apply font on selected text.', function() {
 	it('Grow font size of selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('have.attr', 'font-size', '635px');
@@ -160,7 +151,7 @@ describe('Apply font on selected text.', function() {
 	it('Shrink font size of selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('have.attr', 'font-size', '635px');
@@ -179,7 +170,7 @@ describe('Apply font on selected text.', function() {
 
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph')
 			.should('not.have.attr', 'font-color');
@@ -197,7 +188,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply highlight on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#CharBackColor');
 
@@ -213,7 +204,7 @@ describe('Apply font on selected text.', function() {
 		cy.wait(400);
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('#CharBackColor .color-sample-selected')
 			.should('have.attr', 'style', 'background-color: rgb(204, 0, 0);');
@@ -222,7 +213,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply superscript on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition')
 			.should('have.attr', 'y', '3495');
@@ -242,7 +233,7 @@ describe('Apply font on selected text.', function() {
 	it('Apply subscript on selected text.', function() {
 		impressMobileHelper.selectTextOfShape();
 
-		openTextPropertiesPanel();
+		mobileHelper.openTextPropertiesPanel();
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextPosition')
 			.should('have.attr', 'y', '3495');
diff --git a/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js
index 6631ca0bb..446375fdf 100644
--- a/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js
@@ -464,12 +464,7 @@ describe('Trigger hamburger menu options.', function() {
 		// Make everything white on tile
 		impressMobileHelper.selectTextOfShape();
 
-		mobileHelper.openMobileWizard();
-
-		helper.clickOnIdle('#TextPropertyPanel');
-
-		cy.get('#Bold')
-			.should('be.visible');
+		mobileHelper.openTextPropertiesPanel();
 
 		helper.clickOnIdle('#Color');
 


More information about the Libreoffice-commits mailing list