fix(tests): update openFolderRequest function for tests (#8506)

* fix(tests): update openFolderRequest function for tests

* fix: update imports for openFolderRequest

---------

Co-authored-by: shubh-bruno <shubh-bruno@shubh-bruno.local>
This commit is contained in:
shubh-bruno
2026-07-07 19:52:12 +05:30
committed by GitHub
parent 2cc382538d
commit 707489ef77
3 changed files with 20 additions and 29 deletions

View File

@@ -1,27 +1,8 @@
import { test, expect, Page } from '../../playwright';
import { buildScriptErrorLocators, buildCommonLocators } from '../utils/page/locators';
import { openRequest, closeAllTabs, sendAndWaitForErrorCard, sendAndWaitForResponse } from '../utils/page/actions';
import { openRequest, closeAllTabs, sendAndWaitForErrorCard, sendAndWaitForResponse, openFolderRequest } from '../utils/page/actions';
import { setSandboxMode, runCollection } from '../utils/page/runner';
/**
* Helper: expand a folder in the sidebar and open a nested request.
* Clicking the collection row is idempotent (only expands, never collapses).
* Clicking the folder row is idempotent (only expands, never collapses).
*/
const openFolderRequest = async (page: Page, collectionName: string, folderName: string, requestName: string) => {
await test.step(`Open folder request "${requestName}" in "${folderName}"`, async () => {
const { sidebar, tabs } = buildCommonLocators(page);
await sidebar.collectionRow(collectionName).click();
const folder = sidebar.folder(folderName);
await folder.waitFor({ state: 'visible' });
await folder.click();
const request = sidebar.request(requestName);
await request.waitFor({ state: 'visible' });
await request.click();
await expect(tabs.activeRequestTab()).toContainText(requestName);
});
};
for (const mode of ['safe', 'developer'] as const) {
test.describe.serial(`Script Error Display [${mode} mode]`, () => {
let scriptErrorLocators: ReturnType<typeof buildScriptErrorLocators>;