mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-27 06:34:06 +00:00
* revamp: collection and global env selector dropdown --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Pragadesh-45 <54320162+Pragadesh-45@users.noreply.github.com> Co-authored-by: Anoop M D <anoop.md1421@gmail.com> Co-authored-by: sanish-bruno <sanish@usebruno.com> Co-authored-by: bernborgess <bernborgesse@outlook.com> Co-authored-by: lohit <lohit@usebruno.com> Co-authored-by: Its-Treason <39559178+Its-treason@users.noreply.github.com> Co-authored-by: jayakrishnancn <jayakrishnancn@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
35 lines
1.5 KiB
TypeScript
35 lines
1.5 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
|
|
await expect(page.getByTitle('multiline-variables')).toBeVisible();
|
|
await page.getByTitle('multiline-variables').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.locator('#send-request').getByRole('img').nth(2);
|
|
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"');
|
|
});
|
|
});
|