Files
studio-desktop/tests/integration/testInstallWizard.ts
filteredandGitHub 1a06378d5d [e2e] Implement install process for post-install tests (#907)
* Ensure install test disposes test env

* nit

* Add post-install setup project

* [Refactor] Re-export expect to enable custom tests

* [Refactor] Use class properties for locators

* Add post-install app setup "test"

* [Refactor] Set dispose test environment at project level

* [DevExp] Use soft fail for install location
2025-02-15 20:54:10 +11:00

49 lines
1.4 KiB
TypeScript

import type { Page } from '@playwright/test';
/* CI is slow. */
const getStartedTimeout = process.env.CI ? { timeout: 60 * 1000 } : undefined;
export class TestInstallWizard {
readonly getStartedButton;
readonly nextButton;
readonly installButton;
readonly cpuToggle;
readonly installLocationInput;
readonly selectGpuTitle;
readonly installLocationTitle;
readonly migrateTitle;
readonly desktopSettingsTitle;
constructor(readonly window: Page) {
this.nextButton = this.getButton('Next');
this.getStartedButton = this.getButton('Get Started');
this.installButton = this.getButton('Install');
this.cpuToggle = this.window.locator('#cpu-mode');
this.installLocationInput = this.getInput('', true);
this.selectGpuTitle = this.window.getByText('Select GPU');
this.installLocationTitle = this.window.getByText('Choose Installation Location');
this.migrateTitle = this.window.getByText('Migrate from Existing Installation');
this.desktopSettingsTitle = this.window.getByText('Desktop App Settings');
}
async clickNext() {
await this.nextButton.click();
}
async clickGetStarted() {
await this.getStartedButton.click(getStartedTimeout);
}
getButton(name: string) {
return this.window.getByRole('button', { name });
}
getInput(name: string, exact?: boolean) {
return this.window.getByRole('textbox', { name, exact });
}
}