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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 26 14:26:08 UTC 2020


 cypress_test/data/mobile/calc/hamburger_menu_search.ods               |binary
 cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js     |   90 +++++++++-
 cypress_test/integration_tests/mobile/writer/table_properties_spec.js |    2 
 3 files changed, 87 insertions(+), 5 deletions(-)

New commits:
commit 5199154db531102ea91efa54668ab0a6fca0b6d5
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Jun 26 14:49:28 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jun 26 16:25:58 2020 +0200

    cypress: tests for search toolbar in calc (mobile).
    
    Change-Id: Ie50efd626fde3f586f657d001e050ed19512dbcb
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97225
    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_search.ods b/cypress_test/data/mobile/calc/hamburger_menu_search.ods
new file mode 100644
index 000000000..08859fea4
Binary files /dev/null and b/cypress_test/data/mobile/calc/hamburger_menu_search.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 3c6c9a69e..5d338631a 100644
--- a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
@@ -1,4 +1,4 @@
-/* global describe it cy beforeEach require afterEach */
+/* global describe it cy require afterEach */
 
 var helper = require('../../common/helper');
 var calcHelper = require('../../common/calc_helper');
@@ -6,20 +6,23 @@ var mobileHelper = require('../../common/mobile_helper');
 var calcMobileHelper = require('./calc_mobile_helper');
 
 describe('Trigger hamburger menu options.', function() {
-	var testFileName = 'hamburger_menu.ods';
+	var testFileName = '';
 
-	beforeEach(function() {
+	function before(testFile) {
+		testFileName = testFile;
 		mobileHelper.beforeAllMobile(testFileName, 'calc');
 
 		// Click on edit button
 		mobileHelper.enableEditingMobile();
-	});
+	}
 
 	afterEach(function() {
 		helper.afterAll(testFileName);
 	});
 
 	it('Save', function() {
+		before('hamburger_menu.ods');
+
 		mobileHelper.openHamburgerMenu();
 
 		cy.contains('.menu-entry-with-icon', 'File')
@@ -34,6 +37,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Print', function() {
+		before('hamburger_menu.ods');
+
 		// A new window should be opened with the PDF.
 		cy.window()
 			.then(function(win) {
@@ -52,6 +57,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Download as PDF', function() {
+		before('hamburger_menu.ods');
+
 		mobileHelper.openHamburgerMenu();
 
 		cy.contains('.menu-entry-with-icon', 'Download as')
@@ -66,6 +73,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Download as ODS', function() {
+		before('hamburger_menu.ods');
+
 		mobileHelper.openHamburgerMenu();
 
 		cy.contains('.menu-entry-with-icon', 'Download as')
@@ -80,6 +89,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Download as XLS', function() {
+		before('hamburger_menu.ods');
+
 		mobileHelper.openHamburgerMenu();
 
 		cy.contains('.menu-entry-with-icon', 'Download as')
@@ -94,6 +105,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Download as XLSX', function() {
+		before('hamburger_menu.ods');
+
 		mobileHelper.openHamburgerMenu();
 
 		cy.contains('.menu-entry-with-icon', 'Download as')
@@ -108,6 +121,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Undo/redo.', function() {
+		before('hamburger_menu.ods');
+
 		// Type a new character
 		calcHelper.clickOnFirstCell(true, true);
 
@@ -155,6 +170,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Repair.', function() {
+		before('hamburger_menu.ods');
+
 		// Type a new character
 		calcHelper.clickOnFirstCell(true, true);
 		cy.get('textarea.clipboard')
@@ -196,6 +213,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Cut.', function() {
+		before('hamburger_menu.ods');
+
 		calcMobileHelper.selectAllMobile();
 
 		mobileHelper.openHamburgerMenu();
@@ -222,6 +241,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Copy.', function() {
+		before('hamburger_menu.ods');
+
 		calcMobileHelper.selectAllMobile();
 
 		mobileHelper.openHamburgerMenu();
@@ -248,6 +269,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Paste.', function() {
+		before('hamburger_menu.ods');
+
 		calcMobileHelper.selectAllMobile();
 
 		mobileHelper.openHamburgerMenu();
@@ -274,6 +297,8 @@ describe('Trigger hamburger menu options.', function() {
 	});
 
 	it('Select all.', function() {
+		before('hamburger_menu.ods');
+
 		cy.get('#copy-paste-container table td')
 			.should('not.contain.text', 'Text');
 
@@ -291,4 +316,61 @@ describe('Trigger hamburger menu options.', function() {
 		cy.get('#copy-paste-container table td')
 			.should('contain.text', 'Text');
 	});
+
+	it.only('Search some word.', function() {
+		before('hamburger_menu_search.ods');
+
+		mobileHelper.openHamburgerMenu();
+
+		cy.contains('.menu-entry-with-icon', 'Search')
+			.click();
+
+		// Search bar become visible
+		cy.get('#toolbar-search')
+			.should('be.visible');
+
+		// Search for some word
+		cy.get('#search-input')
+			.type('a');
+
+		cy.get('.w2ui-tb-image.w2ui-icon.next')
+			.click();
+
+		// First cell should be selected
+		cy.get('input#addressInput')
+			.should('have.prop', 'value', 'A1');
+
+		// Go for the second match
+		cy.get('.w2ui-tb-image.w2ui-icon.next')
+			.click();
+
+		//Second cell should be selected
+		cy.get('input#addressInput')
+			.should('have.prop', 'value', 'B1');
+
+		// Go back to the first match
+		cy.get('.w2ui-tb-image.w2ui-icon.prev')
+			.click();
+
+		// First cell should be selected
+		cy.get('input#addressInput')
+			.should('have.prop', 'value', 'A1');
+
+		// Remove search word
+		cy.get('#search-input')
+			.should('have.prop', 'value', 'a');
+
+		cy.get('#tb_searchbar_item_cancelsearch')
+			.click();
+
+		cy.get('#search-input')
+			.should('have.prop', 'value', '');
+
+		// Close search toolbar
+		cy.get('.w2ui-tb-image.w2ui-icon.unfold')
+			.click();
+
+		cy.get('#toolbar-search')
+			.should('not.be.visible');
+	});
 });
commit ba7c7ce62ad2fdd1b0a49dd9a9bd62ef6ed1a1db
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Jun 26 14:36:36 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jun 26 16:25:48 2020 +0200

    cypress: remove false file name.
    
    Change-Id: Ie469cc7f86e665c1b1a9701810f45193f9143448
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97224
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
index e7e0f4acd..9b87567b3 100644
--- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
@@ -5,7 +5,7 @@ var mobileHelper = require('../../common/mobile_helper');
 var writerMobileHelper = require('./writer_mobile_helper');
 
 describe('Change table properties / layout via mobile wizard.', function() {
-	var testFileName = 'spellchecking.odt';
+	var testFileName = '';
 
 	function before(testFile) {
 		testFileName = testFile;


More information about the Libreoffice-commits mailing list