Files
actual/packages/desktop-client/e2e/settings.mobile.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

45 lines
1.2 KiB
TypeScript

import { type Page } from '@playwright/test';
import { expect, test } from './fixtures';
import { ConfigurationPage } from './page-models/configuration-page';
import { MobileNavigation } from './page-models/mobile-navigation';
test.describe('Mobile Settings', () => {
let page: Page;
let navigation: MobileNavigation;
let configurationPage: ConfigurationPage;
test.beforeEach(async ({ browser }) => {
page = await browser.newPage();
navigation = new MobileNavigation(page);
configurationPage = new ConfigurationPage(page);
await page.setViewportSize({
width: 350,
height: 600,
});
await page.goto('/');
await configurationPage.createTestFile();
});
test.afterEach(async () => {
await page.close();
});
test('checks that settings page can be opened', async () => {
const settingsPage = await navigation.goToSettingsPage();
await expect(page).toMatchThemeScreenshots();
const downloadPromise = page.waitForEvent('download');
await settingsPage.exportData();
const download = await downloadPromise;
expect(await download.suggestedFilename()).toMatch(
/^\d{4}-\d{2}-\d{2}-.*.zip$/,
);
await expect(page).toMatchThemeScreenshots();
});
});