Files
bruno/tests/collection/create/create-collection.spec.ts
gopu-bruno 476d30a49e feat: replace send button with Send/Cancel buttons on request url (#7675)
* feat: replace request send icon with Send/Cancel buttons

---------

Co-authored-by: naman-bruno <naman@usebruno.com>
2026-04-07 13:42:09 +05:30

34 lines
1.3 KiB
TypeScript

import { test, expect } from '../../../playwright';
import { closeAllCollections, createCollection, createRequest } from '../../utils/page';
test.describe('Create collection', () => {
test.afterEach(async ({ page }) => {
// cleanup: close all collections
await closeAllCollections(page);
});
test('Create collection and add a simple HTTP request', async ({ page, createTmpDir }) => {
const collectionName = 'test-collection';
const requestName = 'ping';
await createCollection(page, collectionName, await createTmpDir(collectionName));
// Create a new request using the dialog/modal flow
await createRequest(page, requestName, collectionName);
// Set the URL
await page.locator('#request-url .CodeMirror').click();
await page.locator('#request-url').locator('textarea').fill('http://localhost:8081');
await page.locator('#request-actions').getByTitle('Save Request').click();
// Send a request
await page.locator('#request-url .CodeMirror').click();
await page.locator('#request-url').locator('textarea').fill('/ping');
await page.locator('#request-actions').getByTitle('Save Request').click();
await page.getByTestId('send-arrow-icon').click();
// Verify the response
await expect(page.getByRole('main')).toContainText('200 OK');
});
});