mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
45 lines
1.2 KiB
TypeScript
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();
|
|
});
|
|
});
|