Commit Graph
6651 Commits
Author SHA1 Message Date
Bob Qiu e32d8cb4e1 feat: add step instrumentation for flow methods
- Introduced a new `step` decorator to enhance method reporting in flows.
- Removed the old step instrumentation logic from `step-instrumentation.ts`.
- Updated various flow classes to utilize the new `@step()` decorator for method tracking.
- Simplified page manager by removing the instrumentWithSteps function.
- Adjusted tests to ensure compatibility with the new step reporting mechanism.
2026-10-30 17:40:37 +08:00
Bob Qiu 8e856242c0 refactor: update button locators to use role and test ID selectors
- Replaced various button locators using text matching with role and test ID selectors across multiple pages for improved accessibility and maintainability.
- Updated methods in GitSyncPage, GrpcRequestPage, HttpRequestPage, ImportPage, InvitePage, McpClientPage, MockServerPage, PreferencesPage, ProjectSettingsPage, RequestPage, ResponsePage, RunnerPage, ScriptTabComponent, SocketIORequestPage, TemplateTagPage, VariableSourcePage, and WorkspacePage.
- Enhanced code readability and consistency by standardizing locator strategies.
2026-10-30 17:29:55 +08:00
Bob Qiu 4c8d860b0e fix(insomnia-test): update ESLint config to include electron-builder.config.ts and clarify root config error 2026-10-30 16:52:22 +08:00
Bob Qiu 907aceccf5 refactor(insomnia-test): migrate electron-builder config to TypeScript and remove outdated CJS version 2026-10-30 16:51:53 +08:00
Bob Qiu 937f0b4da6 feat: add mock servers for various protocols and OAuth2 support
- Introduced `mock-bin-server.ts` for handling mock API requests and responses.
- Added `oauth2-server.ts` to simulate OAuth2 authorization flows with in-memory token management.
- Implemented `socket-server.ts` for WebSocket communication with authentication.
- Created `ws-echo-server.ts` for echoing WebSocket messages.
- Updated `upgrade-fixture.ts` to use `import.meta.dirname` for path resolution.
- Modified `package.json` to switch script files from `.js` to `.ts` for TypeScript compatibility.
- Adjusted Playwright configuration to reference TypeScript files for mock servers.
- Enhanced cloud sync mock to reflect changes in file extensions.
- Updated TypeScript configuration to allow importing TypeScript extensions.
2026-10-30 16:44:50 +08:00
Bob Qiu 09efadd1b8 refactor(insomnia-test): update SKILL.md for improved test case writing guidance and remove outdated reference.md 2026-10-30 16:27:12 +08:00
Bob QiuandClaude Sonnet 5.5 96e552d447 chore(insomnia-test): address review cleanup items (#17-#27)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 16:19:02 +08:00
Bob Qiu 8f2117cbd5 fix(insomnia-test): update node setup to include GitHub package registry and scope 2026-10-30 16:14:12 +08:00
Bob Qiu 892c4aefe3 feat(insomnia-test): add type-check script and workflow step 2026-10-30 16:09:54 +08:00
Bob Qiu 2d2b1ebe7c fix(test): clarify comments on worker configuration and session handling 2026-10-30 16:04:44 +08:00
Bob QiuandClaude Sonnet 5.5 0473910178 ci(insomnia-test): align workflow with test-e2e.yml
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 16:01:11 +08:00
Bob QiuandClaude Sonnet 5.5 86057728ab test(insomnia-test): add requireItemNode with DEFAULT_TIMEOUT and descriptive error
Flows that dereference the tree lookup result with node! now use
requireItemNode, which waits up to DEFAULT_TIMEOUT and throws naming the
missing node. findItemNode keeps its short budget and undefined result for
absence checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 15:59:43 +08:00
Bob Qiu 2382f8ff01 fix(insomnia-test): update SKILL.md and reference.md for linting and focus mode behavior 2026-10-30 15:39:00 +08:00
Bob QiuandClaude Sonnet 5.5 70f57f7acb test(insomnia-test): sync framework-layer page object and coverage fixes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 15:26:07 +08:00
Bob QiuandClaude Sonnet 5.5 7b92e198fd feat(insomnia-test): add setParamsBulk to set request params via the bulk editor
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 11:01:44 +08:00
Bob QiuandClaude Sonnet 5.5 ac6b414663 fix(insomnia-test): address code-scanning findings in mock servers and git-sync page
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob Qiu 78118814db Refactor code structure for improved readability and maintainability 2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 6d6538b83f feat(insomnia-test): add page/flow methods, enums, models and mock-server endpoints used by later specs
Framework-level additions moved from test/refactor_e2e_tests: git diff-view and
unknown-fields helpers, MCP capability/list helpers, cloud-sync commit dialog
helpers, upgrade fixture, MCP scriptable list server and custom-CA port,
cloud-sync seed-project endpoint, certs typings and cookie Expires parsing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 456e536bc4 feat(insomnia-test): add response export, folder environment, environment picker, variable-source and prompt-tag helpers
Page/Flow helpers used by the HTTP, environment and template-tag specs:
- ResponsePage/HttpRequestFlow: export response (raw/prettified/HTTP debug), Save To File, export option state
- FolderPage/FolderFlow: set folder environment variables
- EnvironmentPage/EnvironmentFlow: environment pickers, Add Project Environment, collection sub-environment privacy
- VariableSourcePage/VariableSourceFlow: variable tooltip, source modal and Open navigation
- TemplateTagPage/TemplateTagFlow: Prompt tag answer/clear cache
- echo-server: /large-json route; PageManager passes the Electron app to ResponsePage

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob Qiu 7fede618ec fix(reference): update terminology from Response to ResponseView for consistency in documentation 2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 00c1860ed7 refactor(insomnia-test): consolidate framework changes into base PR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob Qiu 120474fd46 fix(reference): update request state terminology and clarify enum references in documentation 2026-10-30 10:27:48 +08:00
Bob Qiu 15873821af fix(insomnia-test): update shard count calculation to derive from test cases and improve node_modules handling 2026-10-30 10:27:48 +08:00
Bob Qiu 9d19bade07 fix(request-page): locate rows by fixed position to prevent stale locators during value entry 2026-10-30 10:27:48 +08:00
Bob Qiu 4a1c54ceda fix(request-page): ensure stable attribute before setting value to prevent data loss 2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 50281f756f fix(insomnia-test): locate key/value rows by position to survive provisional key swap
setKeyValuePairs resolved the new row by its data-key, which changes from
the provisional pair-blank_* key to the persisted id once the name is
saved. The value editor locator then never resolved, timing out in
setCodeMirrorValue (template-tag header-name, http happy-path, query-params).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob Qiu 31b282fd3b chore: reorder import statements for consistency in response.page.ts 2026-10-30 10:27:48 +08:00
Bob Qiu 97031ab111 chore: remove unused file watcher exclusions from VSCode settings 2026-10-30 10:27:48 +08:00
Bob Qiu c7acfd0a8c feat: update electron-builder config for E2E testing and add eslint config for insomnia-test 2026-10-30 10:27:48 +08:00
Bob Qiu bd2dc91ab2 chore: update .gitignore to remove test artifacts and add new file for insomnia-test 2026-10-30 10:27:48 +08:00
Bob Qiu 0d9d8e958c fix: update watcherExclude settings in VSCode configuration 2026-10-30 10:27:48 +08:00
Bob Qiu 7c6859fd99 refactor(insomnia-test): rename certificate model and update imports 2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 6bcf050d99 refactor(insomnia-test): import expect directly from @playwright/test
Drop the pass-through re-exports of expect from misc/fixtures.ts and
misc/git-fixtures.ts, import it from @playwright/test in specs, and
update the write-insomnia-test skill accordingly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 030cc565a4 refactor(insomnia-test): split overloaded Flow methods into explicit ones
WorkspaceFlow.create/duplicate/rename, ExportFlow.export and
EnvironmentFlow.create dispatched on argument types via typeof/instanceof
and casts, so a call site did not show which flow it triggered. Replace
them with explicitly named methods (createProject, openLocalGitFolder,
cloneGitProject, createCollection, duplicateRequest, renameCollection,
exportProject, createBaseEnvironment, ...) and update the
write-insomnia-test skill docs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 58879e7b11 refactor(insomnia-test): rename Response model to ResponseView
The type represents the response pane (response data plus console, stream
events and script test results), not the network response, and clashed
with the insomnia-data Response name. Update flows, pages, specs, JSDoc
and the write-insomnia-test skill accordingly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 1a18a78954 fix(insomnia-test): address Copilot review comments
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 a43a05a9d1 fix(insomnia-test): break flow-manager/workspace.flow import cycle
WorkspaceFlow now takes a structural RequestFlows dependency instead of
importing FlowManager, which removes the 3 new circular references.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 99e082acf5 fix(insomnia-test): don't echo exception text in mock-bin-server 500 response
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 6918f64158 fix(insomnia-test): send mock-bin-server responses as text/plain with nosniff
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 f701fc6c2a chore(insomnia-test): fix lint errors
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 4ebc77dd6f feat(insomnia-test): add mock servers referenced by constants and flows
Adds the event-stream, socket.io, ws-echo, mcp, grpc, git, oauth2 and
mock-bin servers (bound to 127.0.0.1), their proto/upload fixtures, npm
scripts and Playwright webServer entries, so flows that reference them
no longer fail with connection refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 b3ff0e64dc fix(insomnia-test): address PR review comments
- bind mock-api and echo-server to 127.0.0.1
- remove per-test dataPath after use
- throw when setCodeMirrorValue does not hold after retries
- drop continue-on-error from the build job
- shorten cookie waitForPersisted docstring

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 6a66e38ccb test(insomnia-test): add petstore fixture required by the echo server at startup
misc/echo-server.js reads misc/fixtures/petstore-swagger.json when it
starts, so the fixture must land together with the server; otherwise every
shard's webServer exits with ENOENT.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bob QiuandClaude Sonnet 5.5 77bffe8352 test(insomnia-test): add Playwright E2E framework, CI workflow and write-insomnia-test skill
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 10:27:48 +08:00
Bingbing f6f3849594 refactor: extract useRootLoaderData out of root.tsx (break 55 circular imports) (#10494)
[INS-3831](https://konghq.atlassian.net/browse/INS-3831)

## Summary
- Extract `useRootLoaderData` + `RootLoaderData` from `src/root.tsx` into `src/ui/hooks/use-root-loader-data.ts`.
- Repoint all 65 importers from `~/root` to the new module, plus the two `vi.mock('~/root')` test stubs; remove the now-dead exports (and divergent stale shape) from root.tsx; annotate `clientLoader` return as `Promise<RootLoaderData>`.
- Hook return type keeps the documented `| undefined` contract of `useRouteLoaderData`.

## Why
root.tsx imports modals/settings/codemirror modules which import `useRootLoaderData` back — 55 of the 83 baselined cycles close through this single edge.
2026-10-29 10:55:26 +00:00
George d6e9ea3ade refactor: improve scratchpad tutorial panel snooze time (#10672)
* chore: improve scratchpad tutorial panel snooze time

* fix: comment
2026-10-29 08:32:05 +00:00
Bingbing f4d768160b refactor: inject curl executor into scripting environment (#10483)
[INS-3767](https://konghq.atlassian.net/browse/INS-3767)

## Summary
- Remove the scripting environment dependency on Insomnia's libcurl module.
- Inject a curl request executor into InsomniaObject instead.
- Keep node execution on the node curl implementation and renderer execution on the hidden-window bridge.
- Enable TypeScript checking for the scripting-environment source after the application runtime dependency is removed.

## Risk isolation
This is intentionally stacked on #10482 so the curlRequest plumbing can be reviewed separately.
2026-10-29 07:59:13 +00:00
yaoweiprcandClaude Sonnet 5 547a7f291a fix(Git Diff): clarify invalid file message in visual diff view (#10677)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-29 07:26:59 +00:00
Curry Yang 1d42a66ac8 chore: update dompurify (#10667) 2026-10-28 10:21:22 +00:00
Bingbing 7863413757 fix: clear stale sync flags after a project leaves cloud sync [INS-3899] (#10668)
## Background

Workspace `hasUncommittedChanges` / `hasUnpushedChanges` flags are written only by cloud sync. When a project stopped being a cloud project, those flags were never cleared, so the project overview cards kept showing "Uncommitted changes".

Repro:

1. Open a cloud project whose workspaces have uncommitted changes.
2. Remove the project from the remote.
3. Open the project overview. The cards still show "Uncommitted changes" although the project is now local.

A project converted from cloud to git carries the same residual flags, because the values come from its former cloud state.

## Changes

- Clear both workspace sync flags when a project's `remoteId` becomes `null` in the project service. Remote deletion, conversion to local, cross-organization move, and conversion to git all update the project through this service.
- Reuse the cleanup in the startup database repair to fix existing stale records. Only dirty workspace metas are written, and `modified` is preserved.
- Add service and repair tests.

## Testing

- `npm test -w insomnia-data` (538 tests)
- `npm run type-check -w insomnia-data`
- `npm run lint -w insomnia-data`

## References

- INS-3899
2026-10-28 09:58:34 +00:00