[Libreoffice-commits] online.git: cypress_test/data cypress_test/integration_tests cypress_test/Makefile.am
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 8 12:30:32 UTC 2020
cypress_test/Makefile.am | 1
cypress_test/data/mobile/calc/alignment_options.ods |binary
cypress_test/integration_tests/mobile/calc/alignment_options_spec.js | 145 ++++++++++
3 files changed, 146 insertions(+)
New commits:
commit 56c6f5cc48981962f9c1fe0a574c5c88485318b9
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Apr 8 13:26:00 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Apr 8 14:30:13 2020 +0200
cypress: mobile: add some tests for alignment properties in Calc.
Change-Id: I6a0209a484041a3df44e5472a4b0679193dd38c1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91912
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 6925f2721..8e137be2c 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -35,6 +35,7 @@ WSD_VERSION_HASH := "11111111"
if HAVE_LO_PATH
MOBILE_TEST_FILES= \
+ calc/alignment_options_spec.js \
calc/apply_font_spec.js \
calc/focus_spec.js \
calc/insertion_wizard_spec.js \
diff --git a/cypress_test/data/mobile/calc/alignment_options.ods b/cypress_test/data/mobile/calc/alignment_options.ods
new file mode 100644
index 000000000..ade730114
Binary files /dev/null and b/cypress_test/data/mobile/calc/alignment_options.ods differ
diff --git a/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
new file mode 100644
index 000000000..f89e7843c
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
@@ -0,0 +1,145 @@
+/* global describe it cy beforeEach require afterEach*/
+
+var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
+var calcHelper = require('./calc_helper');
+
+describe('Change alignment settings.', function() {
+ beforeEach(function() {
+ mobileHelper.beforeAllMobile('alignment_options.ods', 'calc');
+
+ // Click on edit button
+ mobileHelper.enableEditingMobile();
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openMobileWizard();
+
+ cy.get('#ScAlignmentPropertyPanel')
+ .click();
+
+ cy.get('#AlignLeft')
+ .should('be.visible');
+ });
+
+ afterEach(function() {
+ helper.afterAll('alignment_options.ods');
+ });
+
+ it('Apply left/right alignment', function() {
+ // Set right aligment first
+ cy.get('#AlignRight')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'align', 'right');
+
+ // Change alignment back
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openMobileWizard();
+
+ cy.get('#ScAlignmentPropertyPanel')
+ .click();
+
+ cy.get('#AlignLeft')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'align', 'left');
+ });
+
+ it('Align to center horizontally.', function() {
+ // Set right aligment first
+ cy.get('#AlignHorizontalCenter')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'align', 'center');
+ });
+
+ it('Change to block alignment.', function() {
+ // Set right aligment first
+ cy.get('#AlignBlock')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'align', 'justify');
+ });
+
+ it('Right-to-left and left-to-right writing mode.', function() {
+ // Set right aligment first
+ cy.get('#ParaRightToLeft')
+ .click();
+
+ // TODO: we don't have a way of testing this
+ // copy container doesn't have info about this
+ cy.wait(500);
+
+ // Set right aligment first
+ cy.get('#ParaLeftToRight')
+ .click();
+
+ cy.wait(500);
+ });
+
+ it('Align to the top and to bottom.', function() {
+ // Set right aligment first
+ cy.get('#AlignTop')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'valign', 'top');
+
+ // Change alignment back
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openMobileWizard();
+
+ cy.get('#ScAlignmentPropertyPanel')
+ .click();
+
+ cy.get('#AlignBottom')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'valign', 'bottom');
+ });
+
+ it('Align to center vertically.', function() {
+ // Set right aligment first
+ cy.get('#AlignVCenter')
+ .click();
+
+ mobileHelper.closeMobileWizard();
+
+ calcHelper.copyContentToClipboard();
+
+ cy.get('#copy-paste-container table td')
+ .should('have.attr', 'valign', 'middle');
+ });
+});
More information about the Libreoffice-commits
mailing list