mirror of
https://github.com/hanzoai/studio-desktop.git
synced 2026-10-30 18:21:16 +00:00
* 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
49 lines
1.4 KiB
TypeScript
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 });
|
|
}
|
|
}
|