Skip to content

Commit

Permalink
Update test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Dec 18, 2024
1 parent fb183fc commit d1749f2
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions tests/integration/startup.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test';
import { test, expect, type Locator } from '@playwright/test';
import { chromium } from '@playwright/test';

test('has title', async () => {
Expand All @@ -25,26 +25,34 @@ test('has title', async () => {

await getStartedButton.click();

await expect(page.getByText('Choose Installation Location')).toBeVisible();
// Select GPU screen
await expect(page.getByText('Select GPU')).toBeVisible();

await page.screenshot({ path: 'screenshot-get-started.png' });
const nextButton = page.getByRole('button', { name: 'Next' });
const cpuToggle = page.locator('#cpu-mode');

let nextButton = page.getByRole('button', { name: 'Next' });
await expect(cpuToggle).toBeVisible();
await cpuToggle.click();

await expect(nextButton).toBeVisible();
await expect(nextButton).toBeEnabled();
await clickEnabledButton(nextButton);

await nextButton.click();
await expect(page.getByText('Choose Installation Location')).toBeVisible();
await page.screenshot({ path: 'screenshot-get-started.png' });

await expect(page.getByText('Migrate from Existing Installation')).toBeVisible();
await clickEnabledButton(nextButton);

await expect(page.getByText('Migrate from Existing Installation')).toBeVisible();
await page.screenshot({ path: 'screenshot-migrate.png' });

nextButton = page.getByRole('button', { name: 'Next' });

await nextButton.click();
await clickEnabledButton(nextButton);

await expect(page.getByText('Desktop App Settings')).toBeVisible();

await page.screenshot({ path: 'screenshot-install.png' });

/** */
async function clickEnabledButton(button: Locator) {
await expect(button).toBeVisible();
await expect(button).toBeEnabled();
await button.click();
}
});

0 comments on commit d1749f2

Please sign in to comment.