mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 22:45:25 +00:00
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:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user