Files
actual/packages/desktop-client/e2e/settings.test.ts
Joel Jeremy Marquez 012cfd09ea [TypeScript] Convert playwright config and tests to TS (#4217)
* Convert playwright config and tests to TS

* Release notes

* Update VRT

* Dummy commit

* Delete js snapshots

* Fix call to expect

* Move extended expect and test to fixtures

* Fix wrong commit

* Fix typecheck error

* Update VRT

* Dummy commit to run GH actions

* Delete mobile budget test JS

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-22 09:00:10 -08:00

47 lines
1.2 KiB
TypeScript

import { type Page } from '@playwright/test';
import { expect, test } from './fixtures';
import { ConfigurationPage } from './page-models/configuration-page';
import { Navigation } from './page-models/navigation';
import { type SettingsPage } from './page-models/settings-page';
test.describe('Settings', () => {
let page: Page;
let navigation: Navigation;
let settingsPage: SettingsPage;
let configurationPage: ConfigurationPage;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
navigation = new Navigation(page);
configurationPage = new ConfigurationPage(page);
await page.goto('/');
await configurationPage.createTestFile();
});
test.afterAll(async () => {
await page.close();
});
test.beforeEach(async () => {
settingsPage = await navigation.goToSettingsPage();
});
test('checks the page visuals', async () => {
await expect(page).toMatchThemeScreenshots();
});
test('downloads the export of the budget', async () => {
const downloadPromise = page.waitForEvent('download');
await settingsPage.exportData();
const download = await downloadPromise;
expect(await download.suggestedFilename()).toMatch(
/^\d{4}-\d{2}-\d{2}-.*.zip$/,
);
});
});