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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 10 20:42:49 UTC 2020


 cypress_test/data/mobile/empty.odp                          |binary
 cypress_test/data/mobile/empty.ods                          |binary
 cypress_test/integration_tests/mobile/calc_focus_spec.js    |   43 +++++++++++
 cypress_test/integration_tests/mobile/impress_focus_spec.js |   45 ++++++++++++
 4 files changed, 88 insertions(+)

New commits:
commit b63c285075a1fb18dd1144865488a444d9482522
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Feb 10 16:28:18 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Feb 10 21:42:27 2020 +0100

    cypress: mobile: Add example focus test for impress and calc.
    
    Change-Id: I658cb7b59a2bb2a6f6a554c18aea7263063bd636
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88382
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/cypress_test/data/mobile/empty.odp b/cypress_test/data/mobile/empty.odp
new file mode 100644
index 000000000..ffefc9e64
Binary files /dev/null and b/cypress_test/data/mobile/empty.odp differ
diff --git a/cypress_test/data/mobile/empty.ods b/cypress_test/data/mobile/empty.ods
new file mode 100644
index 000000000..98c5d3a36
Binary files /dev/null and b/cypress_test/data/mobile/empty.ods differ
diff --git a/cypress_test/integration_tests/mobile/calc_focus_spec.js b/cypress_test/integration_tests/mobile/calc_focus_spec.js
new file mode 100644
index 000000000..17a66a079
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/calc_focus_spec.js
@@ -0,0 +1,43 @@
+/* global describe it cy beforeEach require afterEach*/
+
+var helper = require('../common/helper');
+
+describe('Calc focus tests', function() {
+	beforeEach(function() {
+		helper.beforeAllMobile('empty.ods');
+	});
+
+	afterEach(function() {
+		helper.afterAll();
+	});
+
+	it('Basic document focus.', function() {
+		// Click on edit button
+		cy.get('#mobile-edit-button').click();
+
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.should('not.have.class', 'disabled');
+
+		// Body has the focus -> can't type in the document
+		cy.document().its('activeElement.tagName')
+			.should('be.eq', 'BODY');
+
+		// Double tap on a cell gives the focus to the document
+		cy.get('#document-container')
+			.dblclick(20, 20);
+
+		// Document has the focus
+		cy.document().its('activeElement.className')
+			.should('be.eq', 'clipboard');
+
+		// One tap on an other cell -> no focus on the document
+		cy.get('#document-container')
+			.click(0, 0);
+
+		cy.get('.leaflet-marker-icon.spreadsheet-cell-resize-marker');
+
+		// No focus
+		cy.document().its('activeElement.tagName')
+			.should('be.eq', 'BODY');
+	});
+});
diff --git a/cypress_test/integration_tests/mobile/impress_focus_spec.js b/cypress_test/integration_tests/mobile/impress_focus_spec.js
new file mode 100644
index 000000000..8e2753f3b
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/impress_focus_spec.js
@@ -0,0 +1,45 @@
+/* global describe it cy beforeEach require afterEach*/
+
+var helper = require('../common/helper');
+
+describe('Impress focus tests', function() {
+	beforeEach(function() {
+		helper.beforeAllMobile('empty.odp');
+	});
+
+	afterEach(function() {
+		helper.afterAll();
+	});
+
+	it('Basic document focus.', function() {
+		// Click on edit button
+		cy.get('#mobile-edit-button').click();
+
+		cy.get('#tb_actionbar_item_mobile_wizard')
+			.should('not.have.class', 'disabled');
+
+		// Body has the focus -> can't type in the document
+		cy.document().its('activeElement.tagName')
+			.should('be.eq', 'BODY');
+
+		// One tap on a text shape does not grab the focus to the document
+		cy.get('#document-container')
+			.click();
+
+		// Shape selection
+		cy.get('.leaflet-pane.leaflet-overlay-pane svg g')
+			.should('exist');
+
+		// No focus
+		cy.document().its('activeElement.tagName')
+			.should('be.eq', 'BODY');
+
+		// Double tap on a text shape gives the focus to the document
+		cy.get('#document-container')
+			.dblclick();
+
+		// Document has the focus
+		cy.document().its('activeElement.className')
+			.should('be.eq', 'clipboard');
+	});
+});


More information about the Libreoffice-commits mailing list