insomnia/packages/insomnia-smoke-test/core/migration.test.ts
Opender Singh 5fa8f0069d
Enable ESLint & TS for smoke tests (#3397)
* remove babel and add configs

* add ts-node

* lint scripts

* eslint override

* remove type module

* add expect errors

* update js files to ts

* fix electron import

* remove errors

* update readme

* add build step

* typesync

* add eslintignore
2021-05-19 07:49:48 -04:00

68 lines
2.0 KiB
TypeScript

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';
import { Application } from 'spectron';
describe('Migration', function() {
jest.setTimeout(50000);
let app: Application;
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);
await onboarding.skipOnboardingFlow(app);
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);
await migration.ensureStartNotClickable(app);
await migration.toggleOption(app, 'Copy Workspaces');
await migration.toggleOption(app, 'Copy Plugins');
await migration.toggleOption(app, 'Copy Designer Application Settings');
await migration.clickStart(app);
await migration.successMessageShown(app);
await migration.clickRestart(app);
await client.focusAfterRestart(app);
await onboarding.skipOnboardingFlow(app);
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);
});
});