From 7b832392d1cc6ba04e4c65acd0cf203c0988b8b6 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 28 Mar 2025 13:50:12 -0700 Subject: [PATCH] feat: add switch to test in RTL mode --- test/webdriverio/index.ts | 7 ++++++- test/webdriverio/test/test_setup.mjs | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/test/webdriverio/index.ts b/test/webdriverio/index.ts index d9999790..a01d450b 100644 --- a/test/webdriverio/index.ts +++ b/test/webdriverio/index.ts @@ -52,11 +52,15 @@ function getOptions() { const toolboxObject = toolbox === 'flyout' ? toolboxFlyout : toolboxCategories; + const rtlParam = params.get('rtl'); + const rtl = !!rtlParam; + return { scenario, stackConnections, renderer, toolbox: toolboxObject, + rtl, }; } @@ -67,11 +71,12 @@ function getOptions() { * @returns The created workspace. */ function createWorkspace(): Blockly.WorkspaceSvg { - const {scenario, stackConnections, renderer, toolbox} = getOptions(); + const {scenario, stackConnections, renderer, toolbox, rtl} = getOptions(); const injectOptions = { toolbox, renderer, + rtl, }; const blocklyDiv = document.getElementById('blocklyDiv'); if (!blocklyDiv) { diff --git a/test/webdriverio/test/test_setup.mjs b/test/webdriverio/test/test_setup.mjs index b4c59f40..86eead28 100644 --- a/test/webdriverio/test/test_setup.mjs +++ b/test/webdriverio/test/test_setup.mjs @@ -121,8 +121,14 @@ function posixPath(target) { export const testFileLocations = { BASE: 'file://' + posixPath(path.join(__dirname, '..', 'build')) + '/index.html', + BASE_RTL: + 'file://' + posixPath(path.join(__dirname, '..', 'build')) + '/index.html?rtl=true', GERAS: 'file://' + posixPath(path.join(__dirname, '..', 'build')) + '/index.html?renderer=geras', + GERAS_RTL: + 'file://' + + posixPath(path.join(__dirname, '..', 'build')) + + '/index.html?renderer=geras&rtl=true', };