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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 13 19:19:14 UTC 2020


 cypress_test/integration_tests/mobile/writer/shape_properties_spec.js |   50 +++++-----
 1 file changed, 28 insertions(+), 22 deletions(-)

New commits:
commit f3572dc98828b1c5d617f3b503e76c7448fa5439
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Jul 13 13:32:04 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Jul 13 21:18:56 2020 +0200

    cypress: update writer shape related tests.
    
    Change-Id: I9be13d65d054320e473a9060ab4353bd08b476fb
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98671
    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/mobile/writer/shape_properties_spec.js b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
index 01dcd3c71..e9c2aeede 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -43,15 +43,32 @@ describe('Change shape properties via mobile wizard.', function() {
 	function triggerNewSVG() {
 		mobileHelper.closeMobileWizard();
 
-		// Change width
-		openPosSizePanel();
-
-		cy.get('#selectwidth .plus')
-			.should('be.visible');
-
-		helper.clickOnIdle('#selectwidth .plus');
-
-		mobileHelper.closeMobileWizard();
+		// Remove selection first with clicking next to handler
+		cy.get('.leaflet-drag-transform-marker.drag-marker--0')
+			.then(function(items) {
+				var XPos = items[0].getBoundingClientRect().left;
+				var YPos = items[0].getBoundingClientRect().top;
+				// Sometimes selection is persistent, so click more times
+				// to achive actual deselection.
+				cy.get('body')
+					.click(XPos - 10, YPos);
+
+				cy.get('body')
+					.dblclick(XPos - 10, YPos);
+
+				cy.get('.leaflet-drag-transform-marker')
+					.should('not.exist');
+
+				// Reselect the shape
+				cy.get('body')
+					.click(XPos + 20, YPos);
+
+				cy.get('body')
+					.click(XPos + 20, YPos);
+
+				cy.get('.leaflet-drag-transform-marker')
+					.should('exist');
+			});
 	}
 
 	function openPosSizePanel() {
@@ -82,7 +99,6 @@ describe('Change shape properties via mobile wizard.', function() {
 	});
 
 	it('Change shape width.', function() {
-
 		openPosSizePanel();
 
 		cy.get('#selectwidth .spinfield')
@@ -98,7 +114,6 @@ describe('Change shape properties via mobile wizard.', function() {
 	});
 
 	it('Change shape height.', function() {
-
 		openPosSizePanel();
 
 		cy.get('#selectheight .spinfield')
@@ -155,7 +170,7 @@ describe('Change shape properties via mobile wizard.', function() {
 			.should('not.have.attr', 'd', defaultGeometry);
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g path')
-			.should('have.attr', 'd', 'M 8010,4863 L 1963,10855 8010,10855 8010,4863 8010,4863 Z');
+			.should('have.attr', 'd', 'M 7955,4863 L 1963,10855 7955,10855 7955,4863 7955,4863 Z');
 	});
 
 	it('Trigger moving backward / forward', function() {
@@ -202,7 +217,7 @@ describe('Change shape properties via mobile wizard.', function() {
 			.should('have.length.greaterThan', 12);
 	});
 
-	it.skip('Change line width', function() {
+	it('Change line width', function() {
 		openLinePropertyPanel();
 
 		cy.get('#linewidth .spinfield')
@@ -214,15 +229,6 @@ describe('Change shape properties via mobile wizard.', function() {
 
 		cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g path[fill="none"]')
 			.should('have.attr', 'stroke-width', '141');
-
-		openLinePropertyPanel();
-
-		helper.clickOnIdle('#linewidth .minus');
-
-		triggerNewSVG();
-
-		cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g path[fill="none"]')
-			.should('have.attr', 'stroke-width', '88');
 	});
 
 	it('Change line transparency', function() {


More information about the Libreoffice-commits mailing list