Repository navigation
fix(ws): keep body-mode dropdown above collapsed sticky headers #8622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bijin-bruno
merged 6 commits into
usebruno:main
from
pooja-bruno:fix/ws-message-sticky-header-dropdown-overlap
Jul 15, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2553e9e
fix(ws): keep body-mode dropdown above collapsed sticky headers
pooja-bruno 9545a83
Merge branch 'main' into fix/ws-message-sticky-header-dropdown-overlap
pooja-bruno b0aa7c3
fix
pooja-bruno 9f3d7ed
add: test
pooja-bruno 085bd8c
rm: only
pooja-bruno 828f79c
improvement
pooja-bruno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { Page } from '../../../playwright'; | ||
|
|
||
| export const buildWebsocketCommonLocators = (page: Page) => ({ | ||
| connectionControls: { | ||
| connect: () => page.getByTestId('ws-connect-button'), | ||
| disconnect: () => page.getByTestId('ws-disconnect-button') | ||
| }, | ||
| messages: () => page.locator('.ws-message'), | ||
| message: { | ||
| container: () => page.getByTestId('ws-messages-container'), | ||
| addButton: () => page.getByTestId('ws-add-message'), | ||
| headers: () => page.getByTestId(/^ws-message-header-/), | ||
| header: (index: number) => page.getByTestId(`ws-message-header-${index}`), | ||
| body: (index: number) => page.getByTestId(`ws-message-body-${index}`), | ||
| editor: (index: number) => page.getByTestId(`ws-message-body-${index}`).locator('.CodeMirror'), | ||
| editorPlaceholder: (index: number) => | ||
| page.getByTestId(`ws-message-body-${index}`).locator('.CodeMirror-placeholder'), | ||
| editorCode: (index: number) => page.getByTestId(`ws-message-body-${index}`).locator('.CodeMirror-code'), | ||
| labels: () => page.getByTestId(/^ws-message-label-/), | ||
| label: (index: number) => page.getByTestId(`ws-message-label-${index}`), | ||
| nameInputs: () => page.getByTestId(/^ws-message-name-input-/), | ||
| nameInput: (index: number) => page.getByTestId(`ws-message-name-input-${index}`), | ||
| nameTooltip: () => page.getByTestId('ws-message-name-tooltip'), | ||
| prettifyAll: () => page.getByTestId('ws-prettify-all'), | ||
| sendButton: (index: number) => page.getByTestId(`ws-send-msg-${index}`), | ||
| deleteButton: (index: number) => page.getByTestId(`ws-delete-msg-${index}`), | ||
| bodyModeSelector: (index: number) => | ||
| page.getByTestId(`ws-message-header-${index}`).getByTestId('ws-body-mode-selector'), | ||
| bodyModeLabel: (index: number) => | ||
| page.getByTestId(`ws-message-header-${index}`).getByTestId('ws-body-mode-label'), | ||
| bodyModeItem: (mode: 'json' | 'xml' | 'text') => page.getByTestId(`ws-body-mode-item-${mode}`) | ||
| }, | ||
| toolbar: { | ||
| latestFirst: () => page.getByRole('button', { name: 'Latest First' }), | ||
| latestLast: () => page.getByRole('button', { name: 'Latest Last' }), | ||
| clearResponse: () => page.getByTestId('response-clear-btn') | ||
| } | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| import { expect, test } from '../../playwright'; | ||
| import { closeAllTabs, createTransientRequest, elementIsInsideDropdown, selectRequestPaneTab } from '../utils/page/actions'; | ||
| import { buildCommonLocators } from '../utils/page/locators'; | ||
|
|
||
| test.describe('websocket sticky header dropdown overlap', () => { | ||
| test.afterEach(async ({ page }) => { | ||
| await closeAllTabs(page); | ||
| }); | ||
|
|
||
| test('body-mode dropdown of an upper message renders above the collapsed headers below it', async ({ | ||
| page | ||
| }) => { | ||
| const { websocket } = buildCommonLocators(page); | ||
|
|
||
| await test.step('Open a websocket request with several collapsed messages', async () => { | ||
| await createTransientRequest(page, { requestType: 'WebSocket' }); | ||
| await selectRequestPaneTab(page, 'Message'); | ||
|
|
||
| await expect(websocket.message.headers()).toHaveCount(1); | ||
| for (let i = 0; i < 3; i++) { | ||
| const before = await websocket.message.headers().count(); | ||
| await websocket.message.addButton().click(); | ||
| await expect(websocket.message.headers()).toHaveCount(before + 1); | ||
| } | ||
|
|
||
| const total = await websocket.message.headers().count(); | ||
| expect(total).toBeGreaterThanOrEqual(4); | ||
|
|
||
| // Collapse every message so all accordions are closed. | ||
| for (let i = 0; i < total; i++) { | ||
| if (await websocket.message.body(i).isVisible()) { | ||
| await websocket.message.header(i).click(); | ||
| } | ||
| } | ||
| for (let i = 0; i < total; i++) { | ||
| await expect(websocket.message.body(i)).toBeHidden(); | ||
| } | ||
| }); | ||
|
|
||
| const textItem = websocket.message.bodyModeItem('text'); | ||
|
|
||
| await test.step('Open the first message dropdown over the headers below', async () => { | ||
| await websocket.message.bodyModeSelector(0).click(); | ||
|
|
||
| // The lowest item is the one most likely to overlap the header below, so | ||
| // it is the strongest signal that the menu is not covered. | ||
| await expect(textItem).toBeVisible(); | ||
|
|
||
| // The item must be the topmost element at its own centre. Without the fix | ||
| // a lower header paints over it and this resolves to the header instead. | ||
| expect(await elementIsInsideDropdown(textItem)).toBe(true); | ||
| }); | ||
|
|
||
| await test.step('Select the item and verify it applies', async () => { | ||
| // Playwright's actionability check fails if the item is obscured. | ||
| await textItem.click(); | ||
| await expect(websocket.message.bodyModeLabel(0)).toContainText('TEXT'); | ||
| }); | ||
| }); | ||
|
|
||
| test('open dropdown stays on top when a lower message header is hovered', async ({ | ||
| page | ||
| }) => { | ||
| const { websocket } = buildCommonLocators(page); | ||
| let total = 0; | ||
|
|
||
| await test.step('Open a websocket request with several collapsed messages', async () => { | ||
| await createTransientRequest(page, { requestType: 'WebSocket' }); | ||
| await selectRequestPaneTab(page, 'Message'); | ||
|
|
||
| await expect(websocket.message.headers()).toHaveCount(1); | ||
| for (let i = 0; i < 3; i++) { | ||
| const before = await websocket.message.headers().count(); | ||
| await websocket.message.addButton().click(); | ||
| await expect(websocket.message.headers()).toHaveCount(before + 1); | ||
| } | ||
|
|
||
| total = await websocket.message.headers().count(); | ||
| expect(total).toBeGreaterThanOrEqual(4); | ||
|
|
||
| // Collapse every message so all accordions are closed. | ||
| for (let i = 0; i < total; i++) { | ||
| if (await websocket.message.body(i).isVisible()) { | ||
| await websocket.message.header(i).click(); | ||
| } | ||
| } | ||
| for (let i = 0; i < total; i++) { | ||
| await expect(websocket.message.body(i)).toBeHidden(); | ||
| } | ||
| }); | ||
|
|
||
| const textItem = websocket.message.bodyModeItem('text'); | ||
|
|
||
| await test.step('Open the first message dropdown, then hover a header below it', async () => { | ||
| // The dropdown renders in a portal (appendTo document.body), so hovering a | ||
| // lower header must not raise that header over the open menu. | ||
| await websocket.message.bodyModeSelector(0).click(); | ||
| await expect(textItem).toBeVisible(); | ||
|
|
||
| // Hover the last message's header — the one furthest under the open menu. | ||
| await websocket.message.header(total - 1).hover(); | ||
| }); | ||
|
|
||
| await test.step('Dropdown stays on top and is still clickable', async () => { | ||
| expect(await elementIsInsideDropdown(textItem)).toBe(true); | ||
| await textItem.click(); | ||
| await expect(websocket.message.bodyModeLabel(0)).toContainText('TEXT'); | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.