2020-09-24 19:23:23 +00:00
|
|
|
import * as onboarding from '../modules/onboarding';
|
|
|
|
import * as client from '../modules/client';
|
|
|
|
import * as home from '../modules/home';
|
2020-11-25 02:26:00 +00:00
|
|
|
import * as settings from '../modules/settings';
|
|
|
|
import * as modal from '../modules/modal';
|
|
|
|
import * as dropdown from '../modules/dropdown';
|
2020-08-24 22:49:29 +00:00
|
|
|
|
2021-02-03 07:07:11 +00:00
|
|
|
import { isPackage, launchApp, stop } from '../modules/application';
|
2020-11-25 02:26:00 +00:00
|
|
|
|
|
|
|
const itIf = condition => (condition ? it : it.skip);
|
|
|
|
it.if = itIf;
|
2020-08-24 22:49:29 +00:00
|
|
|
|
|
|
|
describe('Application launch', function() {
|
|
|
|
jest.setTimeout(50000);
|
|
|
|
let app = null;
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
2021-02-03 07:07:11 +00:00
|
|
|
app = await launchApp();
|
2020-08-24 22:49:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(async () => {
|
2020-09-24 19:55:27 +00:00
|
|
|
await stop(app);
|
2020-08-24 22:49:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('can reset to and proceed through onboarding flow', async () => {
|
|
|
|
await client.correctlyLaunched(app);
|
|
|
|
await client.resetToOnboarding(app);
|
|
|
|
|
|
|
|
await onboarding.welcomeMessageShown(app);
|
|
|
|
await onboarding.clickDontShare(app);
|
|
|
|
await onboarding.clickSkipImport(app);
|
|
|
|
|
|
|
|
await home.documentListingShown(app);
|
|
|
|
});
|
2020-11-25 02:26:00 +00:00
|
|
|
|
|
|
|
it.if(isPackage())('can install and consume a plugin', async () => {
|
|
|
|
await client.correctlyLaunched(app);
|
|
|
|
await home.documentListingShown(app);
|
|
|
|
|
|
|
|
// Install plugin
|
|
|
|
await settings.openWithKeyboardShortcut(app);
|
|
|
|
await settings.goToPlugins(app);
|
|
|
|
await settings.installPlugin(app, 'insomnia-plugin-kong-bundle');
|
|
|
|
await settings.closeModal(app);
|
|
|
|
|
|
|
|
// Open card dropdown for any card
|
|
|
|
const dd = await home.openDocumentMenuDropdown(app);
|
|
|
|
|
|
|
|
// Click the "Deploy to Portal" button, installed from that plugin
|
|
|
|
await dropdown.clickDropdownItemByText(dd, 'Deploy to Portal');
|
|
|
|
|
|
|
|
// Ensure a modal opens, then close it - the rest is plugin behavior
|
|
|
|
await modal.waitUntilOpened(app, { title: 'Deploy to Portal' });
|
|
|
|
await modal.close(app);
|
|
|
|
});
|
2020-08-24 22:49:29 +00:00
|
|
|
});
|