mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
96011e8db5
* fix lint errors * use only ubuntu for tests * add critical test to release recurring * fix path * fix paths again
29 lines
1.4 KiB
TypeScript
29 lines
1.4 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
|
|
import { loadFixture } from '../../playwright/paths';
|
|
import { test } from '../../playwright/test';
|
|
|
|
test('can send requests', async ({ app, page }) => {
|
|
const statusTag = page.locator('[data-testid="response-status-tag"]:visible');
|
|
const responseBody = page.locator('[data-testid="CodeEditor"]:visible', {
|
|
has: page.locator('.CodeMirror-activeline'),
|
|
});
|
|
await page.getByRole('button', { name: 'Create' }).click();
|
|
const text = await loadFixture('smoke-test-collection.yaml');
|
|
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
|
|
|
|
await page.getByRole('menuitem', { name: 'Import' }).click();
|
|
await page.getByText('Clipboard').click();
|
|
await page.getByRole('button', { name: 'Scan' }).click();
|
|
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
|
|
await page.getByText('CollectionSmoke testsjust now').click();
|
|
|
|
await page.getByRole('button', { name: 'send JSON request' }).click();
|
|
await page.getByTestId('request-pane').getByRole('button', { name: 'Send' }).click();
|
|
await expect(statusTag).toContainText('200 OK');
|
|
await expect(responseBody).toContainText('"id": "1"');
|
|
await page.getByRole('button', { name: 'Preview' }).click();
|
|
await page.getByRole('menuitem', { name: 'Raw Data' }).click();
|
|
await expect(responseBody).toContainText('{"id":"1"}');
|
|
});
|