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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 11 16:28:18 UTC 2020


 cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js |    8 +
 cypress_test/integration_tests/mobile/calc/number_format_spec.js    |   60 +++++++---
 cypress_test/integration_tests/mobile/writer/insert_field_spec.js   |   16 ++
 cypress_test/plugins/blacklists.js                                  |   28 ++++
 cypress_test/plugins/index.js                                       |   28 +++-
 5 files changed, 108 insertions(+), 32 deletions(-)

New commits:
commit 142231151a426c35adae5ae837f587e4cebad414
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Sep 10 18:26:00 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Sep 11 18:28:12 2020 +0200

    cypress: NC: blacklist some tests.
    
    In NC environment we don't handle cy.document() and
    cy.window() well. Disable related tests for now.
    
    Change-Id: Ibb9a9783bf1718a030d10fc69f8b7653fb12bc15
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102471
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/cypress_test/plugins/blacklists.js b/cypress_test/plugins/blacklists.js
index f76c76b46..b389f6260 100644
--- a/cypress_test/plugins/blacklists.js
+++ b/cypress_test/plugins/blacklists.js
@@ -1,4 +1,4 @@
-var testBlackLists = {
+var coreBlackLists = {
 	'master': [
 		['mobile/writer/table_properties_spec.js',
 			[]
@@ -56,4 +56,28 @@ var testBlackLists = {
 	]
 };
 
-module.exports.testBlackLists = testBlackLists;
+var nextcloudBlackList = [
+	['mobile/writer/focus_spec.js', []],
+	['mobile/calc/focus_spec.js', []],
+	['mobile/impress/impress_focus_spec.js', []],
+	['desktop/writer/focus_spec.js', []],
+	['desktop/calc/focus_spec.js', []],
+	['mobile/calc/hamburger_menu_spec.js',
+		[
+			'Print'
+		]
+	],
+	['mobile/writer/hamburger_menu_spec.js',
+		[
+			'Print'
+		]
+	],
+	['mobile/impress/hamburger_menu_spec.js',
+		[
+			'Print'
+		]
+	],
+];
+
+module.exports.coreBlackLists = coreBlackLists;
+module.exports.nextcloudBlackList = nextcloudBlackList;
diff --git a/cypress_test/plugins/index.js b/cypress_test/plugins/index.js
index 1da431a2d..ae7640370 100644
--- a/cypress_test/plugins/index.js
+++ b/cypress_test/plugins/index.js
@@ -54,22 +54,32 @@ function getLOVersion(config) {
 	return 'master';
 }
 
-function pickTests(filename, foundTests, config) {
-
-	var coreVersion = getLOVersion(config);
-	var testsToRun = foundTests;
-	if (!(coreVersion in blacklists.testBlackLists))
-		return testsToRun;
-
-	var blackList = blacklists.testBlackLists[coreVersion];
+function removeBlacklistedTest(filename, testsToRun, blackList) {
 	for (var i = 0; i < blackList.length; i++) {
 		if (filename.endsWith(blackList[i][0])) {
 			if (blackList[i][1].length === 0) // skip the whole test suite
 				return [];
-			testsToRun = testsToRun.filter(fullTestName => !blackList[i][1].includes(fullTestName[1]));
+			return testsToRun.filter(fullTestName => !blackList[i][1].includes(fullTestName[1]));
 		}
 	}
 	return testsToRun;
 }
 
+function pickTests(filename, foundTests, config) {
+	var coreVersion = getLOVersion(config);
+	var testsToRun = foundTests;
+	if (!(coreVersion in blacklists.coreBlackLists))
+		return testsToRun;
+
+	var coreblackList = blacklists.coreBlackLists[coreVersion];
+	testsToRun = removeBlacklistedTest(filename, testsToRun, coreblackList);
+
+	if (process.env.CYPRESS_INTEGRATION === 'nextcloud') {
+		var NCblackList = blacklists.nextcloudBlackList;
+		testsToRun = removeBlacklistedTest(filename, testsToRun, NCblackList);
+	}
+
+	return testsToRun;
+}
+
 module.exports = plugin;
commit 45ac93575b3b965c07fa761aed32dccd5fd7d9a4
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Sep 10 18:09:11 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Sep 11 18:28:00 2020 +0200

    cypress: NC: don't test local related part of formatting.
    
    '1033' means en-US here, but we don't need to test this,
    so it won't be a problem to have a different local settings
    inside NC.
    
    Change-Id: Ifcd3798b7356b7d80a994f9d00280a6039cea5a5
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102470
    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/mobile/calc/insertion_wizard_spec.js b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
index 55c8d7afe..a323e7fa4 100644
--- a/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
@@ -119,8 +119,10 @@ describe('Calc insertion wizard.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';MM/DD/YY$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;MM/DD/YY');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 	});
 
 	it('Insert time.', function() {
@@ -130,7 +132,9 @@ describe('Calc insertion wizard.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';HH:MM:SS AM/PM$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;HH:MM:SS AM/PM');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 	});
 });
diff --git a/cypress_test/integration_tests/mobile/calc/number_format_spec.js b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
index ef965daee..99fb169ff 100644
--- a/cypress_test/integration_tests/mobile/calc/number_format_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
@@ -57,8 +57,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';0;0.00%$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;0.00%');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '100000.00%');
@@ -82,8 +84,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';0;0.00%$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;0.00%');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '100000.00%');
@@ -104,8 +108,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';\\[\\$\\$-409]#,##0.00;\\[RED]-\\[\\$\\$-409]#,##0.00$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '$1,000.00');
@@ -129,8 +135,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';\\[\\$\\$-409]#,##0.00;\\[RED]-\\[\\$\\$-409]#,##0.00$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '$1,000.00');
@@ -152,8 +160,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';\\[\\$\\$-409]#,##0.00;\\[RED]-\\[\\$\\$-409]#,##0.00$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '$1,000.00');
@@ -200,8 +210,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';MM/DD/YY$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;MM/DD/YY');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'sdval', '1000');
@@ -222,8 +234,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';HH:MM:SS AM/PM$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;HH:MM:SS AM/PM');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.attr', 'sdval', '1000');
@@ -244,8 +258,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';0\\.00E\\+00$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;0.00E+00');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1.00E+03');
@@ -263,8 +279,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';# \\?/\\?$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;# ?/?');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1000    ');
@@ -282,8 +300,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';BOOLEAN$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;BOOLEAN');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', 'TRUE');
@@ -301,8 +321,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';@$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;@');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1000');
@@ -323,8 +345,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';0\\.00$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;0.00');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1000.00');
@@ -345,8 +369,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';000000$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;000000');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '001000');
@@ -365,8 +391,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';0;\\[RED]-0$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;0;[RED]-0');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1000');
@@ -385,8 +413,10 @@ describe('Apply number formatting.', function() {
 
 		calcMobileHelper.selectAllMobile();
 
+		var regex = new RegExp(';#,##0$');
 		cy.get('#copy-paste-container table td')
-			.should('have.attr', 'sdnum', '1033;0;#,##0');
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 
 		cy.get('#copy-paste-container table td')
 			.should('have.text', '1,000');
diff --git a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
index 8a8847451..95da2ff56 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
@@ -59,8 +59,12 @@ describe('Insert fields via insertion wizard.', function() {
 		writerMobileHelper.selectAllMobile();
 
 		cy.get('#copy-paste-container p span sdfield')
-			.should('have.attr', 'type', 'DATETIME')
-			.should('have.attr', 'sdnum', '1033;1033;MM/DD/YY');
+			.should('have.attr', 'type', 'DATETIME');
+
+		var regex = new RegExp(';MM/DD/YY$');
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 	});
 
 	it('Insert time field.', function() {
@@ -71,8 +75,12 @@ describe('Insert fields via insertion wizard.', function() {
 		writerMobileHelper.selectAllMobile();
 
 		cy.get('#copy-paste-container p span sdfield')
-			.should('have.attr', 'type', 'DATETIME')
-			.should('have.attr', 'sdnum', '1033;1033;HH:MM:SS AM/PM');
+			.should('have.attr', 'type', 'DATETIME');
+
+		var regex = new RegExp(';HH:MM:SS AM/PM$');
+		cy.get('#copy-paste-container p span sdfield')
+			.should('have.attr', 'sdnum')
+			.should('match', regex);
 	});
 
 	it('Insert title field.', function() {


More information about the Libreoffice-commits mailing list