Files
bruno/tests/request/timeline/timeline-runrequest-skip.spec.ts
Pooja 59b4a16b79 fix(timeline): scope scripted requests to their own request (#8210)
* fix(timeline): scope scripted requests to their own request

* fix: oauth playwright test
2026-06-11 15:10:57 +05:30

55 lines
2.1 KiB
TypeScript

import { test, expect } from '../../../playwright';
import {
closeAllCollections,
createCollection,
createRequest,
openRequest,
addPreRequestScript,
saveRequest,
sendRequest,
selectResponsePaneTab
} from '../../utils/page/actions';
test.describe('Timeline — bru.runRequest skips unsupported item types', () => {
test.afterEach(async ({ page }) => {
await closeAllCollections(page);
});
test('shows Skipped rows for WS and gRPC targets', async ({ page, createTmpDir }) => {
const collectionName = 'runrequest-skip';
const driver = 'driver';
await test.step('Create collection with HTTP driver + WS and gRPC targets', async () => {
await createCollection(page, collectionName, await createTmpDir(collectionName));
await createRequest(page, driver, collectionName, { url: 'http://localhost:8081/ping' });
await createRequest(page, 'ws-target', collectionName, { url: 'ws://localhost:8081/ws', requestType: 'ws' });
await createRequest(page, 'grpc-target', collectionName, { url: 'grpc://localhost:50051', requestType: 'grpc' });
});
await test.step('Pre-request script calls bru.runRequest on both unsupported targets', async () => {
await openRequest(page, collectionName, driver);
await addPreRequestScript(
page,
`await bru.runRequest("ws-target");\nawait bru.runRequest("grpc-target");`
);
await saveRequest(page);
});
await test.step('Send driver request', async () => {
await sendRequest(page, 200);
});
await test.step('Timeline has main + two Skipped runRequest rows', async () => {
await selectResponsePaneTab(page, 'Timeline');
const rows = page.getByTestId('timeline-container').getByTestId('timeline-entry');
await expect(rows).toHaveCount(3);
const skippedRows = rows.filter({ has: page.getByTestId('timeline-badge-post') });
await expect(skippedRows).toHaveCount(2);
await expect(skippedRows.nth(0).getByTestId('timeline-status')).toContainText('Skipped');
await expect(skippedRows.nth(1).getByTestId('timeline-status')).toContainText('Skipped');
});
});
});