Testing Request Pane Tab Navigation and Configuration in Insomnia
This test suite validates the functionality of request pane tabs in the Insomnia API client, covering both HTTP and WebSocket request types. It ensures proper navigation and interaction with various request configuration tabs including Body, Auth, Headers, and Documentation.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
kong/insomnia
packages/insomnia-smoke-test/tests/smoke/request-pane-tab.test.ts
import { test } from '../../playwright/test';
test('Request tabs', async ({ page }) => {
await page.getByRole('button', { name: 'New Collection' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click();
await page.getByLabel('Create in collection').click();
await page.getByRole('menuitemradio', { name: 'HTTP Request' }).press('Enter');
await page.getByRole('tab', { name: 'Body' }).click();
await page.getByRole('button', { name: 'Body' }).click();
await page.getByRole('option', { name: 'JSON' }).click();
await page.getByRole('tab', { name: 'Auth' }).click();
await page.getByRole('button', { name: 'Auth' }).click();
await page.getByLabel('OAuth 1.0', { exact: true }).click();
await page.getByRole('tab', { name: 'Params' }).click();
await page.getByRole('tab', { name: 'Headers' }).click();
await page.getByRole('tab', { name: 'Docs' }).click();
await page.getByTestId('CodeEditor').getByRole('textbox').fill('some docs');
await page.getByRole('tab', { name: 'Preview' }).click();
});
test('WS tabs', async ({ page }) => {
await page.getByRole('button', { name: 'New Collection' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click();
await page.getByLabel('Create in collection').click();
await page.getByRole('menuitemradio', { name: 'WebSocket Request' }).click();
await page.getByRole('tab', { name: 'Body' }).click();
await page.getByRole('button', { name: 'JSON' }).click();
await page.getByRole('option', { name: 'JSON' }).click();
await page.getByRole('tab', { name: 'Auth' }).click();
await page.getByRole('tab', { name: 'Params' }).click();
await page.getByRole('tab', { name: 'Headers' }).click();
await page.getByRole('tab', { name: 'Docs' }).click();
await page.getByTestId('CodeEditor').getByRole('textbox').fill('some docs');
await page.getByRole('tab', { name: 'Preview' }).click();
});