diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index be8c3120..d715cd32 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -18,45 +18,12 @@ module.exports = (on, config) => { // `on` is used to hook into various events Cypress emits // `config` is the resolved Cypress config + // we define the process variable in the config so we can access its values + // from the frontend + // see https://github.com/eclipse-theia/theia/issues/9751 config.process = { - chrome: process.chrome, - defaultApp: process.defaultApp, - electron: process.electron, - isMainFrame: process.isMainFrame, - mas: process.mas, - noAsar: process.noAsar, - noDeprecation: process.noDeprecation, - resourcesPath: process.resourcesPath, - sandboxed: process.sandboxed, - throwDeprecation: process.throwDeprecation, - traceDeprecation: process.traceDeprecation, - traceProcessWarnings: process.traceProcessWarnings, - type: process.type, - stdout: process.stdout, - stderr: process.stderr, - stdin: process.stdin, - argv: process.argv, - argv0: process.argv0, - execArgv: process.execArgv, - execPath: process.execPath, - debugPort: process.debugPort, env: process.env, - exitCode: process.exitCode, - version: process.version, - versions: process.versions, - config: process.config, - pid: process.pid, - ppid: process.ppid, - title: process.title, arch: process.arch, - platform: process.platform, - memoryUsage: process.memoryUsage, - release: process.release, - features: process.features, - hrtime: process.hrtime, - connected: process.connected, - report: process.report, - traceDeprecation: process.traceDeprecation, }; return config; } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 4f47715b..543bbb0c 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -27,7 +27,9 @@ Cypress.Commands.add("connect", () => { }) Cypress.Commands.overwrite('visit', (orig, url, options) => { - // this is a fix to include the process variable when using the Electron browser + // this is a fix to include the process variable when using the Electron + // browser. + // see https://github.com/eclipse-theia/theia/issues/9751 return orig(url, Cypress.isBrowser('electron') ? { ...options, onBeforeLoad(win) {