diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-08-26 11:11:09 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-08-26 11:11:09 +0200 |
| commit | 0943270b5005ffc75818ccd9b22a349be09a9ce6 (patch) | |
| tree | c0bd69c4b149eeda043932f9a98f2ea61080cf8e /desktop | |
| parent | e25d5b996c3eec2e86bc03da83dd35530891d60c (diff) | |
| parent | 58f3303430d0e055aab0e3427cb6d9bf6f704adf (diff) | |
| download | mullvadvpn-0943270b5005ffc75818ccd9b22a349be09a9ce6.tar.xz mullvadvpn-0943270b5005ffc75818ccd9b22a349be09a9ce6.zip | |
Merge branch 'auto-connect-and-launch-on-startup-tests-fail-des-2316'
Diffstat (limited to 'desktop')
3 files changed, 32 insertions, 46 deletions
diff --git a/desktop/packages/mullvad-vpn/tasks/distribution.js b/desktop/packages/mullvad-vpn/tasks/distribution.js index b33304ad56..fe52ea4c24 100644 --- a/desktop/packages/mullvad-vpn/tasks/distribution.js +++ b/desktop/packages/mullvad-vpn/tasks/distribution.js @@ -189,6 +189,7 @@ function newConfig() { arch: getLinuxTargetArch(), }, ], + executableName: 'mullvad-vpn', artifactName: 'MullvadVPN-${version}_${arch}.${ext}', category: 'Network', icon: distAssets('icon.icns'), @@ -447,7 +448,7 @@ function packLinux() { afterPack: async (context) => { config.afterPack?.(context); - const sourceExecutable = path.join(context.appOutDir, 'Mullvad VPN'); + const sourceExecutable = path.join(context.appOutDir, 'mullvad-vpn'); const targetExecutable = path.join(context.appOutDir, 'mullvad-gui'); const launcherScript = path.join(context.appOutDir, 'mullvad-gui-launcher.sh'); diff --git a/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/vpn-settings/vpn-settings.spec.ts b/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/vpn-settings/vpn-settings.spec.ts index e84cf89baa..0e5c6dd349 100644 --- a/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/vpn-settings/vpn-settings.spec.ts +++ b/desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/vpn-settings/vpn-settings.spec.ts @@ -31,48 +31,34 @@ test.describe('VPN settings', () => { }); test.describe('Launch on startup and auto-connect', () => { - test.beforeAll(() => { - if (process.platform === 'linux') { - expect(autoStartPathExists()).toBeFalsy(); - } - }); test.afterEach(async () => { await routes.vpnSettings.setAutoConnectSwitch(false); - const autoConnectSwitchChecked = await routes.vpnSettings.getAutoConnectSwitchState(); - expect(autoConnectSwitchChecked).toBe('false'); + const autoConnectSwitch = routes.vpnSettings.getAutoConnectSwitch(); + await expect(autoConnectSwitch).toHaveAttribute('aria-checked', 'false'); await routes.vpnSettings.setLaunchAppOnStartupSwitch(false); - const launchOnStartupSwitchChecked = - await routes.vpnSettings.getLaunchAppOnStartupSwitchState(); - expect(launchOnStartupSwitchChecked).toBe('false'); + const launchOnStartupSwitch = routes.vpnSettings.getLaunchAppOnStartupSwitch(); + await expect(launchOnStartupSwitch).toHaveAttribute('aria-checked', 'false'); }); - const enableAutoConnect = async () => { - await routes.vpnSettings.setAutoConnectSwitch(true); - const autoConnectSwitchChecked = await routes.vpnSettings.getAutoConnectSwitchState(); - expect(autoConnectSwitchChecked).toBe('true'); - }; - - const enableLaunchAppOnStartup = async () => { - await routes.vpnSettings.setLaunchAppOnStartupSwitch(true); - const launchOnStartupSwitchChecked = - await routes.vpnSettings.getLaunchAppOnStartupSwitchState(); - expect(launchOnStartupSwitchChecked).toBe('true'); - - if (process.platform === 'linux') { - expect(autoStartPathExists()).toBeTruthy(); - } - }; - test.describe('Launch app on start-up', () => { test('Should be enabled when switch is clicked', async () => { - await enableAutoConnect(); + if (process.platform === 'linux') { + expect(autoStartPathExists()).toBeFalsy(); + } - const cliAutoConnect = execSync('mullvad auto-connect get').toString(); - expect(cliAutoConnect).toContain('off'); + await routes.vpnSettings.setLaunchAppOnStartupSwitch(true); + const launchOnStartupSwitch = routes.vpnSettings.getLaunchAppOnStartupSwitch(); + await expect(launchOnStartupSwitch).toHaveAttribute('aria-checked', 'true'); + + if (process.platform === 'linux') { + expect(autoStartPathExists()).toBeTruthy(); + } }); - test('Should not enable cli auto-connect when enabled alone', () => { + test('Should not enable cli auto-connect when enabled alone', async () => { + await routes.vpnSettings.setLaunchAppOnStartupSwitch(true); + const cliAutoConnect = execSync('mullvad auto-connect get').toString(); expect(cliAutoConnect).toContain('off'); }); @@ -80,18 +66,27 @@ test.describe('VPN settings', () => { test.describe('Auto-connect', () => { test('Should be enabled when switch is clicked', async () => { - await enableLaunchAppOnStartup(); + await routes.vpnSettings.setAutoConnectSwitch(true); + const autoConnectSwitchChecked = routes.vpnSettings.getAutoConnectSwitch(); + await expect(autoConnectSwitchChecked).toHaveAttribute('aria-checked', 'true'); }); - test('Should not enable cli auto-connect when enabled alone', () => { + test('Should not enable cli auto-connect when enabled alone', async () => { + await routes.vpnSettings.setAutoConnectSwitch(true); const cliAutoConnect = execSync('mullvad auto-connect get').toString(); expect(cliAutoConnect).toContain('off'); }); }); test('Should enable cli auto-connect when both launch app on start-up and auto-connect are enabled', async () => { - await enableLaunchAppOnStartup(); - await enableAutoConnect(); + await routes.vpnSettings.setLaunchAppOnStartupSwitch(true); + await routes.vpnSettings.setAutoConnectSwitch(true); + + const launchOnStartupSwitch = routes.vpnSettings.getLaunchAppOnStartupSwitch(); + await expect(launchOnStartupSwitch).toHaveAttribute('aria-checked', 'true'); + + const autoConnectSwitchChecked = routes.vpnSettings.getAutoConnectSwitch(); + await expect(autoConnectSwitchChecked).toHaveAttribute('aria-checked', 'true'); const cliAutoConnect = execSync('mullvad auto-connect get').toString(); expect(cliAutoConnect).toContain('on'); diff --git a/desktop/packages/mullvad-vpn/test/e2e/route-object-models/vpn-settings/vpn-settings-route-object-model.ts b/desktop/packages/mullvad-vpn/test/e2e/route-object-models/vpn-settings/vpn-settings-route-object-model.ts index cc23cc60c3..5e8ea0e99b 100644 --- a/desktop/packages/mullvad-vpn/test/e2e/route-object-models/vpn-settings/vpn-settings-route-object-model.ts +++ b/desktop/packages/mullvad-vpn/test/e2e/route-object-models/vpn-settings/vpn-settings-route-object-model.ts @@ -27,11 +27,6 @@ export class VpnSettingsRouteObjectModel { } } - async getAutoConnectSwitchState() { - const autoConnectSwitch = this.getAutoConnectSwitch(); - return autoConnectSwitch.getAttribute('aria-checked'); - } - getLaunchAppOnStartupSwitch() { return this.selectors.launchAppOnStartupSwitch(); } @@ -44,11 +39,6 @@ export class VpnSettingsRouteObjectModel { } } - async getLaunchAppOnStartupSwitchState() { - const launchAppOnStartupSwitch = this.getLaunchAppOnStartupSwitch(); - return launchAppOnStartupSwitch.getAttribute('aria-checked'); - } - getLanSwitch() { return this.selectors.lanSwitch(); } |
