From 95c75c90c14efa2d3837407899788e339b851c5b Mon Sep 17 00:00:00 2001 From: sharan-bruno Date: Tue, 9 Jun 2026 10:04:32 +0530 Subject: [PATCH] fix(tests): update timeline item locators and improve response status code assertion (#8202) --- .../ResponsePane/Timeline/TimelineItem/index.js | 1 + .../src/components/ResponsePane/Timeline/index.js | 8 ++++---- .../auth-mode/folder-no-auth-stops-inheritance.spec.ts | 2 +- tests/utils/page/locators.ts | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/index.js b/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/index.js index 65fd87e1d..55a0273b9 100644 --- a/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/index.js +++ b/packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/index.js @@ -145,6 +145,7 @@ const TimelineItem = ({ aria-expanded={isExpanded} onClick={toggleExpand} onKeyDown={handleRowKeyDown} + data-testid="timeline-item-header" >
{isExpanded ? : } diff --git a/packages/bruno-app/src/components/ResponsePane/Timeline/index.js b/packages/bruno-app/src/components/ResponsePane/Timeline/index.js index 8a5a7a6ef..91c72e0ae 100644 --- a/packages/bruno-app/src/components/ResponsePane/Timeline/index.js +++ b/packages/bruno-app/src/components/ResponsePane/Timeline/index.js @@ -109,7 +109,7 @@ const Timeline = ({ collection, item }) => { if (isGrpcRequest) { return ( -
+
{ } return ( -
+
{ if (entry.type === 'oauth2' && entry._oauth2Child) { return ( -
+
{ if (entry.type === 'scripted-request') { return ( -
+
{ - await expect(locators.response.statusCode()).toContainText('401'); + await expect(locators.response.statusCode()).toContainText('401 Unauthorized'); }); await test.step('Open the latest timeline entry and verify no Authorization header was sent', async () => { diff --git a/tests/utils/page/locators.ts b/tests/utils/page/locators.ts index 4056cf0b0..5aed3501e 100644 --- a/tests/utils/page/locators.ts +++ b/tests/utils/page/locators.ts @@ -130,9 +130,9 @@ export const buildCommonLocators = (page: Page) => ({ jsonTreeLine: () => page.locator('.response-pane .object-content') }, timeline: { - items: () => page.locator('.timeline-item'), - lastItem: () => page.locator('.timeline-item').last(), - itemHeader: (item: Locator) => item.locator('.oauth-request-item-header'), + items: () => page.getByTestId('timeline-item'), + lastItem: () => page.getByTestId('timeline-item').last(), + itemHeader: (item: Locator) => item.getByTestId('timeline-item-header'), clearButton: () => page.getByRole('button', { name: 'Clear Timeline' }) }, plusMenu: {