mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-21 14:47:46 -04:00
Debug head test (#5638)
* Created Debug Head tests * Added Open Generate code and copy as curl test * delete duplicate debug-head file * trying to add data-testid * add todo messages * revert datatestid for codemirror * revert datatestid for codemirror * fix Co-authored-by: Filipe Freire <livrofubia@gmail.com>
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { test } from '../../playwright/test';
|
||||
|
||||
test('Basic interactions', async ({ }) => {
|
||||
// TODO(filfreire): add a few scenarios ported from the release checklist
|
||||
|
||||
await expect(true).toBeTruthy();
|
||||
});
|
||||
@@ -0,0 +1,76 @@
|
||||
import { test } from '../../playwright/test';
|
||||
|
||||
test('Select body dropdown', async ({ page }) => {
|
||||
await page.locator('div[role="tab"]:has-text("Body")').click();
|
||||
await page.locator('button:has-text("JSON")').click();
|
||||
|
||||
});
|
||||
|
||||
test('Select auth dropdown', async ({ page }) => {
|
||||
await page.locator('div[role="tab"]:has-text("Auth")').click();
|
||||
await page.locator('[aria-label="Request pane tabs"] >> text=Auth').click();
|
||||
await page.locator('button:has-text("OAuth 1.0")').click();
|
||||
});
|
||||
test('Open query parameters', async ({ page }) => {
|
||||
await page.locator('[data-testid="request-pane"] >> text=Query').click();
|
||||
await page.locator('text=Headers').click();
|
||||
});
|
||||
|
||||
test('Open headers', async ({ page }) => {
|
||||
await page.locator('text=Headers').click();
|
||||
|
||||
});
|
||||
|
||||
test('Open docs', async ({ page }) => {
|
||||
await page.locator('text=Docs').click();
|
||||
});
|
||||
|
||||
test('Add description to docs', async ({ page }) => {
|
||||
await page.locator('text=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.locator('button:has-text("WebSocket Request")').first().click();
|
||||
await page.locator('[aria-label="Websocket request pane tabs"] >> text=JSON').click();
|
||||
await page.locator('#dropdowns-container button:has-text("JSON")').click();
|
||||
});
|
||||
|
||||
test('WS select auth type dropdown', async ({ page }) => {
|
||||
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
||||
await page.locator('button:has-text("WebSocket Request")').first().click();
|
||||
await page.locator('div[role="tab"]:has-text("Auth")').click();
|
||||
});
|
||||
|
||||
test('WS open query parameters', async ({ page }) => {
|
||||
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
||||
await page.locator('button:has-text("WebSocket Request")').first().click();
|
||||
await page.locator('text=Query').click();
|
||||
});
|
||||
|
||||
test('WS open headers', async ({ page }) => {
|
||||
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
||||
await page.locator('button:has-text("WebSocket Request")').first().click();
|
||||
await page.locator('text=Headers').click();
|
||||
});
|
||||
|
||||
test('WS open docs', async ({ page }) => {
|
||||
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
||||
await page.locator('button:has-text("WebSocket Request")').first().click();
|
||||
await page.locator('text=Docs').click();
|
||||
|
||||
});
|
||||
|
||||
test('WS add description', async ({ page }) => {
|
||||
await page.locator('[data-testid="SidebarFilter"] [data-testid="SidebarCreateDropdown"] button').click();
|
||||
await page.locator('button:has-text("WebSocket Request")').first().click();
|
||||
await page.locator('text=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 wss');
|
||||
// TODO - fix the locator so we don't rely on `.nth(1)` https://linear.app/insomnia/issue/INS-2255/revisit-codemirror-playwright-selectorfill
|
||||
});
|
||||
@@ -12,6 +12,7 @@ test('can render Spectral OpenAPI lint errors', async ({ page }) => {
|
||||
// Cause a lint error
|
||||
await page.locator('[data-testid="CodeEditor"] >> text=info').click();
|
||||
await page.locator('textarea').nth(1).press('Tab');
|
||||
// TODO - fix the locator so we don't rely on `.nth(1)` https://linear.app/insomnia/issue/INS-2255/revisit-codemirror-playwright-selectorfill
|
||||
|
||||
await expect(codeEditor).toContainText('oas3-schema Object must have required property "info"');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user