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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 24 08:59:03 UTC 2020


 cypress_test/data/mobile/calc/nextcloud.ods                     |binary
 cypress_test/data/mobile/impress/nextcloud.odp                  |binary
 cypress_test/integration_tests/common/mobile_helper.js          |   15 
 cypress_test/integration_tests/mobile/calc/nextcloud_spec.js    |  170 ++++++++++
 cypress_test/integration_tests/mobile/impress/nextcloud_spec.js |  169 +++++++++
 cypress_test/integration_tests/mobile/writer/nextcloud_spec.js  |    1 
 cypress_test/plugins/blacklists.js                              |    2 
 7 files changed, 354 insertions(+), 3 deletions(-)

New commits:
commit bfc726639577c8b60b671c607aafc18c5b4dd96c
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Sep 24 08:04:52 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Sep 24 10:58:53 2020 +0200

    cypress: check close/edit button state on mobile.
    
    Change-Id: I576f2d8358fd922a10fd4a9e846dd28b49191cb3
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103291
    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 9875b29d9..1396ef6ca 100644
--- a/cypress_test/integration_tests/common/mobile_helper.js
+++ b/cypress_test/integration_tests/common/mobile_helper.js
@@ -9,13 +9,24 @@ function enableEditingMobile() {
 	cy.get('#mobile-edit-button')
 		.then(function(button) {
 			if (button.css('display') !== 'none') {
+
+				cy.get('#tb_actionbar_item_closemobile .editmode')
+					.should('not.exist');
+
+				cy.get('#tb_actionbar_item_closemobile .closemobile')
+					.should('be.visible');
+
 				cy.get('#mobile-edit-button')
 					.click();
 			}
 		});
 
-	cy.get('#tb_actionbar_item_mobile_wizard')
-		.should('not.have.class', 'disabled');
+
+	cy.get('#tb_actionbar_item_closemobile .editmode')
+		.should('be.visible');
+
+	cy.get('#tb_actionbar_item_closemobile .closemobile')
+		.should('not.exist');
 
 	// Wait until all UI update is finished.
 	cy.get('#toolbar-down')
commit 02be3eaa94273eb52b26d2aaf04b56a4437f6b19
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Sep 24 07:57:11 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Sep 24 10:58:44 2020 +0200

    cypress: NC: test nextcloud specific features also in Impress / Calc.
    
    Change-Id: I47c5a318239c2b5c96f1bf8f69298d3369f67d43
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103290
    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/nextcloud.ods b/cypress_test/data/mobile/calc/nextcloud.ods
new file mode 100644
index 000000000..2e2c500fc
Binary files /dev/null and b/cypress_test/data/mobile/calc/nextcloud.ods differ
diff --git a/cypress_test/data/mobile/impress/nextcloud.odp b/cypress_test/data/mobile/impress/nextcloud.odp
new file mode 100644
index 000000000..8907786e3
Binary files /dev/null and b/cypress_test/data/mobile/impress/nextcloud.odp differ
diff --git a/cypress_test/integration_tests/mobile/calc/nextcloud_spec.js b/cypress_test/integration_tests/mobile/calc/nextcloud_spec.js
new file mode 100644
index 000000000..5423ec68c
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/calc/nextcloud_spec.js
@@ -0,0 +1,170 @@
+/* global describe it cy require afterEach Cypress */
+
+var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
+
+describe('Nextcloud specific tests.', function() {
+	var testFileName = 'nextcloud.ods';
+
+	afterEach(function() {
+		helper.afterAll(testFileName);
+	});
+
+	it('Insert image from storage.', function() {
+		helper.loadFileToNextCloud('image_to_insert.png', 'calc');
+
+		helper.beforeAll(testFileName, 'calc', undefined, true);
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openInsertionWizard();
+
+		cy.get('.insertgraphicremote')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('.oc-dialog')
+			.should('be.visible');
+
+		cy.get('tr[data-entryname=\'image_to_insert.png\']')
+			.click();
+
+		cy.get('.oc-dialog-buttonrow .primary')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+
+		// TOD
+		//cy.get('.leaflet-pane.leaflet-overlay-pane svg g.Graphic')
+		//	.should('exist');
+	});
+
+	it('Save as.', function() {
+		helper.beforeAll(testFileName, 'calc');
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'File')
+			.click();
+
+		cy.contains('.menu-entry-with-icon', 'Save As...')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '1');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('.oc-dialog')
+			.should('be.visible');
+
+		cy.get('.oc-dialog input')
+			.clear()
+			.type('1' + testFileName);
+
+		cy.get('.oc-dialog-buttonrow .primary')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+
+		// Close the document
+		cy.get('#mobile-edit-button')
+			.should('be.visible');
+
+		cy.get('#tb_actionbar_item_closemobile')
+			.then(function(item) {
+				cy.wrap(item)
+					.click();
+				Cypress.env('IFRAME_LEVEL', '');
+			});
+
+		cy.get('tr[data-file=\'1' + testFileName + '\']')
+			.should('be.visible');
+
+		cy.get('tr[data-file=\'' + testFileName + '\']')
+			.should('be.visible');
+	});
+
+	it('Share.', function() {
+		helper.beforeAll(testFileName, 'calc');
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'File')
+			.click();
+
+		cy.contains('.menu-entry-with-icon', 'Share...')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('#app-sidebar')
+			.should('be.visible');
+
+		// issue here
+		//cy.get('section#sharing')
+		//	.should('be.visible');
+
+		cy.get('.app-sidebar__close.icon-close')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+	});
+
+	it('Revision history.', function() {
+		helper.beforeAll(testFileName, 'calc');
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'File')
+			.click();
+
+		cy.contains('.menu-entry-with-icon', 'See revision history')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('#app-sidebar')
+			.should('be.visible');
+
+		cy.get('section#tab-versionsTabView')
+			.should('be.visible');
+
+		cy.get('.app-sidebar__close.icon-close')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '1');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('#revViewerContainer .icon-close')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+	});
+});
+
diff --git a/cypress_test/integration_tests/mobile/impress/nextcloud_spec.js b/cypress_test/integration_tests/mobile/impress/nextcloud_spec.js
new file mode 100644
index 000000000..ea2cc9e4b
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/impress/nextcloud_spec.js
@@ -0,0 +1,169 @@
+/* global describe it cy require afterEach Cypress */
+
+var helper = require('../../common/helper');
+var mobileHelper = require('../../common/mobile_helper');
+
+describe('Nextcloud specific tests.', function() {
+	var testFileName = 'nextcloud.odp';
+
+	afterEach(function() {
+		helper.afterAll(testFileName);
+	});
+
+	it('Insert image from storage.', function() {
+		helper.loadFileToNextCloud('image_to_insert.png', 'impress');
+
+		helper.beforeAll(testFileName, 'impress', undefined, true);
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openInsertionWizard();
+
+		cy.get('.insertgraphicremote')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('.oc-dialog')
+			.should('be.visible');
+
+		cy.get('tr[data-entryname=\'image_to_insert.png\']')
+			.click();
+
+		cy.get('.oc-dialog-buttonrow .primary')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('.leaflet-pane.leaflet-overlay-pane svg g')
+			.should('exist');
+	});
+
+	it('Save as.', function() {
+		helper.beforeAll(testFileName, 'impress');
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'File')
+			.click();
+
+		cy.contains('.menu-entry-with-icon', 'Save As...')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '1');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('.oc-dialog')
+			.should('be.visible');
+
+		cy.get('.oc-dialog input')
+			.clear()
+			.type('1' + testFileName);
+
+		cy.get('.oc-dialog-buttonrow .primary')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+
+		// Close the document
+		cy.get('#mobile-edit-button')
+			.should('be.visible');
+
+		cy.get('#tb_actionbar_item_closemobile')
+			.then(function(item) {
+				cy.wrap(item)
+					.click();
+				Cypress.env('IFRAME_LEVEL', '');
+			});
+
+		cy.get('tr[data-file=\'1' + testFileName + '\']')
+			.should('be.visible');
+
+		cy.get('tr[data-file=\'' + testFileName + '\']')
+			.should('be.visible');
+	});
+
+	it('Share.', function() {
+		helper.beforeAll(testFileName, 'impress');
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'File')
+			.click();
+
+		cy.contains('.menu-entry-with-icon', 'Share...')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('#app-sidebar')
+			.should('be.visible');
+
+		// issue here
+		//cy.get('section#sharing')
+		//	.should('be.visible');
+
+		cy.get('.app-sidebar__close.icon-close')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+	});
+
+	it('Revision history.', function() {
+		helper.beforeAll(testFileName, 'impress');
+
+		// Click on edit button
+		mobileHelper.enableEditingMobile();
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'File')
+			.click();
+
+		cy.contains('.menu-entry-with-icon', 'See revision history')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('#app-sidebar')
+			.should('be.visible');
+
+		cy.get('section#tab-versionsTabView')
+			.should('be.visible');
+
+		cy.get('.app-sidebar__close.icon-close')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '1');
+				cy.wrap(item)
+					.click();
+			});
+
+		cy.get('#revViewerContainer .icon-close')
+			.then(function(item) {
+				Cypress.env('IFRAME_LEVEL', '2');
+				cy.wrap(item)
+					.click();
+			});
+	});
+});
+
diff --git a/cypress_test/integration_tests/mobile/writer/nextcloud_spec.js b/cypress_test/integration_tests/mobile/writer/nextcloud_spec.js
index 8df27bd59..717ea1e0d 100644
--- a/cypress_test/integration_tests/mobile/writer/nextcloud_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/nextcloud_spec.js
@@ -158,7 +158,6 @@ describe('Nextcloud specific tests.', function() {
 					.click();
 			});
 
-		// issue here
 		cy.get('#revViewerContainer .icon-close')
 			.then(function(item) {
 				Cypress.env('IFRAME_LEVEL', '2');
diff --git a/cypress_test/plugins/blacklists.js b/cypress_test/plugins/blacklists.js
index 3fc54ba6b..0821feaae 100644
--- a/cypress_test/plugins/blacklists.js
+++ b/cypress_test/plugins/blacklists.js
@@ -165,6 +165,8 @@ var phpProxyBlackList = [
 
 var nextcloudOnlyList = [
 	['mobile/writer/nextcloud_spec.js', []],
+	['mobile/calc/nextcloud_spec.js', []],
+	['mobile/impress/nextcloud_spec.js', []],
 ];
 
 module.exports.coreBlackLists = coreBlackLists;


More information about the Libreoffice-commits mailing list