diff --git a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js index 7cc2fe2ab..fdde75182 100644 --- a/packages/bruno-app/src/components/Sidebar/NewRequest/index.js +++ b/packages/bruno-app/src/components/Sidebar/NewRequest/index.js @@ -334,79 +334,84 @@ const NewRequest = ({ collectionUid, item, isEphemeral, onClose }) => { Type -
-
- - -
- -
- - -
- - {isGrpcEnabled && ( +
+
-
- )} - - {isWsEnabled && (
-
- )} +
-
- - +
+ {isGrpcEnabled && ( +
+ + +
+ )} + + {isWsEnabled && ( +
+ + +
+ )} +
+ +
+
+ + +
diff --git a/tests/websockets/lib/locators.ts b/tests/utils/page/locators.ts similarity index 92% rename from tests/websockets/lib/locators.ts rename to tests/utils/page/locators.ts index 2653897dd..b0f392cd7 100644 --- a/tests/websockets/lib/locators.ts +++ b/tests/utils/page/locators.ts @@ -1,6 +1,6 @@ import { Page } from '../../../playwright'; -export const buildCommonLocators = (page: Page) => ({ +export const buildWebsocketCommonLocators = (page: Page) => ({ runner: () => page.getByTestId('run-button'), saveButton: () => page .locator('.infotip') diff --git a/tests/websockets/connection.spec.ts b/tests/websockets/connection.spec.ts index b78cd2363..6e7fcd16a 100644 --- a/tests/websockets/connection.spec.ts +++ b/tests/websockets/connection.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from '../../playwright'; -import { buildCommonLocators } from './lib/locators'; +import { buildWebsocketCommonLocators } from '../utils/page/locators'; const MAX_CONNECTION_TIME = 3000; const BRU_FILE_NAME = /^ws-test-request$/; @@ -12,7 +12,7 @@ test.describe.serial('websockets', () => { }); test('websocket connects', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); await page.getByTitle(BRU_FILE_NAME).click(); await locators.connectionControls.connect().click(); @@ -23,14 +23,14 @@ test.describe.serial('websockets', () => { }); test('websocket closes', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); await locators.connectionControls.disconnect().click(); await expect(locators.connectionControls.connect()).toBeVisible(); }); test('websocket messages were recorded', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); const messages = await locators.messages(); @@ -39,7 +39,7 @@ test.describe.serial('websockets', () => { }); test('websocket messages sorting can be changed', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); await locators.toolbar.latestLast().click(); @@ -54,7 +54,7 @@ test.describe.serial('websockets', () => { }); test('websocket request can send messages', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); await locators.toolbar.clearResponse().click(); await locators.runner().click(); diff --git a/tests/websockets/headers.spec.ts b/tests/websockets/headers.spec.ts index 9a8459fe1..638851492 100644 --- a/tests/websockets/headers.spec.ts +++ b/tests/websockets/headers.spec.ts @@ -1,11 +1,11 @@ import { test, expect } from '../../playwright'; -import { buildCommonLocators } from './lib/locators'; +import { buildWebsocketCommonLocators } from '../utils/page/locators'; const BRU_FILE_NAME = /^ws-test-request-with-headers$/; test.describe.serial('headers', () => { test('headers are returned if passed', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); await page.locator('#sidebar-collection-name').click(); await page.getByTitle(BRU_FILE_NAME).click(); diff --git a/tests/websockets/persistence.spec.ts b/tests/websockets/persistence.spec.ts index 85de63c9c..d81592d4f 100644 --- a/tests/websockets/persistence.spec.ts +++ b/tests/websockets/persistence.spec.ts @@ -1,5 +1,5 @@ import { expect, Locator, test } from '../../playwright'; -import { buildCommonLocators } from './lib/locators'; +import { buildWebsocketCommonLocators } from '../utils/page/locators'; import { readFile, writeFile } from 'fs/promises'; import { join } from 'path'; @@ -33,7 +33,7 @@ test.describe.serial('persistence', () => { test('save new websocket url', async ({ pageWithUserData: page }) => { const replacementUrl = 'ws://localhost:8082'; - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); const unsavedColor = '#d97706'; const getSaveSvg = () => locators.saveButton().evaluate((d) => d.querySelector('svg')); diff --git a/tests/websockets/subproto.spec.ts b/tests/websockets/subproto.spec.ts index 5b845f035..bd77dcfe3 100644 --- a/tests/websockets/subproto.spec.ts +++ b/tests/websockets/subproto.spec.ts @@ -1,11 +1,11 @@ import { test, expect } from '../../playwright'; -import { buildCommonLocators } from './lib/locators'; +import { buildWebsocketCommonLocators } from '../utils/page/locators'; const BRU_FILE_NAME = /^ws-test-request-with-subproto$/; test.describe.serial('headers', () => { test('headers are returned if passed', async ({ pageWithUserData: page, restartApp }) => { - const locators = buildCommonLocators(page); + const locators = buildWebsocketCommonLocators(page); const clearText = async (text: string) => { for (let i = text.length; i > 0; i--) { await page.keyboard.press('Backspace');