[Libreoffice-commits] online.git: cypress_test/integration_tests
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 4 09:02:00 UTC 2020
cypress_test/integration_tests/mobile/impress/apply_paragraph_props_spec.js | 354 +++++++++-
1 file changed, 345 insertions(+), 9 deletions(-)
New commits:
commit 8fc6a5762c1136ce1567cb57777d4dec9f86424e
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Jun 4 10:35:34 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Jun 4 11:01:38 2020 +0200
cypress: more paragraph properties test in impress (mobile)
Change-Id: I439ec6a26a3d5aa3324db7add72ea9003025c753
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95486
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/impress/apply_paragraph_props_spec.js b/cypress_test/integration_tests/mobile/impress/apply_paragraph_props_spec.js
index 39171c90d..9547122e5 100644
--- a/cypress_test/integration_tests/mobile/impress/apply_paragraph_props_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/apply_paragraph_props_spec.js
@@ -62,6 +62,23 @@ describe('Apply paragraph properties.', function() {
selectTextShape();
}
+ function selectTextOfShape() {
+ // Double click onto the selected shape
+ cy.get('svg g .leaflet-interactive')
+ .then(function(items) {
+ expect(items).to.have.length(1);
+ var XPos = (items[0].getBoundingClientRect().left + items[0].getBoundingClientRect().right) / 2;
+ var YPos = (items[0].getBoundingClientRect().top + items[0].getBoundingClientRect().bottom) / 2;
+ cy.get('body')
+ .dblclick(XPos, YPos);
+ });
+
+ cy.get('.leaflet-cursor.blinking-cursor')
+ .should('exist');
+
+ helper.selectAllText(false);
+ }
+
function openParagraphPropertiesPanel() {
mobileHelper.openMobileWizard();
@@ -72,7 +89,14 @@ describe('Apply paragraph properties.', function() {
.should('be.visible');
}
- it('Apply left/right alignment.', function() {
+ function openParagraphPropertiesPanel2() {
+ mobileHelper.openMobileWizard();
+
+ cy.get('#Paragraph')
+ .click();
+ }
+
+ it('Apply left/right alignment on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'x', '1400');
@@ -99,7 +123,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'x', '1400');
});
- it('Apply center alignment.', function() {
+ it('Apply center alignment on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'x', '1400');
@@ -114,7 +138,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'x', '12493');
});
- it('Apply justified alignment.', function() {
+ it('Apply justified alignment on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'x', '1400');
@@ -141,7 +165,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'x', '1400');
});
- it('Set top/bottom alignment.', function() {
+ it('Set top/bottom alignment on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'y', '4834');
@@ -168,7 +192,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'y', '4834');
});
- it('Apply center vertical alignment.', function() {
+ it('Apply center vertical alignment on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
.should('have.attr', 'y', '4834');
@@ -183,7 +207,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'y', '7823');
});
- it('Apply default bulleting.', function() {
+ it('Apply default bulleting on text shape.', function() {
// We have no bulleting by default
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChars')
.should('not.exist');
@@ -199,7 +223,7 @@ describe('Apply paragraph properties.', function() {
.should('exist');
});
- it('Apply default numbering.', function() {
+ it('Apply default numbering on text shape.', function() {
// We have no bulleting by default
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextShape tspan')
.should('not.have.attr', 'ooo:numbering-type');
@@ -215,7 +239,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'ooo:numbering-type', 'number-style');
});
- it('Apply spacing above.', function() {
+ it('Apply spacing above on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
.should('have.attr', 'y', '6600');
@@ -234,7 +258,7 @@ describe('Apply paragraph properties.', function() {
.should('have.attr', 'y', '11180');
});
- it('Apply spacing below.', function() {
+ it('Apply spacing below on text shape.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
.should('have.attr', 'y', '6600');
@@ -252,4 +276,316 @@ describe('Apply paragraph properties.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
.should('have.attr', 'y', '11180');
});
+
+ it('Apply left/right alignment on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+
+ selectTextOfShape();
+
+ // Set right alignment first
+ openParagraphPropertiesPanel2();
+
+ cy.get('#RightPara')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '23586');
+
+ // Set left alignment
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#LeftPara')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+ });
+
+ it('Apply center alignment on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#CenterPara')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '12493');
+ });
+
+ it('Apply justified alignment on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+
+ selectTextOfShape();
+
+ // Set right alignment first
+ openParagraphPropertiesPanel2();
+
+ cy.get('#RightPara')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '23586');
+
+ selectTextOfShape();
+
+ // Then set justified alignment
+ openParagraphPropertiesPanel2();
+
+ cy.get('#JustifyPara')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+ });
+
+ it('Set top/bottom alignment on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'y', '4834');
+
+ selectTextOfShape();
+
+ // Set bottom alignment first
+ openParagraphPropertiesPanel2();
+
+ cy.get('#CellVertBottom')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'y', '10811');
+
+ selectTextOfShape();
+
+ // Then set top alignment
+ openParagraphPropertiesPanel2();
+
+ cy.get('#CellVertTop')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'y', '4834');
+ });
+
+ it('Apply center vertical alignment on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'y', '4834');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#CellVertCenter')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'y', '7823');
+ });
+
+ it('Apply default bulleting on selected text.', function() {
+ // We have no bulleting by default
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChars')
+ .should('not.exist');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#DefaultBullet')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChars')
+ .should('exist');
+ });
+
+ it('Apply default numbering on selected text.', function() {
+ // We have no bulleting by default
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextShape tspan')
+ .should('not.have.attr', 'ooo:numbering-type');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#DefaultNumbering')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextShape tspan')
+ .should('have.attr', 'ooo:numbering-type', 'number-style');
+ });
+
+ it('Apply spacing above on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '6600');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#aboveparaspacing input')
+ .clear()
+ .type('2{enter}');
+
+ cy.get('#aboveparaspacing input')
+ .should('have.attr', 'value', '2');
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '11180');
+ });
+
+ it('Apply spacing below on selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '6600');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#belowparaspacing input')
+ .clear()
+ .type('2{enter}');
+
+ cy.get('#belowparaspacing input')
+ .should('have.attr', 'value', '2');
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '11180');
+ });
+
+ it('Increase/decrease spacing of selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '6600');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#ParaspaceIncrease')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '6700');
+
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#ParaspaceDecrease')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph:nth-of-type(2) tspan')
+ .should('have.attr', 'y', '6600');
+ });
+
+ it('Change writing direction of selected text.', function() {
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+
+ // Change right-to-left first
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#ParaRightToLeft')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '23586');
+
+ // Change back to the default left-to-right
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#ParaLeftToRight')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .TextParagraph .TextPosition')
+ .should('have.attr', 'x', '1400');
+ });
+
+ it('Change bulleting level of selected text.', function() {
+ // We have no bulleting by default
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChars')
+ .should('not.exist');
+
+ // Apply bulleting first
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#DefaultBullet')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChars')
+ .should('exist');
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChar:nth-of-type(2) g')
+ .should('have.attr', 'transform', 'translate(1700,4563)');
+
+ // Change bulleting level
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#OutlineRight')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChar:nth-of-type(2) g')
+ .should('have.attr', 'transform', 'translate(2900,4536)');
+
+ // Change bulleting level back to default
+ selectTextOfShape();
+
+ openParagraphPropertiesPanel2();
+
+ cy.get('#OutlineLeft')
+ .click();
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane g.Page .BulletChar:nth-of-type(2) g')
+ .should('have.attr', 'transform', 'translate(1700,4563)');
+ });
});
More information about the Libreoffice-commits
mailing list