mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
* fix: reverted the easy creation flow to the old, modal based approach * fix: updated the tests to use the old createRequest action and removed the usage of createUntitledRequest * removed safe mode selection after collection open
41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
import { test, expect } from '../../playwright';
|
|
import { closeAllCollections, createCollection, createRequest } from '../utils/page/actions';
|
|
|
|
test.describe('Large Response Crash/High Memory Usage Prevention', () => {
|
|
// Increase timeout to 1 minute for all tests in this describe block, default is 30 seconds.
|
|
// Prevents tests from failing due to timeout while waiting for the response, especially on slower internet connections.
|
|
test.setTimeout(1 * 60 * 1000); // 1 minute
|
|
|
|
test.afterAll(async ({ page }) => {
|
|
// cleanup: close all collections
|
|
await closeAllCollections(page);
|
|
});
|
|
|
|
test('Show appropriate warning for responses over 10MB', async ({ page, createTmpDir }) => {
|
|
const collectionName = 'size-warning-test';
|
|
const requestName = 'large-response';
|
|
|
|
// Create collection (auto-opens the collection)
|
|
await createCollection(page, collectionName, await createTmpDir(collectionName));
|
|
|
|
// Create request using the dialog/modal flow
|
|
await createRequest(page, requestName, collectionName, {
|
|
url: 'https://samples.json-format.com/employees/json/employees_50MB.json'
|
|
});
|
|
|
|
// Send request
|
|
const sendButton = page.getByTestId('send-arrow-icon');
|
|
await sendButton.click();
|
|
|
|
// Verify warning appears
|
|
await expect(page.getByText('Large Response Warning')).toBeVisible({ timeout: 60000 });
|
|
|
|
// Verify warning content
|
|
await expect(page.getByText('Handling responses over')).toBeVisible();
|
|
await expect(page.getByText('could degrade performance')).toBeVisible();
|
|
|
|
// Verify action button
|
|
await expect(page.getByRole('button', { name: 'View', exact: true })).toBeVisible();
|
|
});
|
|
});
|