[Libreoffice-commits] online.git: 3 commits - cypress_test/integration_tests cypress_test/Makefile.am cypress_test/README

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 22 11:56:37 UTC 2020


 cypress_test/Makefile.am                                             |   12 +---
 cypress_test/README                                                  |   30 ++++++++--
 cypress_test/integration_tests/desktop/example_desktop_test_spec.js  |    4 +
 cypress_test/integration_tests/desktop/example_desktop_test_spec2.js |    4 +
 cypress_test/integration_tests/mobile/focus_spec.js                  |    4 +
 cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js    |    4 +
 cypress_test/integration_tests/mobile/toolbar_spec.js                |    4 +
 7 files changed, 45 insertions(+), 17 deletions(-)

New commits:
commit 33245f42ab9c6c86511804a1ccead727404c429e
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jan 22 12:55:00 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 22 12:55:13 2020 +0100

    cypress: Disable SSL for the test loolwsd server.
    
    Change-Id: I613768b3a91e5f34c64495cb5ca13312210f3549

diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 716609746..26fb9a0bd 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -64,9 +64,7 @@ define start_loolwsd
 	@echo
 	../loolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
 			--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
-			--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
-			--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
-			--o:ssl.ca_file_path="$(abs_top_srcdir)/etc/ca-chain.cert.pem" \
+			--disable-ssl \
 			--o:admin_console.username=admin --o:admin_console.password=admin \
 			--o:logging.file[@enable]=true --o:logging.level=trace > /dev/null 2>&1 &
 	@node_modules/wait-on/bin/wait-on http://localhost:9980
commit d87fab2acff3ddbdc506f3015eef31112504f893
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Jan 22 12:28:14 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 22 12:55:13 2020 +0100

    cypress: Don't use hardcoded wsd hash.
    
    Change-Id: Iff7296c6a9def8df9ddb6d78a29e0adf64436b7e

diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index bbca01e7f..716609746 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -35,7 +35,7 @@ run-desktop: @JAILS_PATH@ node_modules
 	@echo "Open cypress with desktop tests..."
 	@echo
 	$(CYPRESS_BINARY) open --config integrationFolder=$(DESKTOP_TEST_FOLDER) \
-			--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR) \
+			--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH) \
 			|| true
 	@pkill loolwsd || true
 
@@ -45,7 +45,7 @@ run-mobile: @JAILS_PATH@ node_modules
 	@echo "Open cypress with mobile tests..."
 	@echo
 	$(CYPRESS_BINARY) open --config integrationFolder=$(MOBILE_TEST_FOLDER),userAgent=$(MOBILE_USER_AGENT) \
-			--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR) \
+			--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH) \
 			|| true
 	@pkill loolwsd || true
 
@@ -80,7 +80,7 @@ define run_desktop_tests
 	$(CYPRESS_BINARY) run --browser chrome \
 			--config integrationFolder=$(DESKTOP_TEST_FOLDER) \
 			--headless \
-			--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR) \
+			--env DATA_FOLDER=$(DESKTOP_DATA_FOLDER),WORKDIR=$(DESKTOP_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH) \
 			$(if $(1), --spec=integration_tests/desktop/$(1)) \
 			|| (pkill loolwsd && false)
 endef
@@ -92,7 +92,7 @@ define run_mobile_tests
 	$(CYPRESS_BINARY) run --browser chrome \
 			--config integrationFolder=$(MOBILE_TEST_FOLDER),userAgent=$(MOBILE_USER_AGENT) \
 			--headless \
-			--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR) \
+			--env DATA_FOLDER=$(MOBILE_DATA_FOLDER),WORKDIR=$(MOBILE_WORKDIR),WSD_VERSION_HASH=$(LOOLWSD_VERSION_HASH) \
 			$(if $(1), --spec=integration_tests/mobile/$(1)) \
 			|| (pkill loolwsd && false)
 endef
diff --git a/cypress_test/integration_tests/desktop/example_desktop_test_spec.js b/cypress_test/integration_tests/desktop/example_desktop_test_spec.js
index e6762e746..2ff6059a4 100644
--- a/cypress_test/integration_tests/desktop/example_desktop_test_spec.js
+++ b/cypress_test/integration_tests/desktop/example_desktop_test_spec.js
@@ -10,7 +10,9 @@ describe('Example test suit 1', function() {
 		});
 
 		// Open test document
-		cy.visit('http://localhost:9980/loleaflet/fc04ba550/loleaflet.html?file_path=file://' +
+		cy.visit('http://localhost:9980/loleaflet/' +
+			Cypress.env('WSD_VERSION_HASH') +
+			'/loleaflet.html?file_path=file://' +
 			Cypress.env('WORKDIR') + 'simple.odt');
 
 		// Wait for the document to fully load
diff --git a/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js b/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js
index 8eb72e561..326bfaf0a 100644
--- a/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js
+++ b/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js
@@ -10,7 +10,9 @@ describe('Example test suit 2', function() {
 		});
 
 		// Open test document
-		cy.visit('http://localhost:9980/loleaflet/fc04ba550/loleaflet.html?file_path=file://' +
+		cy.visit('http://localhost:9980/loleaflet/' +
+			Cypress.env('WSD_VERSION_HASH') +
+			'/loleaflet.html?file_path=file://' +
 			Cypress.env('WORKDIR') + 'simple.odt');
 
 		// Wait for the document to fully load
diff --git a/cypress_test/integration_tests/mobile/focus_spec.js b/cypress_test/integration_tests/mobile/focus_spec.js
index a02d4fa9a..92a1cd352 100644
--- a/cypress_test/integration_tests/mobile/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/focus_spec.js
@@ -11,7 +11,9 @@ describe('Focus tests', function() {
 
 		// Open test document
 		cy.viewport('iphone-3');
-		cy.visit('http://localhost:9980/loleaflet/fc04ba550/loleaflet.html?file_path=file://' +
+		cy.visit('http://localhost:9980/loleaflet/' +
+			Cypress.env('WSD_VERSION_HASH') +
+			'/loleaflet.html?file_path=file://' +
 			Cypress.env('WORKDIR') + 'empty.odt');
 
 		// Wait for the document to fully load
diff --git a/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js b/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js
index bb4073381..90120145c 100644
--- a/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js
+++ b/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js
@@ -11,7 +11,9 @@ describe('Mobile wizard state tests', function() {
 
 		// Open test document
 		cy.viewport('iphone-3');
-		cy.visit('http://localhost:9980/loleaflet/fc04ba550/loleaflet.html?file_path=file://' +
+		cy.visit('http://localhost:9980/loleaflet/' +
+			Cypress.env('WSD_VERSION_HASH') +
+			'/loleaflet.html?file_path=file://' +
 			Cypress.env('WORKDIR') + 'empty.odt');
 
 		// Wait for the document to fully load
diff --git a/cypress_test/integration_tests/mobile/toolbar_spec.js b/cypress_test/integration_tests/mobile/toolbar_spec.js
index d284ee720..b8a9e676b 100644
--- a/cypress_test/integration_tests/mobile/toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/toolbar_spec.js
@@ -11,7 +11,9 @@ describe('Toolbar tests', function() {
 
 		// Open test document
 		cy.viewport('iphone-3');
-		cy.visit('http://localhost:9980/loleaflet/fc04ba550/loleaflet.html?file_path=file://' +
+		cy.visit('http://localhost:9980/loleaflet/' +
+			Cypress.env('WSD_VERSION_HASH') +
+			'/loleaflet.html?file_path=file://' +
 			Cypress.env('WORKDIR') + 'empty.odt');
 
 		// Wait for the document to fully load
commit 2165ffa38cb6f8b35dd2c78587a8e5f9ce5d7ec3
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Jan 21 18:00:23 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 22 12:55:13 2020 +0100

    cypress: README: Add some installation \ test runner info.
    
    Change-Id: I71eccf7e72eb634e83d97f89ea2c55d684009a19

diff --git a/cypress_test/README b/cypress_test/README
index 04fc24e31..62d9f8cb5 100644
--- a/cypress_test/README
+++ b/cypress_test/README
@@ -1,6 +1,16 @@
 Cypress based test framework for LibreOffice Online
 ====================================================
 
+Installation
+------------------
+In most of the cases you need only cypress npm module
+for running cypress tests. This is installed by the build
+system, so running 'make check' will do the basic installation.
+https://docs.cypress.io/guides/getting-started/installing-cypress.html#npm-install
+
+For CI you might need install some additional dependencies:
+https://docs.cypress.io/guides/guides/continuous-integration.html#Dependencies
+
 Running tests
 ------------------
 
@@ -37,17 +47,27 @@ and run the test suit using the spec parameter (see above).
 This 'only' feature affects both make check and make run
 commands.
 
-You can also open cypress tests in the browser, so you can
-check what happens during test run. It's useful for writing
-new tests or checking why an existing test fails.
+Openning interactive test runner
+----------------------------------
+
+Cypress has an interactive test runner application which
+runs the test in the browser. So you can see the result of
+the different steps your test makes in the browser. It's useful
+during writing new tests or checking why an existing
+test fails.
+https://docs.cypress.io/guides/core-concepts/test-runner.html
 
-To open desktop tests in browser:
+To open desktop tests in the test runner:
 
     make run-desktop
 
-To open mobile tests in browser:
+To open mobile tests in the test runner:
 
     make run-mobile
 
 During the build we run the tests with Chrome browser, so make sure
 you select Chrome browser on the GUI while checking tests.
+We are using different configuration and environment variables for
+mobile and desktop tests, that's why there are two separate commands
+for them and there is no option to open all the tests in the
+test runner.


More information about the Libreoffice-commits mailing list