summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2023-06-22 08:27:29 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2023-06-29 13:43:13 +0200
commitef02d909a2e7ef8a40f3ebfc0372b7e5a02f25cb (patch)
treedad790b93d50a1b96531f2027e91520cf498ac84
parentScripts: Add parser used in forum for monthly leaderboard (diff)
downloadonline-ef02d909a2e7ef8a40f3ebfc0372b7e5a02f25cb.tar.gz
online-ef02d909a2e7ef8a40f3ebfc0372b7e5a02f25cb.zip
a cypress env var for enable/disable a11y on testing + a a11y tags
Now you can use CYPRESS_A11Y for enable/disable accessibility state on testing. Moreover you can use the taga11yenabled tag for tests that should be run only when accessibility is enabled, and the taga11ydisabled tag for test that should be run only when accessibility is disabled Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com> Change-Id: I4c44e78e5394477b64cc17ac6b815d9d70b059f5
-rw-r--r--cypress_test/Makefile.am17
-rw-r--r--cypress_test/README6
-rw-r--r--cypress_test/integration_tests/desktop/writer/editable_area_spec.js16
3 files changed, 29 insertions, 10 deletions
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 474f340102..8a23c5b2f8 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -59,6 +59,8 @@ SPACE :=$(EMPTY) $(EMPTY)
CORE_VERSION := $(subst $(SPACE),_,$(shell "@LO_PATH@"/program/soffice.bin --version 2> /dev/null))
BROWSER:=$(if $(CYPRESS_BROWSER),$(CYPRESS_BROWSER),$(CHROME))
+A11Y_ENABLE:=$(if $(CYPRESS_A11Y),$(CYPRESS_A11Y),true)
+A11Y_TAG:=$(if $(findstring true,$(A11Y_ENABLE)),taga11yenabled,taga11ydisabled)
if ENABLE_DEBUG
FILTER_DEBUG=cypress:electron,cypress:launcher
@@ -154,7 +156,7 @@ define start_coolwsd
--o:logging.file[@enable]=true --o:logging.level=trace \
--o:welcome.enable=false \
--o:user_interface.mode=$(USER_INTERFACE) \
- --o:accessibility.enable=true \
+ --o:accessibility.enable=$(A11Y_ENABLE) \
--o:security.enable_macros_execution=true \
--port=$(FREE_PORT) \
--pidfile=$(PID_FILE) \
@@ -286,7 +288,10 @@ DESKTOP_CONFIG = \
specPattern=$(DESKTOP_TEST_FOLDER)/**/*_spec.js,supportFile=$(SUPPORT_FILE),userAgent=$(DESKTOP_USER_AGENT)
DESKTOP_ENV = \
- CYPRESS_INCLUDE_TAGS=tagdesktop,DATA_FOLDER=$(DESKTOP_DATA_FOLDER),DATA_WORKDIR=$(DESKTOP_DATA_WORKDIR),WSD_VERSION_HASH=$(COOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION),SCREENSHOT_FOLDER=$(abs_srcdir)/cypress/screenshots,IMAGES_FOLDER=$(abs_top_srcdir)/browser/images/help/en/
+ DATA_FOLDER=$(DESKTOP_DATA_FOLDER),DATA_WORKDIR=$(DESKTOP_DATA_WORKDIR),WSD_VERSION_HASH=$(COOLWSD_VERSION_HASH),SERVER_PORT=$(FREE_PORT),LO_CORE_VERSION="$(CORE_VERSION)",INTEGRATION=$(CYPRESS_INTEGRATION),SCREENSHOT_FOLDER=$(abs_srcdir)/cypress/screenshots,IMAGES_FOLDER=$(abs_top_srcdir)/browser/images/help/en/
+
+DESKTOP_INCLUDE_TAGS = \
+ tagdesktop,$(A11Y_TAG)
# Run one desktop test / all desktop tests in interactive test runner.
# Parameters:
@@ -294,6 +299,10 @@ DESKTOP_ENV = \
define run_interactive_desktop
@echo "Open cypress with desktop tests..."
@echo
+ $(eval CYPRESS_INCLUDE_TAGS=$(DESKTOP_INCLUDE_TAGS))
+ @echo Cypress tags: $(CYPRESS_INCLUDE_TAGS)
+ @echo
+ $(eval export CYPRESS_INCLUDE_TAGS)
$(if $(1),\
$(eval SPEC_FILE=$(DESKTOP_TEST_FOLDER)/$(1))\
$(call check_spec_existence,$(1),desktop)\
@@ -311,6 +320,10 @@ endef
define run_desktop_tests
@echo $(if $(1),"Running cypress desktop mode test: $(1)","Running cypress desktop mode tests...")
@echo
+ $(eval CYPRESS_INCLUDE_TAGS=$(DESKTOP_INCLUDE_TAGS))
+ @echo Cypress tags: $(CYPRESS_INCLUDE_TAGS)
+ @echo
+ $(eval export CYPRESS_INCLUDE_TAGS)
$(eval ENV_EXTENDED=$(DESKTOP_ENV)$(if $(3),$(COMMA)$(3)))
$(if $(and $(PARALLEL_BUILD), $(1)),\
@$(call run_test_parallel,\
diff --git a/cypress_test/README b/cypress_test/README
index a80ad2285a..f785f5486f 100644
--- a/cypress_test/README
+++ b/cypress_test/README
@@ -235,6 +235,12 @@ failure only in headless mode and we need to debug the client-side JS code.
ENABLE_CONSOLE_LOG="1" make check-mobile spec=writer/apply_font_spec.js
+3. CYPRESS_A11Y (true|false, default: true)
+You can enable/disable accessibility support during running a test suite.
+Moreover in describe you can use the taga11yenabled tag for tests that should
+be run only when accessibility is enabled, and the taga11ydisabled tag
+for tests that should be run only when accessibility is disabled.
+
Known issues
------------
diff --git a/cypress_test/integration_tests/desktop/writer/editable_area_spec.js b/cypress_test/integration_tests/desktop/writer/editable_area_spec.js
index 1c5734953f..d6c37912e8 100644
--- a/cypress_test/integration_tests/desktop/writer/editable_area_spec.js
+++ b/cypress_test/integration_tests/desktop/writer/editable_area_spec.js
@@ -4,7 +4,7 @@ var helper = require('../../common/helper');
var ceHelper = require('../../common/contenteditable_helper');
// var repairHelper = require('../../common/repair_document_helper');
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Empty paragraph', function() {
+describe(['taga11yenabled'], 'Editable area - Empty paragraph', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function () {
@@ -51,7 +51,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Empty para
});
});
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Basic typing and caret moving', function() {
+describe(['taga11yenabled'], 'Editable area - Basic typing and caret moving', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function () {
@@ -351,7 +351,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Basic typi
});
});
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Inner selection', function() {
+describe(['taga11yenabled'], 'Editable area - Inner selection', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function () {
@@ -495,7 +495,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Inner sele
});
});
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Multi-paragraph selection', function() {
+describe(['taga11yenabled'], 'Editable area - Multi-paragraph selection', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function () {
@@ -650,7 +650,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Multi-para
});
});
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Empty selection', function() {
+describe(['taga11yenabled'], 'Editable area - Empty selection', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function () {
@@ -736,7 +736,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Empty sele
});
});
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Undo/Redo', function() {
+describe(['taga11yenabled'], 'Editable area - Undo/Redo', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function () {
@@ -816,7 +816,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Undo/Redo'
});
});
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - More typing', function() {
+describe(['taga11yenabled'], 'Editable area - More typing', function() {
var testFileName = 'undo_redo.odt';
beforeEach(function() {
@@ -908,7 +908,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - More typin
// ◦ Item 1.2
// • Item 2
// • Item 3
-describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editable area - Unordered lists', function() {
+describe(['taga11yenabled'], 'Editable area - Unordered lists', function() {
var testFileName = 'unordered_list.odt';
beforeEach(function () {