Skip to content

Commit

Permalink
a11y: keep a11y disabled on executing cypress Calc tests
Browse files Browse the repository at this point in the history
This patch is a temporary workaround for fixing CI failures.
In fact on CI with a11y enabled cypress fails to load spreadsheets.

Signed-off-by: Marco Cecchetti <[email protected]>
Change-Id: Ic661358cd47600ec9c3a329bef361b8087483017
  • Loading branch information
mcecchetti authored and caolanm committed Oct 29, 2023
1 parent 08f60bc commit 09c18a4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions browser/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,18 @@ window.app = {
var now2 = Date.now();
global.socket.send('coolclient ' + ProtocolVersionNumber + ' ' + ((now0 + now2) / 2) + ' ' + now1);

var isCalcTest =
global.docURL.includes('data/desktop/calc/') ||
global.docURL.includes('data/mobile/calc/') ||
global.docURL.includes('data/multiuser/calc/');

if (L.Browser.cypressTest && isCalcTest)
window.enableAccessibility = false;

var accessibilityState = window.localStorage.getItem('accessibilityState') === 'true';
accessibilityState = accessibilityState || (L.Browser.cypressTest && !isCalcTest);
msg += ' accessibilityState=' + accessibilityState;

if (window.ThisIsAMobileApp) {
msg += ' lang=' + window.LANG;
} else {
Expand All @@ -994,9 +1006,6 @@ window.app = {
msg += ' spellOnline=' + spellOnline;
}

var accessibilityState = window.localStorage.getItem('accessibilityState') === 'true';
accessibilityState = accessibilityState || L.Browser.cypressTest;
msg += ' accessibilityState=' + accessibilityState;
}

msg += ' timezone=' + Intl.DateTimeFormat().resolvedOptions().timeZone;
Expand Down

0 comments on commit 09c18a4

Please sign in to comment.