Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for own Electron version / instance #29738

Open
ChrisKuBa opened this issue Jun 25, 2024 Discussed in #29730 · 0 comments
Open

Support for own Electron version / instance #29738

ChrisKuBa opened this issue Jun 25, 2024 Discussed in #29730 · 0 comments
Labels
pkg/electron This is due to an issue in the packages/electron directory type: feature New feature that does not currently exist

Comments

@ChrisKuBa
Copy link

What would you like?

Support other electron installation / versions than that bundled with cypress

Why is this needed?

control preferred runtime / version
support new features
be independed of breaking changes and electron support cycle within cypress

Other

it does not work, when another local electron version was confgured as additional browser. the electron prcess exit with an error code

Discussion

How can I configure Cypress to use my own electron version / installation?
Because the version of electron bundled with cypress is outdated and also we ship our own fixed version of electron, its necessary to test against a specific electron version.

I try to inject a new browser config, but cypress will not connect. The path to the electron.exe is valid in my configuration, but no process will start / the process exit with 4294967295.

import { defineConfig } from 'cypress';

import Browser = Cypress.Browser;

const addLocalElectonConfig = (browsersConfig: Browser[]): Browser[] => [
    ...browsersConfig,
    {
        name: 'electron-locale',
        channel: 'stable',
        family: 'chromium',
        displayName: 'Electron Local',
        version: '126.0.6478.36',
        path: 'C:\\...\\node_modules\\electron\\dist\\electron.exe',
        majorVersion: '126',
        isHeaded: true,
        isHeadless: false,
    },
];

export default defineConfig({
    component: {
        setupNodeEvents(on, config) {
            return {
                ...config,
                browsers: addLocalElectonConfig(config.browsers),
            };
        },
    },
    e2e: {
        setupNodeEvents(on, config) {
            return {
                ...config,
                browsers: addLocalElectonConfig(config.browsers),
            };
        },
    },
});
cypress:launcher:browsers launching browser { browser: { name: 'electron-locale', channel: 'stable', family: 'chromium', displayName: 'Electron Local', version: '126.0.6478.36', path: 'C:\...\node_modules\electron\dist\electron.exe', majorVersion: '126', isHeaded: true, isHeadless: false }, url: 'about:blank' } +0ms

cypress:launcher:browsers spawning browser with opts { ... } +2ms

cypress:network:connect received error on connect, retrying { iteration: 0, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:53525 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 53525 } } +3s

cypress:network:connect received error on connect, retrying { iteration: 1, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:53525 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 53525 } } +102ms

cypress:launcher:browsers electron-locale exited: { code: 4294967295, signal: null } +118ms

cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 53516 } +7s

Thx

@jennifer-shehane jennifer-shehane added type: feature New feature that does not currently exist pkg/electron This is due to an issue in the packages/electron directory labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/electron This is due to an issue in the packages/electron directory type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants