-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
simpleBackup.spec.ts
41 lines (30 loc) · 1.39 KB
/
simpleBackup.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { test } from './util/test';
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;
const mainScreen = await new MainScreen(mainWindow).setup();
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;
const mainScreen = await new MainScreen(mainWindow).setup();
await mainScreen.waitFor();
// Backups should work
await activateMainMenuItem(electronApp, 'Create backup');
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();
});
});