[Libreoffice-commits] online.git: cypress_test/data cypress_test/integration_tests
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 5 14:53:58 UTC 2020
cypress_test/data/mobile/calc/hamburger_menu_sheet.ods |binary
cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js | 264 ++++++++++
2 files changed, 264 insertions(+)
New commits:
commit 05e77fd0da0338882d6f805843ccb56b4379a22e
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sun Jul 5 15:50:25 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sun Jul 5 16:53:38 2020 +0200
cypress: add tests for sheet operations (calc, mobile)
Change-Id: I01b4806eac3ee713b8d3754e075df55d917e07ce
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98142
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/data/mobile/calc/hamburger_menu_sheet.ods b/cypress_test/data/mobile/calc/hamburger_menu_sheet.ods
new file mode 100644
index 000000000..6883a88d9
Binary files /dev/null and b/cypress_test/data/mobile/calc/hamburger_menu_sheet.ods differ
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 154f651d3..2f25a8072 100644
--- a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
@@ -374,6 +374,270 @@ describe('Trigger hamburger menu options.', function() {
.should('not.be.visible');
});
+ it('Sheet: insert row before.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Insert Rows')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Rows Above')
+ .click();
+
+ calcMobileHelper.selectAllMobile(false);
+
+ cy.get('#copy-paste-container table tr')
+ .should('have.length', 3);
+
+ cy.get('#copy-paste-container table tr td:nth-of-type(1)')
+ .should(function(cells) {
+ expect(cells).to.have.lengthOf(3);
+ expect(cells[0]).to.have.text('');
+ expect(cells[1]).to.have.text('1');
+ expect(cells[2]).to.have.text('3');
+ });
+ });
+
+ it('Sheet: insert row after.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Insert Rows')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Rows Below')
+ .click();
+
+ calcMobileHelper.selectAllMobile(false);
+
+ cy.get('#copy-paste-container table tr')
+ .should('have.length', 3);
+
+ cy.get('#copy-paste-container table tr td:nth-of-type(1)')
+ .should(function(cells) {
+ expect(cells).to.have.lengthOf(3);
+ expect(cells[0]).to.have.text('1');
+ expect(cells[1]).to.have.text('');
+ expect(cells[2]).to.have.text('3');
+ });
+ });
+
+ it('Sheet: insert column before.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Insert Columns')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Columns Before')
+ .click();
+
+ calcMobileHelper.selectAllMobile(false);
+
+ cy.get('#copy-paste-container table tr')
+ .should('have.length', 2);
+
+ cy.get('#copy-paste-container table tr:nth-of-type(1) td')
+ .should(function(cells) {
+ expect(cells).to.have.lengthOf(3);
+ expect(cells[0]).to.have.text('');
+ expect(cells[1]).to.have.text('1');
+ expect(cells[2]).to.have.text('2');
+ });
+ });
+
+ it('Sheet: insert column after.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Insert Columns')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Columns After')
+ .click();
+
+ calcMobileHelper.selectAllMobile(false);
+
+ cy.get('#copy-paste-container table tr')
+ .should('have.length', 2);
+
+ cy.get('#copy-paste-container table tr:nth-of-type(1) td')
+ .should(function(cells) {
+ expect(cells).to.have.lengthOf(3);
+ expect(cells[0]).to.have.text('1');
+ expect(cells[1]).to.have.text('');
+ expect(cells[2]).to.have.text('2');
+ });
+ });
+
+ it('Sheet: delete rows.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Delete Rows')
+ .click();
+
+ calcMobileHelper.selectAllMobile(false);
+
+ cy.get('#copy-paste-container table tr')
+ .should('have.length', 1);
+
+ cy.get('#copy-paste-container table tr:nth-of-type(1) td')
+ .should(function(cells) {
+ expect(cells).to.have.lengthOf(2);
+ expect(cells[0]).to.have.text('3');
+ });
+ });
+
+ it('Sheet: delete columns.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ calcHelper.clickOnFirstCell();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Delete Columns')
+ .click();
+
+ calcMobileHelper.selectAllMobile(false);
+
+ cy.get('#copy-paste-container table tr')
+ .should('have.length', 2);
+
+ cy.get('#copy-paste-container table tr:nth-of-type(1) td')
+ .should(function(cells) {
+ expect(cells).to.have.lengthOf(1);
+ expect(cells[0]).to.have.text('2');
+ });
+ });
+
+ it('Sheet: insert / delete row break.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ // Select B2 cell
+ calcHelper.clickOnFirstCell();
+
+ cy.get('.spreadsheet-cell-resize-marker[style=\'transform: translate3d(76px, 11px, 0px); z-index: 11;\']')
+ .then(function(marker) {
+ expect(marker).to.have.lengthOf(1);
+ var XPos = marker[0].getBoundingClientRect().right + 2;
+ var YPos = marker[0].getBoundingClientRect().bottom + 2;
+ cy.get('body')
+ .click(XPos, YPos);
+
+ cy.get('input#addressInput')
+ .should('have.prop', 'value', 'B2');
+ });
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Insert Page Break')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Row Break')
+ .click();
+
+ // TODO: no visual indicator here
+ cy.wait(500);
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Delete Page Break')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Remove Row Break')
+ .click();
+
+ // TODO: no visual indicator here
+ cy.wait(500);
+ });
+
+ it('Sheet: insert / delete column break.', function() {
+ before('hamburger_menu_sheet.ods');
+
+ // Select B2 cell
+ calcHelper.clickOnFirstCell();
+
+ cy.get('.spreadsheet-cell-resize-marker[style=\'transform: translate3d(76px, 11px, 0px); z-index: 11;\']')
+ .then(function(marker) {
+ expect(marker).to.have.lengthOf(1);
+ var XPos = marker[0].getBoundingClientRect().right + 2;
+ var YPos = marker[0].getBoundingClientRect().bottom + 2;
+ cy.get('body')
+ .click(XPos, YPos);
+
+ cy.get('input#addressInput')
+ .should('have.prop', 'value', 'B2');
+ });
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Insert Page Break')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Column Break')
+ .click();
+
+ // TODO: no visual indicator here
+ cy.wait(500);
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Sheet')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Delete Page Break')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Remove Column Break')
+ .click();
+
+ // TODO: no visual indicator here
+ cy.wait(500);
+ });
+
it('Data: sort ascending.', function() {
before('hamburger_menu_sort.ods');
More information about the Libreoffice-commits
mailing list