diff --git a/packages/bruno-converters/tests/insomnia/insomnia-collection-v5.spec.js b/packages/bruno-converters/tests/insomnia/insomnia-collection-v5.spec.js index ddf4261b0..e7be6dea8 100644 --- a/packages/bruno-converters/tests/insomnia/insomnia-collection-v5.spec.js +++ b/packages/bruno-converters/tests/insomnia/insomnia-collection-v5.spec.js @@ -24,7 +24,7 @@ collection: modified: 1744194421968 sortKey: -1744194421968 children: - - url: https://httpbin.org/get + - url: https://testbench-sanity.usebruno.com/ping name: Request1 meta: id: req_e9fbdc9c88984068a04f442e052d4ff1 @@ -48,7 +48,7 @@ collection: modified: 1744194421969 sortKey: -1744194421969 children: - - url: https://httpbin.org/get + - url: https://testbench-sanity.usebruno.com/ping name: Request2 meta: id: req_3c572aa26a964f1f800bfa5c53cacb75 @@ -128,7 +128,7 @@ const expectedOutput = { "headers": [], "method": "GET", "params": [], - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping" }, "seq": 1, "type": "http-request", @@ -164,7 +164,7 @@ const expectedOutput = { "headers": [], "method": "GET", "params": [], - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping" }, "seq": 1, "type": "http-request", diff --git a/packages/bruno-converters/tests/insomnia/insomnia-collection.spec.js b/packages/bruno-converters/tests/insomnia/insomnia-collection.spec.js index 2b1ff40ca..15553aa2e 100644 --- a/packages/bruno-converters/tests/insomnia/insomnia-collection.spec.js +++ b/packages/bruno-converters/tests/insomnia/insomnia-collection.spec.js @@ -21,7 +21,7 @@ const insomniaCollection = { "parentId": "fld_1", "name": "Request1", "method": "GET", - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping", "settingEncodeUrl": false, "parameters": [] }, @@ -31,7 +31,7 @@ const insomniaCollection = { "parentId": "fld_2", "name": "Request2", "method": "GET", - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping", "settingEncodeUrl": true, "parameters": [] }, @@ -109,7 +109,7 @@ const expectedOutput = { "headers": [], "method": "GET", "params": [], - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping" }, "seq": 1, "type": "http-request", @@ -138,7 +138,7 @@ const expectedOutput = { "headers": [], "method": "GET", "params": [], - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping" }, "seq": 2, "type": "http-request", @@ -174,7 +174,7 @@ const expectedOutput = { "headers": [], "method": "GET", "params": [], - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping" }, "seq": 1, "type": "http-request", @@ -203,7 +203,7 @@ const expectedOutput = { "headers": [], "method": "GET", "params": [], - "url": "https://httpbin.org/get", + "url": "https://testbench-sanity.usebruno.com/ping" }, "seq": 2, "type": "http-request", diff --git a/packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-to-bruno.spec.js b/packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-to-bruno.spec.js index 91ff66460..717e9cace 100644 --- a/packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-to-bruno.spec.js +++ b/packages/bruno-converters/tests/openapi/openapi-to-bruno/openapi-to-bruno.spec.js @@ -269,7 +269,7 @@ components: type: "string" default: "value2" servers: - - url: "https://httpbin.org" + - url: "https://echo.usebruno.com" `; const expectedOutput = { @@ -284,7 +284,7 @@ const expectedOutput = { "secret": false, "type": "text", "uid": "mockeduuidvalue123456", - "value": "https://httpbin.org", + value: 'https://echo.usebruno.com' }, ], }, diff --git a/packages/bruno-converters/tests/postman/postman-to-bruno/postman-to-bruno.spec.js b/packages/bruno-converters/tests/postman/postman-to-bruno/postman-to-bruno.spec.js index 953f678e1..926ac706f 100644 --- a/packages/bruno-converters/tests/postman/postman-to-bruno/postman-to-bruno.spec.js +++ b/packages/bruno-converters/tests/postman/postman-to-bruno/postman-to-bruno.spec.js @@ -113,9 +113,9 @@ describe('postman-collection', () => { method: 'GET', header: [], url: { - raw: 'https://httpbin.org/get', + raw: 'https://echo.usebruno.com/get', protocol: 'https', - host: ['httpbin', 'org'], + host: ['echo', 'usebruno', 'com'], path: ['get'] } } @@ -129,9 +129,9 @@ describe('postman-collection', () => { method: 'POST', header: [], url: { - raw: 'https://httpbin.org/post', + raw: 'https://echo.usebruno.com/post', protocol: 'https', - host: ['httpbin', 'org'], + host: ['echo', 'usebruno', 'com'], path: ['post'] } } @@ -142,9 +142,9 @@ describe('postman-collection', () => { method: 'PUT', header: [], url: { - raw: 'https://httpbin.org/put', + raw: 'https://echo.usebruno.com/put', protocol: 'https', - host: ['httpbin', 'org'], + host: ['echo', 'usebruno', 'com'], path: ['put'] } } diff --git a/packages/bruno-tests/collection/request-setting/follow-redirect.bru b/packages/bruno-tests/collection/request-setting/follow-redirect.bru index 065120554..5eae63bad 100644 --- a/packages/bruno-tests/collection/request-setting/follow-redirect.bru +++ b/packages/bruno-tests/collection/request-setting/follow-redirect.bru @@ -5,7 +5,7 @@ meta { } get { - url: https://httpbun.com/redirect/3 + url: {{localhost}}/api/redirect/3 body: none auth: inherit } diff --git a/packages/bruno-tests/collection/request-setting/max-redirect.bru b/packages/bruno-tests/collection/request-setting/max-redirect.bru index 20bcb5678..e749c5497 100644 --- a/packages/bruno-tests/collection/request-setting/max-redirect.bru +++ b/packages/bruno-tests/collection/request-setting/max-redirect.bru @@ -5,7 +5,7 @@ meta { } get { - url: https://httpbun.com/redirect/3 + url: {{localhost}}/api/redirect/3 body: none auth: inherit } diff --git a/packages/bruno-tests/src/redirect/index.js b/packages/bruno-tests/src/redirect/index.js index 4573fdf74..b49e5593b 100644 --- a/packages/bruno-tests/src/redirect/index.js +++ b/packages/bruno-tests/src/redirect/index.js @@ -61,4 +61,68 @@ router.post('/multipart-redirect-target', function (req, res) { }); }); -module.exports = router; \ No newline at end of file +router.get('/anything', function (req, res) { + const { body, files } = parseMultipartFormData(req); + + // Parse query parameters + const args = req.query; + + // Parse form data if present + const form = {}; + if (req.headers['content-type'] && req.headers['content-type'].includes('application/x-www-form-urlencoded')) { + Object.assign(form, req.body); + } + + // Get origin IP + const origin = req.ip || req.connection.remoteAddress || req.socket.remoteAddress; + + // Parse JSON body if present + let json = null; + let data = ''; + if (req.headers['content-type'] && req.headers['content-type'].includes('application/json')) { + try { + json = typeof req.body === 'string' ? JSON.parse(req.body) : req.body; + data = typeof req.body === 'string' ? req.body : JSON.stringify(req.body); + } catch (e) { + data = typeof req.body === 'string' ? req.body : JSON.stringify(req.body); + } + } else if (req.body) { + data = typeof req.body === 'string' ? req.body : JSON.stringify(req.body); + } + + res.json({ + method: req.method, + args: args, + headers: req.headers, + origin: origin, + url: req.url, + form: form, + data: data, + json: json, + files: files + }); +}); + +router.get('/:count', function (req, res) { + const count = parseInt(req.params.count, 10); + + if (count > 1) { + // Redirect to the next redirect in the chain + const nextCount = count - 1; + res.status(302).set('Location', `/api/redirect/${nextCount}`).send(` + Redirecting... +

Redirecting...

+

You should be redirected automatically to target URL: ${nextCount}. If not click the link.

+ `); + } else { + res.status(302) + .set('Location', '/api/redirect/anything') + .send(` + Redirecting... +

Redirecting...

+

You should be redirected automatically to target URL: ../anything. If not click the link.

+ `); + } +}); + +module.exports = router; diff --git a/tests/collection/create-requests/http-requests.spec.ts b/tests/collection/create-requests/http-requests.spec.ts index 146bffbd4..6c53e4bcc 100644 --- a/tests/collection/create-requests/http-requests.spec.ts +++ b/tests/collection/create-requests/http-requests.spec.ts @@ -38,7 +38,7 @@ test.describe('Create HTTP Requests', () => { await page.getByTestId('request-name').fill('Root HTTP Request'); await page.getByTestId('new-request-url').locator('.CodeMirror').click(); - await page.keyboard.type('https://httpbin.org/get'); + await page.keyboard.type('https://echo.usebruno.com'); await locators.modal.button('Create').click(); }); @@ -65,7 +65,7 @@ test.describe('Create HTTP Requests', () => { await page.getByTestId('request-name').fill('Folder HTTP Request'); await page.getByTestId('new-request-url').locator('.CodeMirror').click(); - await page.keyboard.type('https://httpbin.org/post'); + await page.keyboard.type('https://echo.usebruno.com'); await locators.modal.button('Create').click(); }); diff --git a/tests/collection/moving-requests/cross-collection-drag-drop-folder.spec.ts b/tests/collection/moving-requests/cross-collection-drag-drop-folder.spec.ts index 3e52a4cfa..30d384d15 100644 --- a/tests/collection/moving-requests/cross-collection-drag-drop-folder.spec.ts +++ b/tests/collection/moving-requests/cross-collection-drag-drop-folder.spec.ts @@ -42,7 +42,7 @@ test.describe('Cross-Collection Drag and Drop for folder', () => { await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click(); await page.getByPlaceholder('Request Name').fill('test-request-in-folder'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); // Wait for the request to be created @@ -162,7 +162,7 @@ test.describe('Cross-Collection Drag and Drop for folder', () => { await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click(); await page.getByPlaceholder('Request Name').fill('http-request'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); // Expand the folder to see the request inside await page.locator('.collection-item-name').filter({ hasText: 'folder-1' }).click(); diff --git a/tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts b/tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts index 78e6bf25f..390a17fc0 100644 --- a/tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts +++ b/tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts @@ -24,7 +24,7 @@ test.describe('Cross-Collection Drag and Drop', () => { await page.locator('#create-new-tab').getByRole('img').click(); await page.getByPlaceholder('Request Name').fill('test-request'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); await expect(page.locator('.collection-item-name').filter({ hasText: 'test-request' })).toBeVisible(); @@ -99,7 +99,7 @@ test.describe('Cross-Collection Drag and Drop', () => { await page.locator('#create-new-tab').getByRole('img').click(); await page.getByPlaceholder('Request Name').fill('request-1'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); // check if request-1 is created and visible in sidebar @@ -122,7 +122,7 @@ test.describe('Cross-Collection Drag and Drop', () => { await page.locator('#create-new-tab').getByRole('img').click(); await page.getByPlaceholder('Request Name').fill('request-1'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/post'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); // Go back to source collection to drag the request diff --git a/tests/collection/moving-tabs/move-tabs.spec.ts b/tests/collection/moving-tabs/move-tabs.spec.ts index 52a3eccae..8a590e0c6 100644 --- a/tests/collection/moving-tabs/move-tabs.spec.ts +++ b/tests/collection/moving-tabs/move-tabs.spec.ts @@ -47,7 +47,7 @@ test.describe('Move tabs', () => { await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click(); await page.getByPlaceholder('Request Name').fill('test-request'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); // Wait for the request to be created @@ -135,7 +135,7 @@ test.describe('Move tabs', () => { await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click(); await page.getByPlaceholder('Request Name').fill('test-request'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); // Wait for the request to be created diff --git a/tests/import/openapi/fixtures/openapi-simple.json b/tests/import/openapi/fixtures/openapi-simple.json index 9aaa873e8..d57daee41 100644 --- a/tests/import/openapi/fixtures/openapi-simple.json +++ b/tests/import/openapi/fixtures/openapi-simple.json @@ -7,8 +7,8 @@ }, "servers": [ { - "url": "https://httpbin.org", - "description": "HTTPBin test server" + "url": "https://echo.usebruno.com", + "description": "Echo test server" } ], "paths": { diff --git a/tests/request/collections/custom-search/search-request.bru b/tests/request/collections/custom-search/search-request.bru index 2285feda4..719cd1d7a 100644 --- a/tests/request/collections/custom-search/search-request.bru +++ b/tests/request/collections/custom-search/search-request.bru @@ -5,7 +5,7 @@ meta { } get { - url: https://httpbin.org/get + url: https://echo.usebruno.com body: none auth: inherit } diff --git a/tests/request/copy-request/copy-request.spec.ts b/tests/request/copy-request/copy-request.spec.ts index 041fd404a..f6d2e5713 100644 --- a/tests/request/copy-request/copy-request.spec.ts +++ b/tests/request/copy-request/copy-request.spec.ts @@ -16,7 +16,7 @@ test.describe('Copy and Paste Requests', () => { await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click(); await page.getByPlaceholder('Request Name').fill('original-request'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); await expect(page.locator('.collection-item-name').filter({ hasText: 'original-request' })).toBeVisible(); diff --git a/tests/request/save/save.spec.ts b/tests/request/save/save.spec.ts index fbd74ea0c..3cd18df30 100644 --- a/tests/request/save/save.spec.ts +++ b/tests/request/save/save.spec.ts @@ -24,7 +24,7 @@ const setup = async (page: Page, createTmpDir: (tag?: string | undefined) => Pro await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click(); await page.getByPlaceholder('Request Name').fill('test-request'); await page.locator('#new-request-url .CodeMirror').click(); - await page.locator('textarea').fill('https://httpbin.org/get'); + await page.locator('textarea').fill('https://echo.usebruno.com'); await page.getByRole('button', { name: 'Create' }).click(); await expect(page.locator('.collection-item-name').filter({ hasText: 'test-request' })).toBeVisible(); }; @@ -39,7 +39,7 @@ test.describe.serial('save requests', () => { await setup(page, createTmpDir); const locators = buildCommonLocators(page); - const originalUrl = 'https://httpbin.org/get'; + const originalUrl = 'https://echo.usebruno.com'; const replacementUrl = 'ws://localhost:8082'; const clearText = async (text: string) => { diff --git a/tests/request/settings/collection/max-redirects.bru b/tests/request/settings/collection/max-redirects.bru index a041ff519..533bfb12c 100644 --- a/tests/request/settings/collection/max-redirects.bru +++ b/tests/request/settings/collection/max-redirects.bru @@ -5,7 +5,7 @@ meta { } get { - url: https://httpbun.com/redirect/2 + url: http://localhost:8081/api/redirect/2 body: none auth: inherit } diff --git a/tests/request/settings/collection/no-redirects.bru b/tests/request/settings/collection/no-redirects.bru index b5c824d43..f60b8940a 100644 --- a/tests/request/settings/collection/no-redirects.bru +++ b/tests/request/settings/collection/no-redirects.bru @@ -5,7 +5,7 @@ meta { } get { - url: https://httpbun.com/redirect/2 + url: http://localhost:8081/api/redirect/2 body: none auth: inherit } diff --git a/tests/runner/collection-run-report/collection/api/v1/posts.bru b/tests/runner/collection-run-report/collection/api/v1/posts.bru index 93891b857..a3e7a7dde 100644 --- a/tests/runner/collection-run-report/collection/api/v1/posts.bru +++ b/tests/runner/collection-run-report/collection/api/v1/posts.bru @@ -4,9 +4,9 @@ meta { seq: 2 } -get { - url: https://httpbin.org/uuid - body: none +post { + url: https://echo.usebruno.com + body: json auth: none } @@ -14,6 +14,12 @@ headers { Accept: application/json } +body:json { + { + "uuid": "49889366-72d2-4ba6-a0b7-94de29a04dc4" + } +} + tests { test("This test will fail", function() { expect(res.getStatus()).to.equal(404); // Intentional failure diff --git a/tests/runner/collection-run-report/collection/api/v1/users.bru b/tests/runner/collection-run-report/collection/api/v1/users.bru index f1807c7c0..d91862c5e 100644 --- a/tests/runner/collection-run-report/collection/api/v1/users.bru +++ b/tests/runner/collection-run-report/collection/api/v1/users.bru @@ -4,12 +4,36 @@ meta { seq: 1 } -get { - url: https://httpbin.org/json - body: none +post { + url: https://echo.usebruno.com + body: json auth: none } +body:json { + { + "slideshow": { + "author": "Yours Truly", + "date": "date of publication", + "slides": [ + { + "title": "Wake up to WonderWidgets!", + "type": "all" + }, + { + "items": [ + "Why WonderWidgets are great", + "Who buys WonderWidgets" + ], + "title": "Overview", + "type": "all" + } + ], + "title": "Sample Slide Show" + } + } +} + headers { Accept: application/json } diff --git a/tests/runner/collection-run-report/collection/auth/login.bru b/tests/runner/collection-run-report/collection/auth/login.bru index 34bc8ceb1..f84d92a4d 100644 --- a/tests/runner/collection-run-report/collection/auth/login.bru +++ b/tests/runner/collection-run-report/collection/auth/login.bru @@ -5,7 +5,7 @@ meta { } post { - url: https://httpbin.org/post + url: https://echo.usebruno.com body: json auth: none } @@ -16,8 +16,26 @@ headers { body:json { { - "username": "testuser", - "password": "testpass" + "args": {}, + "data": "{\n \"username\": \"testuser\",\n \"password\": \"testpass\"\n}", + "files": {}, + "form": {}, + "headers": { + "Accept": "application/json, text/plain, */*", + "Accept-Encoding": "gzip, compress, deflate, br", + "Content-Length": "54", + "Content-Type": "application/json", + "Host": "echo.usebruno.com", + "Request-Start-Time": "1762260235887", + "User-Agent": "bruno-runtime/1.99.3", + "X-Amzn-Trace-Id": "Root=1-6909f50d-3468da337d4402452b3503f4" + }, + "json": { + "password": "testpass", + "username": "testuser" + }, + "origin": "180.151.198.14", + "url": "https://echo.usebruno.com" } } diff --git a/tests/runner/collection-run-report/collection/auth/logout.bru b/tests/runner/collection-run-report/collection/auth/logout.bru index 5a7898b2f..2f7621493 100644 --- a/tests/runner/collection-run-report/collection/auth/logout.bru +++ b/tests/runner/collection-run-report/collection/auth/logout.bru @@ -4,9 +4,9 @@ meta { seq: 4 } -delete { - url: https://httpbin.org/delete - body: none +post { + url: https://echo.usebruno.com + body: json auth: none } @@ -14,6 +14,26 @@ headers { Accept: application/json } +body:json { + { + "args": {}, + "data": "", + "files": {}, + "form": {}, + "headers": { + "Accept": "application/json", + "Accept-Encoding": "gzip, compress, deflate, br", + "Host": "echo.usebruno.com", + "Request-Start-Time": "1762260355402", + "User-Agent": "bruno-runtime/1.99.3", + "X-Amzn-Trace-Id": "Root=1-6909f585-57dba07b099d8b143524cc8a" + }, + "json": null, + "origin": "180.151.198.14", + "url": "https://echo.usebruno.com" + } +} + tests { test("This test will also fail", function() { expect(res.getStatus()).to.equal(500); // Intentional failure