[Libreoffice-commits] online.git: cypress_test/Makefile.am cypress_test/plugins

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Thu May 21 17:54:01 UTC 2020


 cypress_test/Makefile.am      |    5 +++++
 cypress_test/plugins/index.js |    9 +++++++++
 2 files changed, 14 insertions(+)

New commits:
commit 6e230e4ba6efcb76897d3e4fb1764ad987a37946
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Mon May 18 16:23:50 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu May 21 19:53:43 2020 +0200

    cypress: enable logging browser side
    
    This time the logs come from the browser
    
    Change-Id: If9b66a140b0174d0e3ef1e1e492ceeb49953d563
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94468
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 7a19987be..6f9bcdb09 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -31,6 +31,11 @@ DISPLAY_NUMBER = 100
 HEADLESS_BUILD := $(findstring Command failed,$(shell xhost > /dev/null 2>&1 || echo "Command failed, so we are in a headless environment."))
 export DISPLAY=$(if $(HEADLESS_BUILD),:$(DISPLAY_NUMBER),$(shell echo $$DISPLAY))
 
+if ENABLE_DEBUG
+FILTER_DEBUG=cypress:electron,cypress:launcher
+export DEBUG=$(if $(ENABLE_LOGGING),$(FILTER_DEBUG),)
+endif
+
 # We use a hard coded hash here, because of this issue:
 # https://github.com/cypress-io/cypress/issues/6891
 WSD_VERSION_HASH := "11111111"
diff --git a/cypress_test/plugins/index.js b/cypress_test/plugins/index.js
index 2d07606eb..859088da4 100644
--- a/cypress_test/plugins/index.js
+++ b/cypress_test/plugins/index.js
@@ -1,5 +1,6 @@
 /* global require */
 
+var process = require('process');
 var tasks = require('./tasks');
 
 function plugin(on, config) {
@@ -8,6 +9,14 @@ function plugin(on, config) {
 		failed: require('cypress-failed-log/src/failed')()
 	});
 
+	on('before:browser:launch', function(browser, launchOptions) {
+		if (browser.family === 'chromium' && process.env.ENABLE_LOGGING) {
+			launchOptions.args.push('--enable-logging=stderr');
+			launchOptions.args.push('--v=2');
+			return launchOptions;
+		}
+	});
+
 	return config;
 }
 


More information about the Libreoffice-commits mailing list