2022-10-27 17:04:45 +00:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
|
|
|
|
import { test } from '../../playwright/test';
|
|
|
|
|
|
|
|
test.describe('Plugins', async () => {
|
|
|
|
test('Open plugins menu and generate plugin', async ({ page }) => {
|
|
|
|
// Opening settings
|
|
|
|
await page.locator('[data-testid="settings-button"]').click();
|
|
|
|
// Switching to Plugins tab
|
2022-11-11 18:38:30 +00:00
|
|
|
await page.locator('div[role="tab"]:has-text("Plugins")').click();
|
2022-10-27 17:04:45 +00:00
|
|
|
|
|
|
|
// Generate new plugin
|
|
|
|
await page.locator('text=Generate New Plugin').click();
|
|
|
|
await page.locator('text=Generate').first().click();
|
|
|
|
|
|
|
|
// check if the plugin shows up on the plugin list
|
|
|
|
await expect(page.locator('.app')).toContainText('insomnia-plugin-demo-example');
|
|
|
|
});
|
|
|
|
|
2022-11-11 18:38:30 +00:00
|
|
|
test('Check Declarative Config and Kong Kubernetes config', async ({ page }) => {
|
2023-07-05 16:51:55 +00:00
|
|
|
await page.getByRole('button', { name: 'New Document' }).click();
|
|
|
|
await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click();
|
2022-11-11 18:38:30 +00:00
|
|
|
|
|
|
|
// Set example OpenAPI spec
|
|
|
|
await page.click('text=start from an example');
|
|
|
|
await expect(page.locator('.app')).toContainText('This is a sample server Petstore server');
|
|
|
|
|
|
|
|
// Open declarative config
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('button', { name: 'New Document' }).click();
|
2023-03-14 15:17:28 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'Declarative Config (Legacy)' }).click();
|
2022-11-11 18:38:30 +00:00
|
|
|
// Check for declarative config contents
|
2023-07-26 09:34:34 +00:00
|
|
|
await page.getByText('_format_version').click();
|
2022-11-11 18:38:30 +00:00
|
|
|
|
|
|
|
// Switch to Kong for Kubernetes tab
|
|
|
|
await page.click('div[role="tab"]:has-text("Kong for Kubernetes")');
|
|
|
|
|
|
|
|
// Check for Kong for Kubernetes contents
|
2023-07-26 09:34:34 +00:00
|
|
|
await page.getByText('apiVersion: networking.k8s.io/v1').click();
|
2022-11-11 18:38:30 +00:00
|
|
|
});
|
|
|
|
|
2022-10-27 17:04:45 +00:00
|
|
|
// TODO: more scenarios will be added in follow-up iterations of increasing test coverage
|
|
|
|
});
|