mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
97a4d10048
* INS-2434: Kong 3.x support on Inso CLI * fix test * Add basic support for kong 3.0 on Insomnia UI
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
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
|
|
await page.locator('div[role="tab"]:has-text("Plugins")').click();
|
|
|
|
// 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');
|
|
});
|
|
|
|
test('Check Declarative Config and Kong Kubernetes config', async ({ page }) => {
|
|
// Switch to design tab
|
|
await page.click('text=Design');
|
|
|
|
// 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
|
|
await page.getByRole('button', { name: 'New Document' }).click();
|
|
await page.getByRole('menuitem', { name: 'Declarative Config (Legacy)' }).click();
|
|
// Check for declarative config contents
|
|
await page.click('text=/.*"_format_version".*/');
|
|
|
|
// Switch to Kong for Kubernetes tab
|
|
await page.click('div[role="tab"]:has-text("Kong for Kubernetes")');
|
|
|
|
// Check for Kong for Kubernetes contents
|
|
await page.click('text=apiVersion: networking.k8s.io/v1');
|
|
});
|
|
|
|
// TODO: more scenarios will be added in follow-up iterations of increasing test coverage
|
|
});
|