2021-02-25 20:39:59 +00:00
|
|
|
import * as client from '../modules/client';
|
|
|
|
import { launchApp, stop } from '../modules/application';
|
|
|
|
import * as onboarding from '../modules/onboarding';
|
|
|
|
import * as migration from '../modules/migration';
|
|
|
|
import * as home from '../modules/home';
|
|
|
|
import path from 'path';
|
2021-05-19 11:49:48 +00:00
|
|
|
import { Application } from 'spectron';
|
2021-02-25 20:39:59 +00:00
|
|
|
|
|
|
|
describe('Migration', function() {
|
|
|
|
jest.setTimeout(50000);
|
2021-05-19 11:49:48 +00:00
|
|
|
let app: Application;
|
2021-02-25 20:39:59 +00:00
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
|
|
app = await launchApp(path.join(__dirname, '..', 'fixtures', 'basic-designer'));
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(async () => {
|
|
|
|
await stop(app);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('can skip migration and proceed onboarding', async () => {
|
|
|
|
await client.correctlyLaunched(app);
|
|
|
|
|
|
|
|
await migration.migrationMessageShown(app);
|
|
|
|
await migration.clickSkip(app);
|
|
|
|
|
2021-03-03 20:00:56 +00:00
|
|
|
await onboarding.skipOnboardingFlow(app);
|
2021-02-25 20:39:59 +00:00
|
|
|
|
|
|
|
await home.documentListingShown(app);
|
|
|
|
await home.expectTotalDocuments(app, 1);
|
|
|
|
await home.expectDocumentWithTitle(app, 'Insomnia');
|
|
|
|
|
|
|
|
await app.restart();
|
|
|
|
await client.focusAfterRestart(app);
|
|
|
|
|
|
|
|
await home.documentListingShown(app);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('can migrate and proceed onboarding', async () => {
|
|
|
|
await client.correctlyLaunched(app);
|
|
|
|
|
|
|
|
await migration.migrationMessageShown(app);
|
2021-02-25 23:01:46 +00:00
|
|
|
await migration.ensureStartNotClickable(app);
|
|
|
|
|
|
|
|
await migration.toggleOption(app, 'Copy Workspaces');
|
|
|
|
await migration.toggleOption(app, 'Copy Plugins');
|
|
|
|
await migration.toggleOption(app, 'Copy Designer Application Settings');
|
2021-02-25 20:39:59 +00:00
|
|
|
await migration.clickStart(app);
|
2021-02-25 23:01:46 +00:00
|
|
|
|
2021-02-25 20:39:59 +00:00
|
|
|
await migration.successMessageShown(app);
|
|
|
|
await migration.clickRestart(app);
|
|
|
|
|
|
|
|
await client.focusAfterRestart(app);
|
|
|
|
|
2021-03-03 20:00:56 +00:00
|
|
|
await onboarding.skipOnboardingFlow(app);
|
2021-02-25 20:39:59 +00:00
|
|
|
|
|
|
|
await home.documentListingShown(app);
|
|
|
|
await home.expectTotalDocuments(app, 2);
|
|
|
|
await home.expectDocumentWithTitle(app, 'Insomnia');
|
|
|
|
await home.expectDocumentWithTitle(app, 'BASIC-DESIGNER-FIXTURE'); // imported from fixture
|
|
|
|
|
|
|
|
await app.restart();
|
|
|
|
await client.focusAfterRestart(app);
|
|
|
|
|
|
|
|
await home.documentListingShown(app);
|
|
|
|
});
|
|
|
|
});
|