2024-09-04 13:14:12 +02:00
|
|
|
import { test } from './util/test';
|
2023-12-11 15:58:45 +02:00
|
|
|
import MainScreen from './models/MainScreen';
|
|
|
|
import SettingsScreen from './models/SettingsScreen';
|
|
|
|
import activateMainMenuItem from './util/activateMainMenuItem';
|
|
|
|
|
|
|
|
test.describe('simpleBackup', () => {
|
|
|
|
test('should have a section in settings', async ({ electronApp, startupPluginsLoaded, mainWindow }) => {
|
|
|
|
await startupPluginsLoaded;
|
|
|
|
|
2024-11-20 13:35:22 +02:00
|
|
|
const mainScreen = await new MainScreen(mainWindow).setup();
|
2023-12-11 15:58:45 +02:00
|
|
|
await mainScreen.waitFor();
|
|
|
|
|
|
|
|
// Open settings (check both labels so that this works on MacOS)
|
|
|
|
await mainScreen.openSettings(electronApp);
|
|
|
|
|
|
|
|
// Should be on the settings screen
|
|
|
|
const settingsScreen = new SettingsScreen(mainWindow);
|
|
|
|
await settingsScreen.waitFor();
|
|
|
|
|
|
|
|
const backupTab = settingsScreen.getTabLocator('Backup');
|
|
|
|
await backupTab.waitFor();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('should be possible to create a backup', async ({ electronApp, startupPluginsLoaded, mainWindow }) => {
|
|
|
|
await startupPluginsLoaded;
|
|
|
|
|
2024-11-20 13:35:22 +02:00
|
|
|
const mainScreen = await new MainScreen(mainWindow).setup();
|
2023-12-11 15:58:45 +02:00
|
|
|
await mainScreen.waitFor();
|
|
|
|
|
|
|
|
// Backups should work
|
2024-09-04 13:14:12 +02:00
|
|
|
await activateMainMenuItem(electronApp, 'Create backup');
|
2023-12-11 15:58:45 +02:00
|
|
|
|
|
|
|
const successDialog = mainWindow.locator('iframe[id$=backup-backupDialog]');
|
|
|
|
await successDialog.waitFor();
|
|
|
|
|
|
|
|
// Should report success
|
|
|
|
const dialogContentLocator = successDialog.frameLocator(':scope');
|
|
|
|
await dialogContentLocator.getByText('Backup completed').waitFor();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|