insomnia/packages/insomnia-smoke-test/tests/smoke/websocket.test.ts

68 lines
3.4 KiB
TypeScript
Raw Normal View History

Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
import { expect } from '@playwright/test';
import { loadFixture } from '../../playwright/paths';
import { test } from '../../playwright/test';
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
test('can make websocket connection', async ({ app, page }) => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');
const statusTag = page.locator('[data-testid="response-status-tag"]:visible');
const responseBody = page.locator('[data-testid="response-pane"] >> [data-testid="CodeEditor"]:visible', {
has: page.locator('.CodeMirror-activeline'),
});
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByTestId('project').click();
await page.getByRole('button', { name: 'Create' }).click();
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
const text = await loadFixture('websockets.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitem', { name: 'Import' }).click();
await page.getByText('Clipboard').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('button', { name: 'Import' }).click();
await page.getByText('CollectionWebSocketsjust now').click();
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('button', { name: 'localhost:4010' }).click();
await expect(page.locator('.app')).toContainText('ws://localhost:4010');
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await page.click('text=Connect');
await expect(statusTag).toContainText('101 Switching Protocols');
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('tab', { name: 'Timeline' }).click();
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await expect(responseBody).toContainText('WebSocket connection established');
await page.click('text=Disconnect');
await expect(responseBody).toContainText('Closing connection with code 1005');
// Can connect with Basic Auth
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('button', { name: 'basic-auth' }).click();
await expect(page.locator('.app')).toContainText('ws://localhost:4010/basic-auth');
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await page.click('text=Connect');
await expect(statusTag).toContainText('101 Switching Protocols');
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('tab', { name: 'Timeline' }).click();
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await expect(responseBody).toContainText('> authorization: Basic dXNlcjpwYXNzd29yZA==');
// Can connect with Bearer Auth
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('button', { name: 'bearer' }).click();
await expect(page.locator('.app')).toContainText('ws://localhost:4010/bearer');
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await page.click('text=Connect');
await expect(statusTag).toContainText('101 Switching Protocols');
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('tab', { name: 'Timeline' }).click();
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await expect(responseBody).toContainText('> authorization: Bearer insomnia-cool-token-!!!1112113243111');
// Can handle redirects
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('button', { name: 'redirect' }).click();
await expect(page.locator('.app')).toContainText('ws://localhost:4010/redirect');
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await page.click('text=Connect');
await expect(statusTag).toContainText('101 Switching Protocols');
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('tab', { name: 'Timeline' }).click();
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
await expect(responseBody).toContainText('WebSocket connection established');
const webSocketActiveConnections = page.locator('[data-testid="WebSocketSpinner__Connected"]');
// Basic auth, Bearer auth, and Redirect connections are displayed as open
await expect(webSocketActiveConnections).toHaveCount(3);
// Can disconnect from all connections
await page.locator('button[name="DisconnectDropdown__DropdownButton"]').click();
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) * Update version of react-aria package * Create dropdown hint component * Create dropdown button component * Create the popover component * Create the menu item component * Create the menu section component * Create the menu component * Create the dropdown related components * Change the hotkey html tag * Added full width option for prompt-button * Replace the dropdown with the new * Add some default props for dropdown * Used themed button into dropdown button * Added style prop for dropdown * Remove checkmark from menu item * Added styled props to popover * Remove inner button from account toolbar * Added new dropdown into cookie-list * Revert package update * WIP * Delete button component and replace it's usage with dropdown button * Fix spacing * Added className for code-editor dropdown * Remove the old dropdown * Change import * Revert some ref changes * Added ref to dropdown * Fixed some styles * Fix issues like autosave and added isDisable prop * Add title * Remove insomnia-common imports * Remove insomnia-common imports * Fix code format * Change style and fix code format * Fix styles * Replace dropdown import * Fix divider style * Fix last icon in sidebar create dropdown * Fix issue with dropdown and the resizing screen * Fix linter issues * Moved the prompt button into itemContent component * Change styled component * Fix issue with sidebar-request-row to display the dropdown on hover * Remove the item content in a separate component * Remove unused css * Destructure children props * Fix trigger prop for grpc-method-dropdown * Added prompt button when user delete test suite * Hide empty dropdown items from section * Fix linter issues * Added Checkmark into item content * Fix issue with linter and shortcut component * Fixed linter issues * Revert fragments * Fix linter issues * Added props for multiple select and disable * Fix close issue with sidebar dropdown * Update disable and stay open prop for all dropdowns * Added aria-label for dropdown, section, items * Added selected style for item * Added logic for disabled items * Fixed issue with selected items * Fix issue with selection of grpc method dropdown * Added aria-label to code-editor * Fix issue with onClick and prompt * Hide sections if it's empty * Remove on select from item content * Pass closeOnSelect props in the menu * Removed dataTestId from dropdown items in request-actions * Fix debug sidebar dropdown tests * Change the cookie editor interactions tests * Fix dashboard interactions tests * Fix design-interactions tests * Fixed grpc-interactions tests * Fix plugins interactions tests * Fix preferences interactions tests * Fixed request-pane-tab tests * Fixed app smoke tests * Update git-sync smoke tests * Fix space issue * Fixed graphql smoke test * Fixed oauth smoke test * Fixed oauth smoke test * Fixed websocket smoke test * Fixed cookie-editor-interactions tests * Remove the dropdown unit test * Made small refactoring and remove unnecessary props * Fix issue with grpc-method-dropdown * Change the grpc smoke test * Added default role props * Update all tests that use project role * Remove console.log * Fix issue with themes * REmove dropdown import from index.less file * Remove handleClick and add some comments * Use getItemCount from react-stately * Remove method-dropdown css * Fix shortcut button style * remove extra space on sync-dropdown * fix lint * Remove unused prop * Fix issue with remote workspace dropdown * remove divider on first section if empty * remove unused showGrpc option in method dropdown * Fix issue with workspace-dropdown * Fix git-sync-dropdown issues * Fix issue with remove workspaces dropdown * Fix sync-dropdown component * Added disable style * Moved server reflection and proto file outside of the dropdown * Fix style when item is selected * Fix issue with grpc smoke test * Fix issue with menu props * Disable server reflection button if url is empty Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 14:49:52 +00:00
await page.getByRole('menuitem', { name: 'Disconnect all requests' }).click();
await expect(webSocketActiveConnections).toHaveCount(0);
Initial WebSocket support (#5043) * [INS-1697] Create WebSocket Request (#5041) * add fail safe Co-authored-by: Mark Kim <mark.kim@konghq.com> * Websockets IPC API (#5044) * add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <mark.kim@konghq.com> * [INS-1701] Create/Close Websocket Connection (#5046) * add websocket action bar and its components * remove comments * clean up * reflect on the electron api * remove unused files * import name change * add styling * remove commet * add suggested changes * remove default value * Add WebSocketRequest to sidebar and update types (#5048) * [INS-1700] Delete Websocket Request (#5055) * add websocket actions dropdown * add actions to websocket request in sidebar * [INS-1703] Display WebSocket messages - first pass (#5054) * Update event types to improve inference * Update websocket response pane to fetch/subscribe and display the events * [INS-1693] Add WS echo server for smoke tests (#5050) Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> * fix sidebar unit tests (#5064) * [INS-1776] adds `ws` dependency explicitly (#5066) * [INS-1702] WebSocket Send Message (#5052) * add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending * [INS-1778] Fix Global Module Typing Issue (#5065) * fix typings * add jest import * [INS-1703] View WebSocket Messages (#5074) * save changes * add styles and move files around * remove unused code * clean up some components * add clean up * add timestamp component * add unit tests * add case * add style changes * [INS-1786] WebSocket headers tab (#5080) * first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout * Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx * Show HTTP->WS upgrade (handshake) (#5091) * first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <jamesgatzos@gmail.com> * INS-1788: Add control flow to improve responsiveness. (#5094) * INS-1788: Add control flow for responsiveness. This prevents events from flooding the UI thread entirely. * Add additional code comments. * fixup: webSocketEvent -> webSocketEvents * display response headers (#5102) * Show errors in timeline (#5100) * remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type * Make the head row sticky in the events table (#5103) * Add client certificate support to websocket connections (#5112) * [INS-1810] close connection on response change (#5104) * close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a927e8c0cab21dc5d5b4ecd852e3d9c5190. * [INS-1803] show cookie tab in response pane (#5105) * hard code sending and storing to true * make tab naming consistent * hard code cookie settings to false * fix headers isDisabled bug * [INS-1805] Add Auth Header Tab (#5115) * add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint * [INS-1839] Rename tab Header everywhere (#5119) * can import/export websocket requests (#5122) * use responseId for timeline name (#5124) * add react-virtual to virtualize the event log view (#5126) * [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler * remove digest auth (#5129) * remove auth header and outbound message timeline (#5130) * [INS-1840] Add Connected Status Label and Extras (#5131) * add status related changes * text label change * WebSocket ipc typing proposal (#5125) * make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts * Set the environment for websocket responses (#5132) * first pass (#5123) * [INS-1843] Add more checks to WS smoke test (#5138) * Fix failing websocket smoke test * Add remaining websocket smoke server endopints to fixtures * Add checks for basic-auth, bearer and redirect * Rm assertion * can select payload type (#5133) * Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134) * fix websocket->webSocket (#5142) * bug fix (#5144) * INS-1844: Implement basic event view functionality. (#5146) * INS-1844: Implement basic event view functionality * CSS fix to align Preview button with tab buttons. * Reverse the order of WebSocket events (#5148) * Reverse the event log order in the view and subscribe to messages after the latest * WebSocket response model (#5147) * init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model * can select and save payload message and preview mode (#5143) * [INS-1838] Add Empty State (#5140) * add empty state * use the empty state pane Co-authored-by: gatzjames <jamesgatzos@gmail.com> * Bug/stabilise-ws-fetch-method (#5152) * just poll * remove cts and eventlog channel * Fix/nitpicks (#5156) * remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane * add websockets to quick switch (#5159) * [INS-1800] Remove value validity check in the WebSocket headers (#5154) * remove valid value check in the headers * add header name filtering Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com> Co-authored-by: Mark Kim <mark.kim@konghq.com> Co-authored-by: Filipe Freire <livrofubia@gmail.com> Co-authored-by: Jack Kavanagh <jackkav@gmail.com> Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com> Co-authored-by: David Marby <david@dmarby.se>
2022-09-09 14:53:28 +00:00
});