insomnia/packages/insomnia-smoke-test/tests/smoke/grpc.test.ts
James Gatz 29acc92559
Improve import UX (#5869)
* add import routes and modal

* fix paths

* fix paths

* save

* remove import.ts

* ui

* save

* fix tests

* fix tests

* fix tests

* remove outdated test

* update import tests

* lint and ts fixes

* add section title and fix some style issues

* close modals on import success

* error handling for empty content

* fix api spec imports

* Simplify importResources function

Co-authored-by: Filipe Freire <filipe.r.freire@gmail.com>

* cleanup

* settings import button styles

* remove comment

* update tests

* comment for app-command imports

* fix test lint error

* update comments

* comment out app/import for now

---------

Co-authored-by: Filipe Freire <filipe.r.freire@gmail.com>
2023-03-31 10:53:22 +00:00

43 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.getByTestId('project').click();
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('button', { name: 'Import' }).click();
await page.getByRole('link', { name: 'Debug' }).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');
});