2023-01-11 16:06:46 +00:00
|
|
|
import { test } from '../../playwright/test';
|
|
|
|
|
2023-07-05 16:51:55 +00:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
|
2023-01-11 16:06:46 +00:00
|
|
|
test('Select body dropdown', async ({ page }) => {
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('button', { name: 'Body' }).click();
|
|
|
|
await page.getByRole('menuitem', { name: 'JSON' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Select auth dropdown', async ({ page }) => {
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('tab', { name: 'Auth' }).click();
|
|
|
|
await page.getByRole('button', { name: 'Auth' }).click();
|
|
|
|
await page.getByRole('menuitem', { name: 'OAuth 1.0' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
test('Open query parameters', async ({ page }) => {
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('tab', { name: 'Query' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Headers' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Open headers', async ({ page }) => {
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('tab', { name: 'Headers' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Open docs', async ({ page }) => {
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Add description to docs', async ({ page }) => {
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
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();
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'JSON' }).click();
|
|
|
|
await page.getByRole('menuitem', { name: 'JSON' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('WS select auth type dropdown', async ({ page }) => {
|
|
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Auth' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('WS open query parameters', async ({ page }) => {
|
|
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Query' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('WS open headers', async ({ page }) => {
|
|
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Headers' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('WS open docs', async ({ page }) => {
|
|
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test('WS add description', async ({ page }) => {
|
|
|
|
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
2023-01-20 14:49:52 +00:00
|
|
|
await page.getByRole('menuitem', { name: 'WebSocket Request' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Docs' }).click();
|
|
|
|
await page.getByRole('button', { name: 'Add Description' }).click();
|
2023-01-11 16:06:46 +00:00
|
|
|
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
|
|
|
|
});
|