mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
5b7f45e910
* share design documents and tests with insomnia sync * share collection and documents with insomnia/git sync * checkpoint * redirect when cloning (pulling) a new remote project * backend workspace card * redirect logic * local changes styles * loading indicator * fix sync button styles * use interval to refetch git * open the repo modal first before switching to git sync * use gitRepositoryId from metadata * fix sync option update * cleanup fetcher check * fixes * cleanup pull-push * undo logo change * clean git-vcs * use cloud icon for insomnia sync * cleanup card * more cleanup * better return type for fetchfetcher * update git tests * fix tests * fix some prerelease tests * fix cloning without an api spec * fix some more tests that expect a file to exist * fix lint error
83 lines
3.8 KiB
TypeScript
83 lines
3.8 KiB
TypeScript
import { test } from '../../playwright/test';
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.getByRole('button', { name: 'New Collection' }).click();
|
|
await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click();
|
|
|
|
await page.getByRole('button', { name: ' ' }).press('ArrowDown');
|
|
await page.getByRole('menuitem', { name: 'HTTP Request' }).press('Enter');
|
|
});
|
|
|
|
test('Select body dropdown', async ({ page }) => {
|
|
await page.getByRole('button', { name: 'Body' }).click();
|
|
await page.getByRole('menuitem', { name: 'JSON' }).click();
|
|
});
|
|
|
|
test('Select auth dropdown', async ({ page }) => {
|
|
await page.getByRole('tab', { name: 'Auth' }).click();
|
|
await page.getByRole('button', { name: 'Auth' }).click();
|
|
await page.getByRole('menuitem', { name: 'OAuth 1.0' }).click();
|
|
});
|
|
test('Open query parameters', async ({ page }) => {
|
|
await page.getByRole('tab', { name: 'Query' }).click();
|
|
await page.getByRole('tab', { name: 'Headers' }).click();
|
|
});
|
|
|
|
test('Open headers', async ({ page }) => {
|
|
await page.getByRole('tab', { name: 'Headers' }).click();
|
|
});
|
|
|
|
test('Open docs', async ({ page }) => {
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
|
});
|
|
|
|
test('Add description to docs', async ({ page }) => {
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
|
await page.locator('text=Add Description').click();
|
|
await page.locator('[data-testid="CodeEditor"] pre[role="presentation"]:has-text("")').click();
|
|
await page.locator('textarea').nth(1).fill('new request'); // this works
|
|
// TODO - fix the locator so we don't rely on `.nth(1)` https://linear.app/insomnia/issue/INS-2255/revisit-codemirror-playwright-selectorfill
|
|
});
|
|
|
|
test('WS select body type dropdown', async ({ page }) => {
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
await page.getByRole('tab', { name: 'JSON' }).click();
|
|
await page.getByRole('menuitem', { name: 'JSON' }).click();
|
|
});
|
|
|
|
test('WS select auth type dropdown', async ({ page }) => {
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
await page.getByRole('tab', { name: 'Auth' }).click();
|
|
});
|
|
|
|
test('WS open query parameters', async ({ page }) => {
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
await page.getByRole('tab', { name: 'Query' }).click();
|
|
});
|
|
|
|
test('WS open headers', async ({ page }) => {
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
await page.getByRole('tab', { name: 'Headers' }).click();
|
|
});
|
|
|
|
test('WS open docs', async ({ page }) => {
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
|
|
|
});
|
|
|
|
test('WS add description', async ({ page }) => {
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
|
await page.getByRole('button', { name: 'Add Description' }).click();
|
|
await page.locator('[data-testid="CodeEditor"] pre[role="presentation"]:has-text("")').click();
|
|
await page.locator('textarea').nth(1).fill('new wss');
|
|
// TODO - fix the locator so we don't rely on `.nth(1)` https://linear.app/insomnia/issue/INS-2255/revisit-codemirror-playwright-selectorfill
|
|
});
|