fix: include request URL in prompt variable extraction and add tests (#6412)

This commit is contained in:
Pragadesh-45
2025-12-15 19:13:33 +05:30
committed by GitHub
parent a769ca3ae4
commit 71cf1a8f26
3 changed files with 4 additions and 2 deletions

View File

@@ -478,6 +478,7 @@ const extractPromptVariablesForRequest = async (item, collection) => {
prompts.push(...extractPromptVariables(headers));
prompts.push(...extractPromptVariables(request.params));
prompts.push(...extractPromptVariables(resolvedAuthRequest.auth));
prompts.push(...extractPromptVariables(request.url));
// Remove duplicates
const uniquePrompts = Array.from(new Set(prompts));

View File

@@ -5,7 +5,7 @@ meta {
}
post {
url: http://localhost:8081/api/echo/json?query={{?Enter Query Variable}}
url: http://localhost:{{?Enter Port Variable}}/api/echo/json?query={{?Enter Query Variable}}
body: json
auth: inherit
}

View File

@@ -32,7 +32,7 @@ test.describe('Prompt Variables Interpolation', () => {
await test.step('Verify duplicate prompt variables are not allowed', async () => {
// Enter the prompt variables
promptInputs = promptVariablesModal.getByTestId('prompt-variable-input-container');
await expect(promptInputs).toHaveCount(11);
await expect(promptInputs).toHaveCount(12);
});
await test.step('Verify disabled / non selected modes prompt variables are not prompted', async () => {
@@ -46,6 +46,7 @@ test.describe('Prompt Variables Interpolation', () => {
});
await test.step('Fill the prompt variables and send the request', async () => {
await promptInputs.filter({ hasText: 'Enter Port Variable' }).locator('input').fill('8081');
await promptInputs.filter({ hasText: 'Enter Query Variable' }).locator('input').fill('queryPromptValue');
await promptInputs.filter({ hasText: 'Enter Body Variable' }).locator('input').fill('bodyPromptValue');
await promptInputs.filter({ hasText: 'Enter Number Variable' }).locator('input').fill('123');