Files
bruno/tests/environments/multiline-variables/read-multiline-environment.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

36 lines
1.6 KiB
TypeScript

import { test, expect } from '../../../playwright';
test.describe('Multiline Variables - Read Environment Test', () => {
test('should read existing multiline environment variables', async ({ pageWithUserData: page }) => {
test.setTimeout(30 * 1000);
// open the collection
const collection = page.getByTestId('collections').locator('#sidebar-collection-name').filter({ hasText: 'multiline-variables' });
await expect(collection).toBeVisible();
await collection.click();
// open request
await expect(page.getByTitle('request', { exact: true })).toBeVisible();
await page.getByTitle('request', { exact: true }).click();
// open environment dropdown
await page.locator('div.current-environment').click();
// select test environment
await expect(page.locator('.dropdown-item').filter({ hasText: 'Test' })).toBeVisible();
await page.locator('.dropdown-item').filter({ hasText: 'Test' }).click();
await expect(page.locator('.current-environment').filter({ hasText: /Test/ })).toBeVisible();
// send request
const sendButton = page.getByTestId('send-arrow-icon');
await expect(sendButton).toBeVisible();
await sendButton.click();
await expect(page.locator('.response-status-code.text-ok')).toBeVisible();
await expect(page.locator('.response-status-code')).toContainText('200');
// response pane should contain the expected multiline text in JSON body
const responsePane = page.locator('.response-pane');
await expect(responsePane).toContainText('"body": "https://www.httpfaker.org\\nline1\\nline2\\nline3"');
});
});