1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/packages/app-desktop/integration-tests/simpleBackup.spec.ts
Henry Heino 13d8fbbd65
Chore: Desktop: Fix test failures due to race condition (#11417)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2024-11-20 11:35:22 +00:00

42 lines
1.4 KiB
TypeScript

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();
});
});