mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
90b9516d55
* make all migration functions non-async * migrate is not a promise * simplify scope migration * remove apispec and fix test * fix tests * fix tests, for real this time * removed api spec from collection * default doc name to my-spec.yaml again * fix apispec typing * remove pointless generic * fix type * Create an api spec on first launch * Remove flaky firstLaunch data creation * fix test * create apispec only when scope is deisgn * oauth test left * gitlab test --------- Co-authored-by: gatzjames <jamesgatzos@gmail.com>
41 lines
1.9 KiB
TypeScript
41 lines
1.9 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
|
|
import { loadFixture } from '../../playwright/paths';
|
|
import { test } from '../../playwright/test';
|
|
|
|
test('can send gRPC requests with reflection', async ({ app, page }) => {
|
|
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');
|
|
const statusTag = page.locator('[data-testid="response-status-tag"]:visible');
|
|
const responseBody = page.locator('[data-testid="response-pane"] >> [data-testid="CodeEditor"]:visible', {
|
|
has: page.locator('.CodeMirror-activeline'),
|
|
});
|
|
|
|
await page.getByRole('button', { name: 'Create' }).click();
|
|
|
|
const text = await loadFixture('grpc.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('CollectionPreRelease gRPCjust now').click();
|
|
|
|
await page.getByRole('button', { name: 'Route Guide Example' }).click();
|
|
|
|
await page.getByRole('button', { name: 'UnaryWithOutProtoFile' }).click();
|
|
await expect(page.getByRole('button', { name: 'Select Method' })).toBeDisabled();
|
|
await page.getByTestId('button-server-reflection').click();
|
|
|
|
await page.getByRole('button', { name: 'Select Method' }).click();
|
|
await page.getByRole('menuitem', { name: 'RouteGuide/GetFeature' }).click();
|
|
|
|
await page.getByRole('tab', { name: 'Unary' }).click();
|
|
await page.getByRole('button', { name: 'Send' }).click();
|
|
|
|
// Check for the single Unary response
|
|
await page.getByRole('tab', { name: 'Response 1' }).click();
|
|
await expect(statusTag).toContainText('0 OK');
|
|
await expect(responseBody).toContainText('Berkshire Valley Management Area Trail');
|
|
});
|