Files
studio-desktop/tests/integration/post-install/troubleshooting.spec.ts
filteredandGitHub 992659ab3d [e2e] Add recreate virtual environment test (#914)
* nit - Rename

* [e2e] Add recreate virtual environment test

* Add test expectation

* Fix button name

* Replace manual test env cleanup with disposable

* [Dev] Fix vscode debug + playwright ext. conflict

Breaks on caught exceptions that are within another class member

* Fix venv creation - use confirm buttons & wait for server start

* Fix server start timeout too short

* Fix new disposable clean up never runs
2025-02-17 09:12:50 +11:00

46 lines
1.7 KiB
TypeScript

import { getDefaultInstallLocation } from 'tests/shared/utils';
import { expect, test } from '../testExtensions';
test.describe('Troubleshooting - broken install path', () => {
test.beforeEach(async ({ app }) => {
await app.testEnvironment.breakInstallPath();
});
test('Troubleshooting page loads when base path is invalid', async ({ troubleshooting, window }) => {
await troubleshooting.expectReady();
await expect(troubleshooting.basePathCard.rootEl).toBeVisible();
await expect(window).toHaveScreenshot('troubleshooting.png');
});
test('Refresh button is disabled whilst refreshing', async ({ troubleshooting }) => {
await troubleshooting.refresh();
await expect(troubleshooting.refreshButton).toBeDisabled();
// Wait for the refresh to complete
await troubleshooting.expectReady();
});
test('Can fix install path', async ({ troubleshooting, app, serverStart, window }) => {
await troubleshooting.expectReady();
const { basePathCard } = troubleshooting;
await expect(basePathCard.rootEl).toBeVisible();
const filePath = getDefaultInstallLocation();
await app.app.evaluate((electron, filePath) => {
// "Mock" the native dialog
electron.dialog.showOpenDialog = async () => {
await new Promise((resolve) => setTimeout(resolve, 250));
return { canceled: false, filePaths: [filePath] };
};
}, filePath);
await basePathCard.button.click();
await expect(basePathCard.isRunningIndicator).toBeVisible();
await expect(window).toHaveScreenshot('troubleshooting-base-path.png');
// Base path fixed - server should start
await serverStart.expectServerStarts();
});
});