diff --git a/packages/bruno-app/src/components/SecuritySettings/JsSandboxMode/index.js b/packages/bruno-app/src/components/SecuritySettings/JsSandboxMode/index.js index 2524f09ef..22d5dfde3 100644 --- a/packages/bruno-app/src/components/SecuritySettings/JsSandboxMode/index.js +++ b/packages/bruno-app/src/components/SecuritySettings/JsSandboxMode/index.js @@ -24,6 +24,7 @@ const JsSandboxMode = ({ collection }) => { {jsSandboxMode === 'safe' && (
@@ -33,6 +34,7 @@ const JsSandboxMode = ({ collection }) => { {jsSandboxMode === 'developer' && (
diff --git a/tests/response/response-actions.spec.ts b/tests/response/response-actions.spec.ts index a6945ee80..73c8b0d08 100644 --- a/tests/response/response-actions.spec.ts +++ b/tests/response/response-actions.spec.ts @@ -18,7 +18,7 @@ test.describe('Response Pane Actions', () => { await test.step('Create collection and request', async () => { await createCollection(page, collectionName, await createTmpDir(collectionName), { openWithSandboxMode: 'safe' }); - await createRequest(page, 'copy-test', collectionName, { url: 'https://httpbin.org/json' }); + await createRequest(page, 'copy-test', collectionName, { url: 'https://testbench-sanity.usebruno.com/ping' }); }); await test.step('Send request and wait for response', async () => { diff --git a/tests/scripting/inbuilt-libraries/fs/init-user-data/preferences.json b/tests/scripting/inbuilt-libraries/fs/init-user-data/preferences.json index 31dc9acc8..f0272aaa3 100644 --- a/tests/scripting/inbuilt-libraries/fs/init-user-data/preferences.json +++ b/tests/scripting/inbuilt-libraries/fs/init-user-data/preferences.json @@ -1,5 +1,5 @@ { - "maximized": true, + "maximized": false, "lastOpenedCollections": [ "{{projectRoot}}/tests/scripting/inbuilt-libraries/fs/fixtures/collections/should_allow_fs", "{{projectRoot}}/tests/scripting/inbuilt-libraries/fs/fixtures/collections/should_disallow_fs" diff --git a/tests/utils/page/runner.ts b/tests/utils/page/runner.ts index c7db38080..88695f162 100644 --- a/tests/utils/page/runner.ts +++ b/tests/utils/page/runner.ts @@ -84,8 +84,7 @@ export const runCollection = async (page: Page, collectionName: string) => { * @returns Object with locators for sandbox elements */ export const buildSandboxLocators = (page: Page) => ({ - developerModeBadge: () => page.locator('.developer-mode').filter({ hasText: 'Developer Mode' }), - safeModeBadge: () => page.locator('.safe-mode').filter({ hasText: 'Safe Mode' }), + sandboxModeSelector: () => page.getByTestId('sandbox-mode-selector'), safeModeRadio: () => page.getByLabel('Safe Mode'), developerModeRadio: () => page.getByLabel('Developer Mode(use only if'), jsSandboxHeading: () => page.getByText('JavaScript Sandbox'), @@ -109,16 +108,10 @@ export const setSandboxMode = async (page: Page, collectionName: string, mode: ' await sidebarCollection.click(); // Check if there's already a mode selected - if so, we need to click the badge to open settings tab - const developerBadgeVisible = await sandboxLocators.developerModeBadge().isVisible().catch(() => false); - const safeBadgeVisible = await sandboxLocators.safeModeBadge().isVisible().catch(() => false); - + const sandboxBadgeVisible = await sandboxLocators.sandboxModeSelector().isVisible().catch(() => false); // If a badge exists, click it to open the security settings tab - if (developerBadgeVisible || safeBadgeVisible) { - if (developerBadgeVisible) { - await sandboxLocators.developerModeBadge().click(); - } else { - await sandboxLocators.safeModeBadge().click(); - } + if (sandboxBadgeVisible) { + await sandboxLocators.sandboxModeSelector().click(); // Wait for the security settings tab to be active await sandboxLocators.jsSandboxHeading().waitFor({ state: 'visible', timeout: 10000 });